Symfony 3 虚拟主机,无法进入 /web
Symfony 3 Virtual Hosts, can't make it to /web
我正在尝试在我的本地服务器上设置 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 重写模块也已启用。
DocumentRootURL会不会写错了?
如果我去 http://localhost.dev.lt/testProject/web/
然后它开始工作了,问题是我得到根目录然后我去 http://localhost.dev.lt 而不是 /web.
如果导航到 http://localhost.dev.lt/testProject/web/
显示您的 Symfony 项目的主页,请确保您没有设置 localhost.dev.lt
的不同 虚拟主机至 /www/
.
天哪,问题是 vhosts.conf 文件在 httpd.conf 主文件中被注释掉了,所以虚拟主机根本无法工作。该行是 "Include conf/extra/httpd-vhosts.conf".
我正在尝试在我的本地服务器上设置 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 重写模块也已启用。
DocumentRootURL会不会写错了? 如果我去 http://localhost.dev.lt/testProject/web/ 然后它开始工作了,问题是我得到根目录然后我去 http://localhost.dev.lt 而不是 /web.
如果导航到 http://localhost.dev.lt/testProject/web/
显示您的 Symfony 项目的主页,请确保您没有设置 localhost.dev.lt
的不同 虚拟主机至 /www/
.
天哪,问题是 vhosts.conf 文件在 httpd.conf 主文件中被注释掉了,所以虚拟主机根本无法工作。该行是 "Include conf/extra/httpd-vhosts.conf".