无法让虚拟主机在ubuntu 11.10上工作 - apache2?

时间:2012-01-16 11:52:55

标签: lamp ubuntu-11.04

任何人都可以对此有所了解吗?我似乎无法让虚拟主机设置工作,我是ubuntu的新手(还不相信?)我已经安装了一个工作正常的灯服务器。

我已经从网站复制了默认设置 - 有效命名为示例,我在/ var / www / example创建了目录并放入索引文件

我使用了a2ensite示例并重新启动了服务器,然后在浏览器中输入了127.0.0.1/example,但得到:

未找到

在此服务器上找不到请求的URL /示例。

Apache / 2.2.20(Ubuntu)服务器,位于127.0.0.1端口80

这就是我的例子:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName example
DocumentRoot /var/www/example 
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory /var/www/example/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

<VirtualHost>

任何人都可以帮助谢谢

2 个答案:

答案 0 :(得分:1)

  • 您忘记了关闭VirtualHost标记中的/。
  • 如果指定DocumentRoot / var / www / example,已经在/ example文件夹,那么您可以使用http://127.0.0.1/ - 127.0.0.1/example指向访问索引文件的/ var / WWW /示例/实施例。

答案 1 :(得分:1)