我在我的笔记本电脑上使用Ubuntu 10.10。
我将以下内容添加到/etc/apache2/httpd.conf
NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot "/var/www/square/public" ServerName square.localhost </VirtualHost>
并重新启动Apache。
我去http://square.localhost/ ,它提供了一个错误,告诉服务器没有find。
有谁能告诉我如何在Ubuntu上定义虚拟主机设置吗?
提前致谢。
你不应该修改httpd.conf文件,而是在/ etc / apache2 / sites-available /
本教程应该阐明你是如何工作的:
http://www.debuntu.org/2006/02/22/7-virtual-hosting-using-apache-2
http://brucewampler.wordpress.com/2009/02/28/adding-virtual-hosts-to-ubuntu-apache/