top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Apache Virtual Host Configuration?

+1 vote
292 views

What is Virtual Host

Virtual hosting is a method for hosting multiple domain names (with separate handling of each name) on a single server. This allows one server to share its resources, such as memory and processor cycles, without requiring all services provided to use the same host name.

How to configure the virtual Host

Step 1: edit apache2.conf or httpd.conf or any similar file

Step 2: Add the following code

<VirtualHost *:80>
    ServerAdmin webmaster@myserver.queryhome.com
    DocumentRoot "/var/www/html/myserver"
    ServerName myserver.queryhome.com
    ## ErrorLog <Error File> -- optional
    ## Custom Log <Access Log file> -- optional
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@yourserver.queryhome.com
    DocumentRoot "/var/www/html/yourserver"
    ServerName yourserver.queryhome.com
    ## ErrorLog <Error File> -- optional
    ## Custom Log <Access Log file> -- optional
</VirtualHost>

Step3: Restart the apache i.e. service httpd restart/service apache2 restart and you are done.

Above code is tested and working at various level for the QueryHome codebase.

posted Aug 7, 2014 by anonymous

  Promote This Article
Facebook Share Button Twitter Share Button LinkedIn Share Button

...