Webserver Installation

Installing Apache 2 in Debian 3.1 (Sarge) with PHP support

  By Default apache2 package you will be given the package apache2-mpm-worker, other packages are available:


The worker MPM provides a threaded implementation for Apache2. It is considerably faster than the traditional model, and is the recommended MPM.


This Multi-Processing Module (MPM) implements a non-threaded, pre-forking web server that handles requests in a manner similar to Apache 1.3. It is appropriate for sites that need to avoid threading for compatibility with non-thread-safe libraries.


#apt-get instal install apache2

#apt-get install apache2-mpm-prefork

That's it  basic apache2 installation finished.If you want to test your installation go to your browser and type the following


This should display welcome message then your installation is correct.

Default document root directory for apache2 is /var/www

If you want to change the default document root directory in apache2 you have  to modify /etc/apache2/sites-available/default file.Edit this file and change the path to where ever you want to change.

 PHP Support For Apache2

 If you want to add support of php and cgi scripts install the following packages libapache2-mod-php4,php4-cli,php44-common,php4-cgi

 debian01/# apt-get install libapache2-mod-php4 php4-cli php4-common php4-cgi

Make sure you have all the following lines need to uncomment somewhere in your apache2.conf (or in your conf.d/php.ini) file:

LoadModule php4_module modules/

# Cause the PHP interpreter to handle files with a .php extension.
AddType application/x-httpd-php .php

If you want to allow the different index files types check for the following line in /etc/apache2/apache2.conf file

 DirectoryIndex index.html index.cgi index.php index.xhtml index.shtml

 Restart the apache server

 /etc/init.d/apache2 restart

If you want apache server web interface or GUI tools click here