Я пытаюсь настроить 2 виртуальных хоста на новом VPS, используя apache 2.x на сервере Ubuntu
Выход из перезапуска apache2:
* Restarting web server apache2 [Thu Feb 09 01:19:34 2012] [warn] NameVirtualHost xx.xx.xxx.xxx:80 has no VirtualHosts
[Thu Feb 09 01:19:34 2012] [warn] NameVirtualHost *:0 has no VirtualHosts
[Thu Feb 09 01:19:34 2012] [warn] NameVirtualHost *:0 has no VirtualHosts
[Thu Feb 09 01:19:34 2012] [warn] NameVirtualHost xx.Xx.xxx.xxx:80 has no VirtualHosts
[Thu Feb 09 01:19:34 2012] [warn] NameVirtualHost *:0 has no VirtualHosts
[Thu Feb 09 01:19:34 2012] [warn] NameVirtualHost *:0 has no VirtualHosts
[fail]
Содержимое файла httpd.conf:
NameVirtualHost *
<VirtualHost *>
ServerName www.xxxx.net
DocumentRoot /srv/www/xxxx.net/public_html/
</VirtualHost>
<VirtualHost *>
ServerName www.xxxx.com
DocumentRoot /srv/www/xxxx.com/public_html/
</VirtualHost>
РЕДАКТИРОВАТЬ: внесение изменений, предложенных Кадзи,
выход из apache2 перезапустить
* Restarting web server apache2 Warning: DocumentRoot [/www/rmusser.net] does not exist
[Thu Feb 09 01:41:03 2012] [error] VirtualHost *:8090 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Thu Feb 09 01:41:03 2012] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Thu Feb 09 01:41:03 2012] [warn] NameVirtualHost 71.19.144.240:80 has no VirtualHosts
[Thu Feb 09 01:41:03 2012] [warn] NameVirtualHost *:0 has no VirtualHosts
[Thu Feb 09 01:41:03 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
Warning: DocumentRoot [/www/rmusser.net] does not exist
[Thu Feb 09 01:41:03 2012] [error] VirtualHost *:8090 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Thu Feb 09 01:41:03 2012] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Thu Feb 09 01:41:03 2012] [warn] NameVirtualHost 71.19.144.240:80 has no VirtualHosts
[Thu Feb 09 01:41:03 2012] [warn] NameVirtualHost *:0 has no VirtualHosts
[Thu Feb 09 01:41:03 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
(98)Address already in use: make_sock: could not bind to address [::]:80
[fail]
1 ответ
Вы не указали порт в определении виртуального хоста
Попробуй это
# Ensure that Apache listens on port 80
Listen 80
# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /www
ServerName www.example1.com
# Other directives here
</VirtualHost>
<VirtualHost *:8090>
DocumentRoot /www/folder
ServerName www.example2.org
# Other directives here
</VirtualHost>