Skip to content
Menu
Valdev
  • Articles
  • A propos / CV
  • Contact
Valdev
20/01/201524/12/2020

[Memo] Ajouter un virtual host sous Ubuntu

1/ éditer /etc/hosts, ajouter :

127.0.0.1       nomsite.local

2/ dans /etc/apache2/sites-available , rajouter un nomsite.local.conf avec ces lignes :

<VirtualHost *:80>
    ServerName nomsite.local
    DocumentRoot /home/chemin_vers/lesite/www # chemin vers le projet
    <Directory />
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.lesite.log
    CustomLog ${APACHE_LOG_DIR}/access.lesite.log combined
</VirtualHost>

3/ Il faut la même chose dans le dossier /etc/apache2/sites-enabled, une commande existe pour ça :

sudo a2ensite monsite1.conf

4/ recharger apache2 : 

sudo /etc/init.d/apache2 reload

1 thought on “[Memo] Ajouter un virtual host sous Ubuntu”

  1. A WordPress Commenter dit :
    10/12/2020 à 14:14

    Hi, this is a comment.
    To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
    Commenter avatars come from Gravatar.

    Répondre

Laisser un commentaire Annuler la réponse

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

©2021 Valdev | Powered by WordPress and Superb Themes!