2011-07-29 63 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