0
votes

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

1 Answers

2
votes

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.