ACCUWEBHOSTING.COM
Live Chat
Sales / Billing / Support
Support
FAQ, Help Desk
Share / Save
Bookmark
Author

This original article is the property of AccuWebHosting.Com (http://www.accuwebhosting.com/). AccuWebHosting.com has been providing world class Windows VPS Hosting services to the global community for nearly the past decade. Priding ourselves in providing innovative technology coupled with top notch customer service, this credo has allowed not only us, but our customers to experience success and substantial growth. Find Top Private Cloud Hosting, VPS Windows and CPanel VPS Hosting plans at affordable rates only at AccuWebHosting.Com. Unleash the power of Cheap Windows VPS solution by AccuWebHosting.Com.

 

Setting up Apache for Multi Domain Hosting - VirtualHost Directive

If you want to set up your Apache Web server for multiple domains and sub-domains (e.g., www.company_x.com and XYZ.company_x.com), you can do so with the VirtualHost directive.

It's not very difficult, but there are some subtle aspects that may cause you problems the first time.In this article, I will discuss how to set up virtual hosting. Most of the information available around the net is confusing. Hopefully, this page will simplify the process a bit.

How Apache Works (How it resolves browser requests?

When Apache is started, it scans the configuration file (/etc/httpd/conf/httpd.conf) to determine its settings. Based on the configuration file, Apache generates a table of the server's IP addresses with a vhost address set containing the associated domain names. Now apache deamon is ready to listen any request on web server port mostly number 80.

Now, when browser sends the document request along with the original domain name to the IP address, your httpd.conf file listen to this request. if it has been configured for vhosts, it will compare the client's request to the ServerName of each vhost with the same IP address and port. The vhost block of directives of the first ServerName that matches the client's request will be applied.

Within a vhost block (i.e., directives between <VirtualHost> tags) there are many directives that may be given, but only two are required: the ServerName and the DocumentRoot directives. The ServerName directive provides the domain name and the sub-domain name. The DocumentRoot directive sets the root directory for the domain. If Apache finds a vhost with a ServerName that matches a client request, it will look in the root directory specified by the DocumentRoot directive for files, thus giving the appearance of a separate server.



(Posted By Jason on Wednesday, January 17, 2007)

 Read All Stories
 

© Copyright 2010 - 2020 AccuWebHosting.Com. All rights reserved. AccuWebHosting.com,
48 Bi-State Plaza #185 Old Tappan, NJ 07675, United States of America