A free and open-source book on ZF3 for beginners


2.10. Having Multiple Virtual Hosts

When developing several websites on the same machine, you will want to create several virtual hosts. For each virtual host you need to specify a domain name (like site1.mydomain.com). But if you currently don't have a domain name, you can specify a different port instead (see the example below).

# Listen directive tells Apache to listen requests on port 8080
Listen 8080

<VirtualHost *:8080>
    ...
</VirtualHost>

To access the website, in your browser's navigation bar, enter "http://localhost:8080".

After editing the virtual host config file, you should restart Apache to apply changes.


Top