EasyApache Error -Timeout on connect..Can’t use an undefined value as an ARRAY reference at /usr/local/cpanel/Cpanel/HttpRequest.pm line 550.

Recently i had following error while re-compiling apache server from cPanel/WHM. I googled the issue and found some good solutions however i did it by my own way, I just followed the following below steps:

  • Login to SSH by root details.
  • open the file /etc/hosts by:
  • $ nano /etc/hosts
  • Change the contents of that file as follow:

::1                        localhost.localdomain localhost
127.0.0.1                        localhost.localdomain localhost
IPaddress of your server                  server.yourdomain.com server

and you ‘re done, now your hosts file seems to be configured correctly.

Install Mod_Evasive on apache

In this tutorial i will describe how to install MOD_EVASIVE on a VPS or Dedicated Server, it offers protection against DDoS attacks on the server and is a apache module.

Installation:

  • Login to your server through SSH with valid root details.
  • Run these commands:
# wget http://www.zdziarski.com/projects/mod_evasive/mod_evasive_1.10.1.tar.gz
# tar zxf mode_evasive-1.10.1.tar.gz
# cd mod_evasive
  • Then run following command for apache:
# > /usr/sbin/apxs -cia mod_evasive20.c
  • It will install the mod_evasive on the server.
  • Now you would need to edit httpd.conf file, to do so follow instructions:
  • Open the httpd.conf file in nano text editor
# nano /etc/httpd/conf/httpd.conf
  • And place the following lines into it:
<IfModule mod_evasive20.c>
DOSHashTableSize 3097
DOSPageCount 2
DOSSiteCount 50
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 10
</IfModule>
And you are done, this will install and activate Mod_Evasive on the server.
Feedback are welcome 🙂

Start/Restart/Stop Apache2 web server on linux

Here are some short commands for linux OS you can use to execute start/stop and restart apache services. Commands must be executed from linux terminal/ssh in other words they all are ssh commands.

To Start Apache2 web server:

# /etc/init.d/apache2 start
OR
# /etc/init.d/httpd start
OR
# service apache2 start
OR
# service httpd start

To Stop Apache2 web server:

# /etc/init.d/apache2 stop
OR
# /etc/init.d/httpd stop
OR Read More

Apache2 high RAM usage resolution

In this post i will describe how to decrease memory usage of apache2, i tried to search on google and found many solution to that problem but nothing worked for me. So i discovered a way to decrease the memory usage of apache2.

Apache

Apache

Here is the solution:

  • Login to your server via putty / shell terminal with root access.
  • Execute following command:
# cd /etc/apache2
# nano apache2.conf
  • A text editor will appear with apache2 configuration file find the below line in it:
KeepAlive On
  • Replace this line with:
KeepAlive Off Read More