Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a VirtualHost on Zend Server?

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.

like image 916
Manjeet Patel Avatar asked Jun 23 '11 20:06

Manjeet Patel


2 Answers

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

Include conf/extra/httpd-vhosts.conf                   

to htppd.conf

like image 174
BILL Avatar answered Oct 12 '22 01:10

BILL


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
like image 22
Jess Telford Avatar answered Oct 12 '22 03:10

Jess Telford