Home arrow Site Administration arrow Page 3 - Getting More Out Of Apache (Part 1)

Two Birds With One Host - Administration

While the default Apache configuration is good enough for mostWeb applications, there's a lot more under the hood of the planet's mostpopular Web server. In this article, find out how to create virtual hostson a single Web server, and use Server-Side Includes for greaterflexibility in your HTML pages.

TABLE OF CONTENTS:
  1. Getting More Out Of Apache (Part 1)
  2. Virtually Yours
  3. Two Birds With One Host
  4. Gotcha!
  5. Including A Few More Tricks
By: icarus, (c) Melonfire
Rating: starstarstarstarstar / 6
January 04, 2001

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
Here's what the final product looks like:

# host setting for melonfire-alpha.com <VirtualHost 127.0.0.1> ServerAdmin webmaster@melonfire-alpha.com DocumentRoot /www/melonfire-alpha.com ServerName melonfire-alpha.com ErrorLog logs/melonfire-alpha.com-error_log CustomLog logs/melonfire-alpha.com-access_log common </VirtualHost> # host setting for melonfire-beta.com <VirtualHost 127.0.0.1> ServerAdmin webmaster@melonfire-beta.com DocumentRoot /www/melonfire-beta.com ServerName melonfire-beta.com ErrorLog logs/melonfire-beta.com-error_log CustomLog logs/melonfire-beta.com-access_log common </VirtualHost>
And you can test it by restarting the Apache server and pointing your browser to the Web sites http://melonfire-alpha.com and http://melonfire-beta.com (note that you may need to update your DNS tables as well for this to work).

On the assumption that you have created HTML files for each host and stored them in the locations you've specified for the DocumentRoot directive, Apache should display the appropriate index page for each server. And if you take a look at the log files, you should see separate log files for each virtual host.

As you might imagine, the ability to host multiple Web sites on a single server is an elegant - and economical - solution to the problem of limited IP address range in the IPv4 protocol. It also allows Web hosting services to "sub-host" multiple client domains on a single server, and developers to run multiple Web sites on their development and test systems for simulation purposes.

 
 
>>> More Site Administration Articles          >>> More By icarus, (c) Melonfire
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SITE ADMINISTRATION ARTICLES

- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: