Creating A Local Domain Using Apache Virtual Hosts

From Joseph Luis Wiki
Revision as of 14:00, 16 July 2014 by Josephluis (Talk | contribs) (Created page with "Taken from [http://www.survivethedeepend.com/zendframeworkbook/en/1.0/creating.a.local.domain.using.apache.virtual.hosts here] ''The basic Virtual Host configuration we're se...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Taken from here

The basic Virtual Host configuration we're seeking is as follows:

# Setup Listening Port
NameVirtualHost *:80

# Ensure "localhost" is preserved unchanged pointed
# to the default document root for our system.
<VirtualHost *:80>
    ServerName localhost
    DocumentRoot /var/www
</VirtualHost>

# Setup "helloworld.tld" Virtual Host
<VirtualHost *:80>
    ServerName helloworld.tld
    DocumentRoot /home/padraic/www/helloworld/public

    <Directory /home/padraic/www/helloworld/public>
        Options Indexes FollowSymLinks Includes
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

and add to /etc/hosts (for this example)

127.0.0.1 helloworld.tld