我现在正在学习 Symfony。我用 2 个不同的域创建了 2 个 Symfony 项目。不过,我的第二个域指向第一个域,不知道为什么。
我正在关注本教程,著名的 jobeet:http ://www.symfony-project.org/jobeet/1 ... rine/en/01
注意我的配置:
我的 /etc/apache2/httpd.conf
ServerName localhost
#From the symfony tutorial "jobeet"
# Be sure to only have this line once in your configuration
NameVirtualHost 127.0.0.1:8080
# This is the configuration for your project
<VirtualHost 127.0.0.1:80>
ServerName www.jobeet.com.localhost
DocumentRoot "/home/lola/sfprojects/jobeet/web"
DirectoryIndex index.php
<Directory "/home/lola/sfprojects/jobeet/web">
AllowOverride All
Allow from All
</Directory>
Alias /sf /home/lola/sfprojects/jobeet/lib/vendor/symfony/data/web/sf
<Directory "/home/lola/sfprojects/jobeet/lib/vendor/symfony/data/web/sf">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
#Another symfony tutorial
NameVirtualHost 127.0.0.1:8081
<VirtualHost 127.0.0.1:80>
ServerName www.tutorial.com.localhost
DocumentRoot "/home/sfprojects/tutorial/web"
DirectoryIndex index.php
<Directory "/home/sfprojects/tutorial/web">
AllowOverride All
Allow from All
</Directory>
Alias /sf /home/lola/sfprojects/tutorial/lib/vendor/symfony/data/web/sf
<Directory "/home/lola/sfprojects/tutorial/lib/vendor/symfony/data/web/sf">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
请注意,我正在收听教程域中的8081端口。我尝试了 VirtualHost 127.0.0.1: 80和 VirtualHost 127.0.0.1: 81的排列。都没有奏效。(真不知道有什么用)
我的 /etc/hosts:
#From the symfony tutorial
127.0.0.1 www.jobeet.com.localhost
#From ANOTHER symfony tutorial
127.0.0.1 www.tutorial.com.localhost
之后我重新启动了 Apache。
现在,当我这样做时: http://www.jobeet.com.localhost/frontend_dev.php/我去我的 Jobeet 教程的东西,但是当我做http://www.tutorial.com.localhost/frontend_dev.php/我也去 Jobeet 页面。我应该去包含教程部分的那个。
为什么不工作??!