2013-05-05 149 views
0

我想在我的Mac OS上構建一個虛擬主機,但它不工作。在Mac上構建虛擬主機 - 無法正常工作

Apache2的/ error_log中記錄的後續消息

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName 
[Fri May 03 15:34:57 2013] [notice] Digest: generating secret for digest authentication ... 
[Fri May 03 15:34:57 2013] [notice] Digest: done 
[Fri May 03 15:34:58 2013] [notice] Apache/2.2.22 (Unix) DAV/2 configured -- resuming normal operations 
[Fri May 03 15:35:16 2013] [error] [client 127.0.0.1] File does not exist: /usr/htdocs 
[Fri May 03 15:35:16 2013] [error] [client 127.0.0.1] File does not exist: /usr/htdocs 

和瀏覽器返回這個....

Not Found 

The requested URL/was not found on this server. 

Apache/2.2.22 (Unix) DAV/2 PHP/5.3.15 with Suhosin-Patch Server at dev.myhost.test Port 80 

我已經住了很長時間試圖解決這一問題。但我沒有成功...

這裏IR我/etc/apache2/extra/httpd-vhosts.conf

NameVirtualHost *:80 

<Directory "/Applications/XAMPP/htdocs/"> 
    Options Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews 
    AllowOverride All 
    Order allow,deny 
    Allow from all 
</Directory> 

<VirtualHost *:80> 
    DocumentRoot "/Applications/XAMPP/htdocs" 
    ServerName localhost 
</VirtualHost> 

<VirtualHost *:80> 
    DocumentRoot "/Applications/XAMPP/htdocs/smileflame" 
    ServerName dev.smileflame.com 
</VirtualHost> 

<VirtualHost *:80> 
    DocumentRoot "/Applications/XAMPP/htdocs/teste" 
    ServerName dev.myhost.test 
</VirtualHost> 

下一個是我的/ etc/hosts文件

127.0.0.1  localhost 
255.255.255.255 broadcasthost 
::1    localhost 
fe80::1%lo0  localhost 

127.0.0.1 dev.myhost.test 

我想這個虛擬主機重定向到我的index.php ...但是這不會發生... 任何人都知道爲什麼?

+0

您在瀏覽器中使用什麼URL來請求頁面? – 2013-05-05 02:27:26

回答

0

請勿使兩個/etc/hosts條目具有相同的IP。將別名放在同一行上:

127.0.0.1  localhost dev.myhost.test 
255.255.255.255 broadcasthost 
::1    localhost 
fe80::1%lo0  localhost 
+0

這是否解決了問題? – Barmar 2013-05-06 18:23:38

相關問題