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

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] 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 *:80>
    DocumentRoot "C:/wamp/www/loyality/public/"
    ServerName dominos.com 
    <VirtualHost *:80>
    DocumentRoot "C:/wamp/www/loyality/public/"
    ServerName client.com 

    Step3: Now we need to make mappings of IP address to different host names For example :      localhost      pizzahut.com      www.pizzahut.com      localhost      dominos.com      www.dominos.com      localhost      client.com      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 求苹果推信imessage批量推信技术
    • ¥15 ubuntu 22.04 系统盘空间不足。隐藏的docker空间占用?(相关搜索:移动硬盘|管理系统)
    • ¥15 利用加权最小二乘法求亚马逊各类商品的价格指标?怎么求?
    • ¥15 c++ word自动化,为什么可用接口是空的?
    • ¥15 Matlab计算100000*100000的矩阵运算问题:
    • ¥50 VB6.0如何识别粘连的不规则的数字图片验证码
    • ¥16 需要完整的这份订单所有的代码,可以加钱
    • ¥15 Stata数据分析请教
    • ¥15 请教如何为VS2022搭建 Debug|win32的openCV环境?
    • ¥15 关于#c++#的问题:c++如何使用websocketpp实现websocket接口调用,求示例代码和相关资料