Accueil > Informatique > Poweredge T105 > installation d’apache

installation d’apache

mardi 26 août 2008, par frederic

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 *
<VirtualHost *>
        ServerAdmin webmaster@localhost

        DocumentRoot /home/web/
        <Directory />
                Order Deny,Allow
                Deny from all
                Options None
                AllowOverride None
        </Directory>
        <Directory /home/web/>
                Options FollowSymLinks
                Order Allow,Deny
                Allow from all
        </Directory>
        Alias /private /var/www
        <Directory /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"
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        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/"
    <Directory "/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
    </Directory>
  #Empecher le telechargement de fichiers .htaccess
   AccessFileName .httpdoverride
   <Files ~ "^\.ht">
       Order allow,deny
       Deny from all
       Satisfy All
   </Files>


</VirtualHost>

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 <nom du module>

Il ne reste plus qu’a recharger apache :

/etc/init.d/apache2 reload

pour désactiver un module, tout simplement

a2dismod <nom du module>

Man est ton ami...


Les sources :
http://doc.ubuntu-fr.org/apache2
http://doc.ubuntu-fr.org/tutoriel/s...