• # Re VirtualHost & DocumentRoot

    Posté par (site web personnel) . En réponse au message apache 1.33: afficher l'url correspondant au nom de domaine ... comment?. Évalué à 4.

    Tu as plusieurs solutions,

    1/ tres simple:
    Tu change la racine de ton serveur web.
    Recherche une ligne:
    DocumentRoot /var/www/
    Dans ton httpd.conf et change la pour:
    DocumentRoot /var/www/html/uo

    Rq: quitte à faire cela autant déplacer les fichiers depuis /var/www/html/uo vers /var/www

    2/ plus propre: création d'un virtual host pour ton domaine
    univ-ouaga.bf:
    Crée le fichier /etc/apache/conf.d/virtual-uo.conf avec le contenu suivant
    ---8<------
    NameVirtualHost *
    <VirtualHost *>
    ServerAdmin webmaster@localhost
    ServerName www.univ-ouaga.bf
    # ServerAlias univ-ouaga.bf

    DocumentRoot /var/www/html/uo


    Options FollowSymLinks
    AllowOverride None

    <Directory /var/www/html/uo>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all

    DirectoryIndex index.php


    ErrorLog /var/log/apache2/error.log
    LogLevel warn
    CustomLog /var/log/apache2/access-uo.log combined
    ServerSignature On
    </VirtualHost>
    --8<--------------------

    3/ Plus complexe:
    ré-écriture d'url avec mod_rewrite.

    Si tu ne fait pas d'hebergement de masse c'est pas vraiment utile.


    Ps: c'a fait un peu "Renault R5" ton chemin /var/www/html/uo