duandeng1824 2015-01-02 10:22
浏览 48
已采纳

我们可以在Zend framework1.11和Wamp服务器中为模块创建虚拟主机吗?

First of all thanks for read my question:

I have created a module in Zend framework1.11

Module name = Client

Now as per our requirement we need to create virtual host on wamp server.

a) http://client.com

Following is the settings, which i have done in the C:\wamp\bin\apache\Apache2.4.4\conf\extra/httpd-vhosts.conf

<VirtualHost *:80>
ServerAdmin client.com
DocumentRoot "C:/wamp/www/loyality/application/modules/client/"
ServerName client.com
ServerAlias www.client.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

After that enable the window host file under C:\Windows\System32\drivers\etc/hosts

But i am getting error 500 Internal Server Error

In the error log i have found following error:

[Fri Jan 02 12:47:12.154296 2015] [core:error] [pid 4324:tid 1600] [client 127.0.0.1:50923] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

Please suggest, how can i made Virtual host for modules in zend framework

  • 写回答

1条回答 默认 最新

  • doujie7346 2015-01-06 05:37
    关注

    We can resolve this issue with following settings:

    Here i am using Wamp server, Zend framework.

    Step 1: First we need to enable Include conf/extra/httpd-vhosts.conf line in the apache file httpd.conf

    For example:

    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf
    

    Step 2: We need to define Virtual host in the httpd-vhosts.conf file which is present in the bin\apache\Apache2.4.4\conf\extra\httpd-vhosts.conf

    For example: We can define virtual host like following code.

    <VirtualHost *:80>
    DocumentRoot "C:/wamp/www/loyality/public/"
    ServerName pizzahut.com 
    </VirtualHost>
    <VirtualHost *:80>
    DocumentRoot "C:/wamp/www/loyality/public/"
    ServerName dominos.com 
    </VirtualHost>
    <VirtualHost *:80>
    DocumentRoot "C:/wamp/www/loyality/public/"
    ServerName client.com 
    </VirtualHost>
    

    Step3: Now we need to make mappings of IP address to different host names For example :

    127.0.0.1      localhost
    127.0.0.1      pizzahut.com
    127.0.0.1      www.pizzahut.com
    
    127.0.0.1      localhost
    127.0.0.1      dominos.com
    127.0.0.1      www.dominos.com
    
    127.0.0.1      localhost
    127.0.0.1      client.com
    127.0.0.1      www.client.com
    

    Step 4: Define or Add constant for default module in the index.php file which is present in the public folder.

    For example:

    defined('DEFAULT_MODULE') || define('DEFAULT_MODULE', "dominos");
    

    Step 5: Enable Default module in the application.ini file using following code.

    resources.frontController.prefixDefaultModule = true
    resources.frontController.defaultModule = DEFAULT_MODULE
    

    With these above steps, i found solution for this question.

    Now Our default module is dominos and when i am running http://www.dominos.com then my dominos module pointing.

    Thanks, Sunny Patial.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员