By: serverhedge | September 24, 2016

On a cPanel server the Apache configuration file resides under /usr/local/apache/conf/httpd.conf. On non control panel servers the location will be /etc/httpd/conf/httpd.conf. Basically the following directives focusing on how Apache handles the webpage requests.

TimeOut 300

The time out setting decides how long a script should run. On VPS it is better to set below 100.

KeepAlive On

The directive should be 'On' allows for multiple requests to come from the same tcp connection.

MaxKeepAliveRequests 100

This setting limits the number of requests allowed per persistent connection when KeepAlive is on

KeepAliveTimeOut 15

The number of seconds Apache will wait for another request before closing the connection. Setting this to a high value may cause pe...

By: serverhedge | September 07, 2016

This blog post covers the basic installation & configuration 

of TOMCAT 8 on CentOS 7

Install Java - OpenJDK 7 on your CentOS server.

yum install java-1.7.0-openjdk-devel

Default JAVA_HOME directory will be  /usr/lib/jvm/jre

Now you should create a TOMCAT group & User as well.

groupadd tomcat

Now create a TOMCAT user with limited access privileges.

useradd -M -s /bin/nologin -g tomcat -d /opt/tomcat tomcat

Here the the TOMCAT user's home directory will be /opt/tomcat tomcat. Now you should download the latest  bin distribution of TOMCAT to the TOMCAT user's home directory /opt/tomcat, from the official repository.

 wget  http://tomcat.apache.org/download-80.cgi#8.0.23

Next extract the tarball to the /opt/tomcat .

tar xvf apache-tomcat-8*tar.gz ...

By: serverhedge | September 03, 2016

The global php.ini file location in cPanel server is, 


You should copy the file in to the public_html folder of the desired account(username).

cp -pv /usr/local/lib/php.ini /home/username/public_html/php.ini # Always replace 'username' with desired account name.

Add the correct user permission to the copied php.ini file as follows.

chown -v username:username /home/username/public_html/php.ini

You can test this by creating a phpinfo.php in public_html folder.

Vi phpinfo.php 

Add the following lines to the phpinfo.php file.


Now you can check the loaded configuration by accessing the URL below.

http://domainname.com/phpinfo.php.   # Replace 'domainname.com' with your domain name.

Now the php.ini path in 'lo...

By: serverhedge | August 29, 2016

Setup SELinux to permissive mode or disable it.  Then you should edit /etc/selinux/config file

Then setup the SELINUX value as permissive or disabled.

vi /etc/selinux/config
The SELINUX value as permissive or disabled.
Now Reboot the system.

Add MongoDB repository and install it using yum. Then, you should create  


/etc/yum.repos.d/mongodb.repo file:

vi /etc/yum.repos.d/mongodb.repo

Add the following lines:

name="MongoDB" Repository 
"gpgcheck="1" enabled="1" 

Now you should save and close the file. Then, update the repositor...

By: serverhedge | August 27, 2016

We can easily wipe out the system cache, obsolete packages and dependencies using commands below:

                sudo apt-get autoremove

                sudo apt-get autoclean

These commands will not remove manually installed kernels.


How to use purge-old-kernels utility

Purge-old-kernels utility comes with Ubuntu 16.04 LTS by default. In older versions, you have to install ‘byobu’ or‘bikeshed’ to use this utility.

                 sudo apt-get install bikeshed

                  sudo apt-get install byobu

                  sudo purge-old-kernels

This utility will never remove the currently running kernel. By default, it will keep at least the latest 2 kernels, but the user can override that value using the  --keep parameter., t...

By: serverhedge | August 24, 2016

                     Since for shared, dedicated webhosting servers one of the hardest problem facing is heavy resource consumption by PHP/MySQL, each threads of the processes hogs from 33 to 100% of RAM as well as CPU. This will affect the performance of the server and the websites. Any competitive websites will always be sluggish even if the server is built with Gigabytes of RAM and heavy CPU as well, which truly comes with high monthly investments.

The answer to this problem is lack of performance tuning. One of the best ways to identify these processes are by running top command from your Linux Command prompt. Here you see MySQL will always be in the top position with high RAM and CPU utilization. Then you can see the dynamic results of ...