douhutongvm382381 2014-02-12 05:19
浏览 63
已采纳

在Wamp服务器上为Zend应用程序设置VirtualHost

I'm following this tutorial to learn how to start a project using ZendFramework

http://framework.zend.com/manual/1.12/en/learning.quickstart.create-project.html

When I get to setup a virtual host I get stuck. If I do exactly as the tutorial says, it shows me an error (in all my project, zend or not), says the file wasn't found.

Then I found this tutorial on StackOverflow very handy

Can't run zend framework MVC application on WAMP

Following what the guy on the bottom of the page says takes me to the same error when I try to access my app as zendProject.local/

This is what I got

on hosts (Windows/System32/drivers/etc/hosts) file

127.0.0.1       blog.local

on httpd-vhosts.conf file

<VirtualHost 127.0.0.1>
ServerName blog.local
DocumentRoot /blog/public

SetEnv APPLICATION_ENV "development"

<Directory /blog/public>
    DirectoryIndex index.php
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Can you tell me what I am doing wrong? The browser still says Not Found The requested URL /public was not found on this server when I go to http://blog.local/

I'm running WAMP on Windows. And this is the absolute path to the 'blog' project C:\wamp\www\blog

@Edit RiggsFolly

this is what I got now in the httpd-vhosts.conf file

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot "C:/wamp/www"

    <Directory "C:/wamp/www">
        AllowOverride All
        # make sure this is only allowed to be accessed by the local machine
        # then if/when you open one of your other sites up to the internet and somebody uses your IP
        # they will get directed here as its the first VH def and then receive a 403 not allowed to access
        Require local
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName blog.local
    DocumentRoot "C:/websites/blog/public"
    Options Indexes FollowSymLinks
    SetEnv APPLICATION_ENV "development"

    <Directory "C:/websites/blog/public">
        DirectoryIndex index.php
        AllowOverride All
        Require all granted        
    </Directory>
</VirtualHost>

And I created a new directory at C:/ called 'websites' as you suggested

  • 写回答

1条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 关于#大数据#的问题:请问有人能系统得总结一下什么数据分析师,数据架构师还有开发师的具体职业要求和就业前景嘛d(ŐдŐ๑)
      • ¥15 win10账户不见了怎么找回
      • ¥15 如何显示得分大于0.5的检测框
      • ¥15 微信小游戏使用云开发的CDN配置
      • ¥15 Matlab的SAW模态耦合模型的仿真程序
      • ¥20 求个C# SSL socket的客户端和 服务端代码
      • ¥15 大家调试TI C2000系列DSP用什么上位机?
      • ¥20 Eltable 如何实现鼠标拖拽范围多选
      • ¥15 产品需要了解什么代码技术才能更好站在开发角度思考问题?
      • ¥15 统计数据能提前统计吗