Here is how to change from apache2-mpm-prefork to apache2-mpm-worker, , when having used mpm-prefork before, and php5, on Debian Squeeze.

Step1. Stop Apache2:

# /etc/init.d/apache2 stop

Step2. Install apache2-mpm-worker:
That will remove some packages, like apache2-mpm-prefork and libapache-mod-php5, and install apache2-mpm-worker, and php5-cgi instead.

# apt-get install apache2-mpm-worker

Step3. Set Apache2 to use php5-cgi:

Continue Reading…

If you run an Apache2  server then you have no doubt seen the following error messages a thousand times in your error.log file:

File does not exist: /var/www/robots.txt

File does not exist: /var/www/favicon.ico

As you know by now  not having a favicon.ico file  web browsers will requesting  it each time. But you can tell Apache2  not to log the event as a mistake message.

You will still see the request in the access.log, but at least you will have a cleaner error.log file.


Continue Reading…

Apache2 is one of the most widely used HTTP server has a lot of features and can be customized in many ways.

In fact, to this web server, there are basically two ways you can do this, using .htaccess directives or using a file httpd.conf. .

Some people prefer to use. htaccess files, since they reside in the website and can be modified by the site owner, which is not the case for the daemon configuration file:


Permanent redirect  NON WWW to WWW using apache2 server configuration:
RedirectMatch permanent ^/(.*)$1
DocumentRoot /path/to/your/site/files/

In the following tutorial  i will explain the installation of the apache2 module “mod_evasive“.
Mod_evasive tracks the number of requests for files on the Apache2  server and blocks the delivery in case a certain limit is reached.

Step1. Install mod_evasive module:

apt-get install libapache2-mod-evasive

Step2. Create the log directory for mod_evasive:

mkdir -p /var/log/apache2/evasive

NOTE: Make sure the www-data user will have access to create logs:

chown -R www-data:root /var/log/apache2/evasive

Step3. Now edit the configuration file for the module 0 located in /etc/apache2/mods-available/mod-evasive.load like this:

vim /etc/apache2/mods-available/mod-evasive.load

After edit the file will look  like this:

LoadModule evasive20_module /usr/lib/apache2/modules/
 <IfModule  mod_evasive20.c>
 DOSHashTableSize 3097
 DOSPageCount 5
 DOSSiteCount 120
 DOSPageInterval 1.5
 DOSSiteInterval 1.5
 DOSBlockingPeriod 10
 DOSLogDir "/var/log/apache2/evasive"

This config seems to be optimal for me.

Step4. Enable the module and restart apache:

a2enmod mod-evasive
 /etc/init.d/apache2 restart


Page Speed ​​is an open source project started by Google to help developers optimize their web pages by applying best practices in web performance.
Page Speed ​​began as an extension of the open source browser, and is now deployed in third party products as, Show Slow and Google Webmaster Tools.

How it works :

The Page Speed extensions run performance tests on the basis of a set of best practices known to reduce page load time.
mod_pagespeed, the Apache module, automatically optimizes the resources in a web page.


First you need to download the module from here:  mod-pagespeed download

Then run the following commands to install it:

dpkg -i mod-pagespeed-*.deb
apt-get -f install

After you installed the plugin you must restart the apache2 server.

/etc/init.d/apache2 restart

Configure mod_pagespeed for using  on VirtualHosts:

Continue Reading…

Page 3 of 71234567