2015-01-07 187 views
0

这可能是愚蠢的查询。我的虚拟主机不工作,想知道为什么?为什么VirtualHost无法正常工作?

我在/ etc/apache2/site-enabled中有myvhost.conf。它看起来像:

<VirtualHost *:80> 

    ServerName dev.mydomain.com 

    ServerAdmin [email protected] 
    DocumentRoot /var/www/html/test 

    ErrorLog ${APACHE_LOG_DIR}/error.log 
    CustomLog ${APACHE_LOG_DIR}/access.log combined 

</VirtualHost> 

我在Ubuntu上:14.10,Apache:2.4.10。我有其他的虚拟主机文件000-default.conf default-ssl.conf。默认(http和https)都在工作。

编辑:当我浏览dev.mydomain.com时,我得到了Apache默认页面iie。 “Apache2的Ubuntu的默认页”

在此先感谢

+0

有没有在日志文件中的错误?或者可能是语法?如果使用'-t'选项启动apache会发生什么情况? – ceadreak

+0

没有错误 - 当我做dev.mydomain.com时,我得到默认页面“Apache2 Ubuntu默认页面” – Elisa

+0

dev.mydomain.com是系统主机名吗? – covener

回答

0

试一下,并删除默认的虚拟主机:

<VirtualHost *:80>                                              
    ServerName dev.mydomain.com 

    DocumentRoot /var/www/html/test 
    <Directory /var/www/html/test> 
    Options Indexes FollowSymLinks MultiViews 
    AllowOverride All 
    Order allow,deny 
    allow from all 
    </Directory> 

ErrorLog ${APACHE_LOG_DIR}/error.log 
LogLevel warn 

CustomLog ${APACHE_LOG_DIR}/access.log combined 

</VirtualHost> 
相关问题