【发布时间】:2016-10-05 08:51:03
【问题描述】:
我正在尝试在我的本地服务器上设置 Symfony 3,但问题是我无法让我的虚拟主机工作。
虚拟主机文件:
<VirtualHost *:80>
ServerName localhost.dev.lt
ServerAlias www.localhost.dev.lt
DocumentRoot /www/testProject/web
<Directory /www/testProject/web/>
AllowOverride None
Order Allow,Deny
Allow from All
</Directory>
# uncomment the following lines if you install assets as symlinks
# or run into problems when compiling LESS/Sass/CoffeScript assets
#<Directory /www/testProject/>
# Options FollowSymlinks
#</Directory>
</VirtualHost>
我还将 localhost.dev.lt 添加到我的主机文件中。 Mod Rewrite 模块也已启用。
DocumentRoot URL 会不会写错? 如果我去http://localhost.dev.lt/testProject/web/ 然后它开始工作了,问题是我得到了根目录然后我去http://localhost.dev.lt而不是/web。
【问题讨论】:
-
您应该更好地定义“它正在工作”或“它不工作”的含义。在每种情况下,您在页面上看到的具体内容是什么?
-
这不是正确的配置。您应该将流量引导到 app(_dev).php,或者使用
AllowOverride All
标签: php apache virtualhost symfony