installation d’apache

apache est un serveur web:

on install:


apt-get install apache2 libapache2-mod-php5 apache2-mpm-itk

Dans le fichier de conf /etc/apache2/apache.conf
– on ajoute:

ServerName fredptigars.homelinux.org

– On modifie
ServerTokens Prod

Pour les hosts virtuel, on modifie le fichier /etc/apache2/sites-available comme ce ci:

NameVirtualHost *

ServerAdmin webmaster@localhost

DocumentRoot /home/web/

Order Deny,Allow
Deny from all
Options None
AllowOverride None


Options FollowSymLinks
Order Allow,Deny
Allow from all

Alias /private /var/www

Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Deny,Allow
Deny from all
allow from localhost
Allow from 192.168.0.0/24
ErrorDocument 403 "http://fredptitgars.net"

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined
ServerSignature On

Alias /doc/ "/usr/share/doc/"

Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128

#Empecher le telechargement de fichiers .htaccess
AccessFileName .httpdoverride

Order allow,deny
Deny from all
Satisfy All

cela nous créé 2 hôtes virtuels:
– / => accessible de tous, la racine du site qui pointe sur /home/web
– /var/www => accessible uniquement du réseaux local qui pointe sur /var/www

Les modules

Les modules pret sont dans le répertoire : /etc/apache2/mods-available

pour activer un module il suvit de rentrer la commde (en root):

a2enmod

Il ne reste plus qu’a recharger apache:

/etc/init.d/apache2 reload

pour désactiver un module, tout simplement


a2dismod

Man est ton ami…


Les sources:

http://doc.ubuntu-fr.org/apache2

http://doc.ubuntu-fr.org/tutoriel/securiser_apache2