文档根不存在';无法使用Apache的虚拟主机设置

文档根不存在';无法使用Apache的虚拟主机设置,apache,Apache,我在httpd.conf中设置VirtualHost如下: <VirtualHost xxx.255.118.79:80> ServerAdmin hoge@hoge.foo.com DocumentRoot /var/www/html ServerName main.foo.com ErrorLog logs/main.foo.com-error_log TransferLog logs/main.foo.com-access_log <

我在httpd.conf中设置VirtualHost如下:

<VirtualHost xxx.255.118.79:80>
    ServerAdmin hoge@hoge.foo.com
    DocumentRoot /var/www/html
    ServerName main.foo.com
    ErrorLog logs/main.foo.com-error_log
    TransferLog logs/main.foo.com-access_log
</VirtualHost>

<VirtualHost xxx.255.118.79:8080>
    ServerAdmin hoge@hoge.foo.com
    DocumentRoot /opt/another_www/
    ServerName anotherhost.foo.com
    ErrorLog logs/host.foo.com-error_log
    TransferLog logs/host.foo.com-access_log
</VirtualHost>
但当我访问时,它仍然访问/var/www/html。 您能告诉我如何让apache2为8080端口提供/opt/other_www吗


谢谢

我意识到中的域名必须能够被运行Apache的本地机器发现。 这意味着它必须是本地IP地址或*

<VirtualHost *:8080>
  ServerAdmin hoge@hoge.foo.com
  DocumentRoot /opt/another_www/

服务器管理员hoge@hoge.foo.com
DocumentRoot/opt/other\u www/
在我将其更改为*之后,它开始在/opt/other/www下提供文档

<VirtualHost *:8080>
  ServerAdmin hoge@hoge.foo.com
  DocumentRoot /opt/another_www/