Daily Archives: 08.10.2009
Правильный VirtualHost в Apache2.2
Постоянно путаюсь между IP-based и Name-based версиями. Почитать можно здесь: http://httpd.apache.org/docs/2.2/vhosts/name-based.html. Пример нормального Name-based.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
NameVirtualHost *:80 <VirtualHost *:80> ServerName localhost ServerAlias 127.0.0.1 DocumentRoot c:/wamp/www/localhost/htdocs ErrorLog c:/wamp/www/localhost/logs/error.log CustomLog c:/wamp/www/localhost/logs/access.log common <Directory "c:/wamp/www/localhost/htdocs"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> <VirtualHost *:80> ServerName is.loc ServerAlias *.is.loc ServerAdmin admin@localhost DocumentRoot c:/wamp/www/is/htdocs ErrorLog c:/wamp/www/is/logs/error.log CustomLog c:/wamp/www/is/logs/access.log common <Directory "c:/wamp/www/is/htdocs"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> |
* ServerAlias *.is.loc — для поддоменов.