Archive for December 2nd, 2011

Install php5 and php4 in cPanel server

Now php has flushed their support for php4. Now most of the sites are loading under php5. But traditional php sites won’t work under php5. So we have to have php5 as primary and php4 as secondary php. Previously it was php4 as default and php5 as secondary, but now it is in the other […]

Install mod perl as DSO module

There are different ways to install mod_perl. This article explains how to install it as DSO using Apache extension tool apxs. 1) Download and untar the source. $ cd /usr/local/src $ wget http://perl.apache.org/dist/mod_perl-1.0-current.tar.gz $ tar -xzf mod_perl-1.0-current.tar.gz $ cd mod_perl-1.29/ 2) Configure it as DSO $ perl Makefile.PL USE_APXS=1 WITH_APXS=/usr/local/apache/bin/apxs EVERYTHING=1 $ make $ make […]

Install mod evasive

Download mod_evasive from http://www.nuclearelephant.com/projects/mod_evasive/ $ tar zxvf  mod_evasive_1.10.1.tar.gz $ cd mod_evasive Compile mod_evasive apache module For Apache 2 $ /usr/local/apache/bin/apxs -i -a -c mod_evasive20.cFor Apache 1.3 $ /usr/local/apache/bin/apxs -i -a -c mod_evasive.c Compilation is done under the assumption that path to apache is /usr/local/apache. If not replace /usr/local/apache with your path to apache. Edit your […]

Configure Apache to listen multiple ports

The listen directive in the Apache configuration file can be used to make Apache to listen in a particular port or IP address or port combination. Listen 80 Listen 8000 In this format the Apache server listens on the given ports on all interfaces (IP addresses) which are up in the server. If you mention […]

How to install APC (Alternative PHP Cache)

APC gives our server a huge performance boost. It is a free and robust framework for caching and optimizing PHP intermediate code. The installation steps are given below : 1. Login to the server as root 2. Download APC. You will get the latest tar file from the site http://pecl.php.net/package/apc       wget http://pecl.php.net/get/APC-3.0.14.tgz 3. Extract and […]

Apache Error: Unable to open logs

Sometimes apache will fail to start. It will show the following error message in apache error logs: Unable to open logs This is because of the low number of file descriptors. Check the current limit of file descriptors in the file /proc/sys/fs/file-max: $ cat /proc/sys/fs/file-max 1024 If fs.file-max is quite small (several thousands or so), […]

Fsck.ext3: Unable to resolve UUID

If you are getting the FSCK error fsck.ext3: Unable to resolve ‘UUID=a3e1dbca-60ee-4aa4-bf79-60cf6d96075d’ on system booting, then you can try following steps to resolve that : 1. Use following command to get the UUID of current partitions. blkid 2. Open the /etc/fstab file and check the UUID in the fstab and the result of blkid are […]

Apache failed to start with the “No space left on device” error.

If you receive the following error while restarting Apache in the server, you need to do the following steps. Error:- [error] (28)No space left on device: Cannot create SSLMutex Configuration Failed These errors means that there is no available IPC (inter-process communication)  resources in the system, such as semaphores or shared memory segments. You need […]

Disable mod_security2 for a single domain

Mod_security is an open source Apache module. This can be considered as firewall for web applications. It secures the system from the attackers. We use mod_security1 for Apache1.x and Apache 2.x uses mod_security2. In case of mod_security1, we can disable it for a domain using the .htaccess file. If you want to disable mod_sec for […]

Bash Script to Check Apache Memory Usage

We might have come across many situation where we need to find the memory usage by apache and which script or from which directory this process is being called. You can use the script given below to find that and log it whenever the load goes beyond a threshold value. Which also help us to […]