Virtual Host » History » Version 2
Simon, 10/28/2008 03:55 PM
| 1 | 1 | Simon | |
|---|---|---|---|
| 2 | |||
| 3 | = Configurer un Virtual Host - Apache = |
||
| 4 | |||
| 5 | |||
| 6 | |||
| 7 | L' interface publique de l'application est accessible par défaut à l'adresse suivante : http://domaine.tld/linea21/public/ |
||
| 8 | |||
| 9 | Pour y accéder depuis http://www.monsite.com/, créez un virtualhost apache. |
||
| 10 | |||
| 11 | |||
| 12 | Exemple de configuration en local : |
||
| 13 | {{{ |
||
| 14 | <VirtualHost 127.0.0.1:80> |
||
| 15 | ServerName linea21_v1 |
||
| 16 | DocumentRoot /htdocs/linea21_v1/public |
||
| 17 | DirectoryIndex index.php |
||
| 18 | ErrorLog linea21_v1_log |
||
| 19 | 2 | Simon | Alias "/lib" /htdocs/linea21_v1/lib |
| 20 | Alias "/gfx" /htdocs/linea21_v1/gfx |
||
| 21 | Alias "/dashboard/graph.php" /htdocs/linea21_v1/dashboard/graph.php |
||
| 22 | Alias "/publication/contents" /htdocs/linea21_v1/publication/contents |
||
| 23 | Alias "/news/input" /htdocs/linea21_v1/news/input |
||
| 24 | Alias "/user/avatar" /htdocs/linea21_v1/user/avatar |
||
| 25 | 1 | Simon | |
| 26 | <Directory "/htdocs/linea21_v1/public"> |
||
| 27 | AllowOverride All |
||
| 28 | Allow from All |
||
| 29 | </Directory> |
||
| 30 | </VirtualHost> |
||
| 31 | }}} |
||
| 32 | |||
| 33 | Si vous paramétrez un Virtual Host en local, n'oubliez pas de mettre à jour votre fichier ''/etc/hosts''. Dans ce cas : |
||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | {{{ |
||
| 38 | 127.0.0.1 linea21_v1 |
||
| 39 | }}} |
||
| 40 | |||
| 41 | |||
| 42 | Le '''serveur Apache doit être redémarré''' pour que les modifications soient prises en compte. |
||
| 43 | |||
| 44 | |||
| 45 | Plus d'informations sur les Virtual Host Apache, en ligne : |
||
| 46 | |||
| 47 | * http://httpd.apache.org/docs/2.0/vhosts/ |
||
| 48 | * http://httpd.apache.org/docs/2.2/fr/vhosts/ (français) |