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.

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

报告相同问题?

悬赏问题

  • ¥20 学生成绩管理系统设计
  • ¥15 来一个cc穿盾脚本开发者
  • ¥15 CST2023安装报错
  • ¥15 使用diffusionbert生成文字 结果是PAD和UNK怎么办
  • ¥15 有人懂怎么做大模型的客服系统吗?卡住了卡住了
  • ¥20 firefly-rk3399上启动卡住了
  • ¥15 如何删除这个虚拟音频
  • ¥50 hyper默认的default switch
  • ¥15 网站打不开,提示502 Bad Gateway
  • ¥20 基于MATLAB的绝热压缩空气储能系统代码咨询