apache  →  Настройка виртуальных хостов на апаче

published 01 August 2011

IP addresses / ports to listen on

Include /etc/apache2/listen.conf

VirtualHost: If you want to maintain multiple domains/hostnames on your

machine you can setup VirtualHost containers for them.

Include /etc/apache2/vhosts.d/*.conf

файл listen.conf

NameVirtualHost localhost:80
NameVirtualHost 127.0.0.1:80

файл hosts.conf в /vhosts.d

ServerAdmin 11t@gmail.com
 ServerName newsite
 DocumentRoot /srv/www/htdocs/newsite
 ErrorLog  /srv/www/htdocs/newsite/error_log
 CustomLog  /srv/www/htdocs/newsite/access_log combined    
 
  Options None
  AllowOverride All
  Order deny,allow
  Allow from all

рестарт апача

/etc/init.d/apache2 restart

и не забыть прописать алиас в host

127.0.0.1   newsite
Теги: apache virtual hosts