Howto: Install Apache 2.2.x and PHP 5.3.x on CentOS 5

Assume that you do not want to spend money on your server to have a control panel and having minimal requirement for your website,

1. Install the required packages,

yum install bison flex gcc db4 db4-devel libxml2-devel libpng-devel mysql-devel make

2. Download Apache source (refer the latest one from http://httpd.apache.org/)

wget http://apache.petsads.us//httpd/httpd-2.2.21.tar.gz

3. Download PHP source (refer the latest one from http://www.php.net/)

wget http://my.php.net/get/php-5.3.8.tar.gz/from/us.php.net/mirror

4. Build the Apache,

tar zxvf httpd-2.2.21.tar.gz
cd httpd-2.2.21
./configure --enable-so --enable-rewrite=shared
make
make install
cd ..

5. Build the PHP,

tar zxvf php-5.3.8.tar.gz
cd ../php-5.3.8
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --enable-bcmath \
--enable-ftp --enable-magic-quotes --with-pear --enable-sockets --with-zlib --with-gd
make
make install
cp php.ini-production /usr/local/lib/php.ini
cd ..

6. Now, start the Apache services,

/usr/local/apache2/bin/apachectl start

How to disable mod_security for an account

Sometimes, you might want to disable the mod_security applied to the virtual server and you might wonder how to do it.

If you are using Apache with mod_security, it could be done from the configuration file.

However, you have to understand the Apache version and mod_security version that you used.

Normally, a hosted server will use Apache 1.x with mod_security 1.x and Apache 2.x with mod_security 2.x.

To find out the Apache version, you may use the following command.

httpd -v

With mod_security 1.x, you may use the following command from each of the virtual host path and add into the .htaccess file.

Continue reading How to disable mod_security for an account