Apache Web Server – Virtual host creation

Hosting the Zend Framework based application in the production environment is very simple and straight-forward. Just create a VirtualHost in the Apache configuration file and point the DocumentRoot to the Public folder of the Zend Framework application.

********C:\Windows\System32\drivers\etc\hosts

Eg :

127.0.0.1 localhost
127.0.0.1 1degreeadmin.vivid
127.0.0.1 1dwgapi.vivid
127.0.0.1 tourbeaver.vivid
127.0.0.1 dctoursus.vivid
127.0.0.1 venus.vivid

108.171.165.58 tourbeaver.com
108.171.165.58 http://www.tourbeaver.com

********D:\xampp\apache\conf\extra\httpd-vhosts

<VirtualHost *:80>
DocumentRoot “D:/xampp/htdocs/”
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
DocumentRoot “D:/xampp/htdocs/1degreeadmin”
ServerName 1degreeadmin.vivid
</VirtualHost>
<VirtualHost *:80>
DocumentRoot “D:/xampp/htdocs/1dwgapi_dev”
ServerName 1dwgapi.vivid
</VirtualHost>

<VirtualHost *:80>
DocumentRoot “D:/xampp/htdocs/tourbeaver_dev”
ServerName tourbeaver.vivid
</VirtualHost>
<VirtualHost *:80>
DocumentRoot “D:/xampp/htdocs/dctoursus.1degreeworld.biz”
ServerName dctoursus.vivid
</VirtualHost>
<VirtualHost *:80>
DocumentRoot “D:/xampp/htdocs/venus_dev”
ServerName venus.vivid
</VirtualHost>

 

A sample configuration (myapp) is given below −

<VirtualHost *:80> 
   ServerName myapp.localhost 
   DocumentRoot /path/to/install/myapp/public 
   <Directory /path/to/install/myapp/public> 
      DirectoryIndex index.php 
      AllowOverride All 
      Order allow,deny 
      Allow from all 
      <IfModule mod_authz_core.c> 
         Require all granted 
      </IfModule> 
   </Directory> 
</VirtualHost>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s