Web Server (Apache)

This page describes the installation of Apache and PHP which is often required for various services.

Installation

With Debian install the following packages :

  • apache2
  • PHP5

Apache will be installed in prefork mode because the threaded mode is not supported by php.

Configuration principle

The apache configuration is defined into the file /etc/apache2/apache2.conf. This file includes other files dynamically :

  • /etc/apache2/apache2.conf
  • /etc/apache2/httpd.conf
  • /etc/apache2/conf.d/
  • /etc/apache2/sites-enables
  • /etc/apache2/mods-enables

The standard configuration is done by creating one or more files located in /etc/apache2/sites-available/ and enabling them.

To enable of disable a file, use the following commands :

  • a2ensite
  • a2dissite

For modules, the commands are :

  • a2enmod
  • a2dismod

For exemple, to disable the default configuration :

bender:/etc/apache2/sites-available# a2dissite default
Site default disabled; run /etc/init.d/apache2 reload to fully disable.
bender:/etc/apache2/sites-available#

Advanced configuration

To see details of apache configuration, please check the following pages :

Backup

  • /etc/apache2/
  • /var/log/apache2/
  • /etc/logrotate.d/apache2
  • /etc/php5/apache2/php.ini
  • /var/www/

Links

en/linux/serveur_web.txt · Last modified: 2011/12/07 14:43 by matthieu
Recent changes RSS feed Debian Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki