2011-07-29 104 views

回答

1

你必須確保example.local解析到本地機器上,最簡單的方法是加入像

127.0.0.1 example.local 

一行到您的主機文件(Linux的:在/ etc/hosts; win:%SystemRoot%\ system32 \ drivers \ etc \ hosts)。 而且比你在你的Apache配置需要一個虛擬主機,像(這是非常基本)

<VirtualHost 127.0.0.1:80> 
    ServerName example.local 
    DocumentRoot /path/to/htdocs 
    ErrorLog  /path/to/error.log 
    CustomLog  /path/to/access.log combined 
</VirtualHost> 

這樣,你應該能夠訪問的htdocs /例如文件/通過http://example.local/example/

對於更多詳細信息請參考fine apache manual

+0

如果我想添加多個網站,example1.local,example2.local等? – chchrist