[英]about httpd.conf
I'm starting to learn symfony for php framework and I got problem with httpd.conf configuration. 我开始学习php框架的symfony,并且httpd.conf配置出现问题。
First, I have xampplite installed on my windows c:\\xampplite\\ 首先,我在Windows c:\\ xampplite \\上安装了xampplite
and then I created a symfony project (as described on getting started guide) c:\\xampplite\\htdocs\\symfonytest\\ 然后我创建了一个symfony项目(如入门指南中所述)c:\\ xampplite \\ htdocs \\ symfonytest \\
Everything works fine when I tried to access http://localhost/symfonytest/web/ (all icons and text are displayed pretty well) 当我尝试访问http:// localhost / symfonytest / web /时,一切正常(所有图标和文本都显示得很好)
Now I got to configure the httpd.conf and I type like this: 现在,我必须配置httpd.conf,并按如下所示输入:
<VirtualHost 127.0.0.1/symfonytest>
DocumentRoot "c:\xampplite\htdocs\symfonytest\web"
DirectoryIndex index.php
<Directory "c:\xampplite\htdocs\symfonytest\web">
AllowOverride All
Allow from All
</Directory>
Alias /sf c:\xampplite\htdocs\symfonytest\web\sf
<Directory "c:\xampplite\htdocs\symfonytest\web\sf">
AllowOverride All
Allow from All
</Directory>
But it has no effect at all ... when I type http://127.0.0.1/symfonytest/ it still displayed directory list of my c:\\xampplite\\htdocs\\symfonytest\\ 但这根本没有效果...当我键入http://127.0.0.1/symfonytest/时,它仍然显示我的c:\\ xampplite \\ htdocs \\ symfonytest \\的目录列表
How to solve this httpd.conf problem? 如何解决这个httpd.conf问题?
Thank you !!! 谢谢 !!!
You can't do that using a VirtualHost. 您不能使用VirtualHost来做到这一点。 Instead, use an Alias:
而是使用别名:
Alias /symphonytest/ "c:\xampplite\htdocs\symfonytest\web"
<Directory "c:\xampplite\htdocs\symfonytest\web">
AllowOverride All
Allow from All
</Directory>
Alias /sf/ c:\xampplite\htdocs\symfonytest\web\sf
<Directory "c:\xampplite\htdocs\symfonytest\web\sf">
AllowOverride All
Allow from All
</Directory>
This should work as you're expecting it to. 这应该可以按您期望的那样工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.