How do I create a VirtualHost on Zend Server?

14,048

Solution 1

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

Include conf/extra/httpd-vhosts.conf                   

to htppd.conf

Solution 2

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
Share:
14,048

Related videos on Youtube

Manjeet Patel
Author by

Manjeet Patel

Updated on June 01, 2022

Comments

  • Manjeet Patel
    Manjeet Patel almost 2 years

    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.

  • i--
    i-- over 11 years
    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.
  • Isaac Montaine
    Isaac Montaine about 6 years
    In windows you might also need to add a line to your hosts file