2015-01-07 62 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>