How do I create a VirtualHost on Zend Server?
Asked Answered
Q

4

8

I am using zend server and I added one VirtualHost into the extra/httpd-vhosts.conf file and removed # from the httpd.conf file.

This is what I added into the extra/httpd-vhosts.conf file:

NameVirtualHost *:80

<VirtualHost *:80>
    ServerName quickstart.local
    DocumentRoot D:/quickstart/Code


    <Directory D:/quickstart/Code>
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

When I access quickstart.local it is working fine, but it also affects localhost (i.e when I try to load http://localhost/, I see the same site I do for http://quickstart.local/.

How do I resolve this issue? I want both localhost (I use this for another project) and quickstart.local to be separate.

Quadrennium answered 23/6, 2011 at 20:34 Comment(0)
C
10

I have the same problem. Try to add a host to zend.conf or add

Include conf/extra/httpd-vhosts.conf                   

to htppd.conf

Cupola answered 3/7, 2011 at 10:19 Comment(2)
Uncomment the line: Include conf/extra/httpd-vhosts.conf in htppd.conf file and add your directives to the httpd-vhosts.conf located accordingly in C:\Program Files...\Zend\Apache2\conf\extra directory.Komarek
In windows you might also need to add a line to your hosts fileLarondalarosa
I
3

You can add a new vhost by adding the directives to a new file:

/path/to/zend/etc/sites.d/vhost_[my-site].conf

Replace [my-site] with whatever you want (no spaces).

Then, be sure you restart apache:

sudo /path/to/zend/bin/apachectl restart
Irrespirable answered 14/6, 2012 at 7:22 Comment(0)
W
0

I had similar issue when trying to add own sites. Solution for me was to comment both vhost examples in vhosts file and also uncomment or add the

127.0.0.1 localhost 

into hosts file in %windir%/system32/drivers/etc folder

... ofcourse if you need to uncomment vhost_alias module and include for httpd-vhosts file..

Wyoming answered 13/2, 2016 at 0:47 Comment(0)
E
0

[FILE PATH] \xampp\apache\conf\extra\httpd-vhosts.conf or, if you are using Apache 2.4 or above:

<VirtualHost *:80>
     ServerName dev.zendapp
     DocumentRoot "G:/xampp/htdocs/io2018/zend2018/zendApps"
     SetEnv APPLICATION_ENV "development"
     <Directory "G:/xampp/htdocs/io2018/zend2018/zendApps">
         DirectoryIndex index.php
         AllowOverride All
         Require all granted
     </Directory>
 </VirtualHost>

After change. C:\Windows\System32\drivers\etc\hosts

127.0.0.1       dev.zendapp

Restart Your xampp Server

Eckard answered 4/6, 2018 at 6:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.