Administration
  Home arrow Administration arrow Page 4 - Getting More Out Of Apache (Part 1)
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
ADMINISTRATION

Getting More Out Of Apache (Part 1)
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 5
    2001-01-04


    Table of Contents:
  • Getting More Out Of Apache (Part 1)
  • Virtually Yours
  • Two Birds With One Host
  • Gotcha!
  • Including A Few More Tricks

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Getting More Out Of Apache (Part 1) - Gotcha!
    ( Page 4 of 5 )

    There are, however, a couple of gotchas with virtual hosting.

    Once you have specified the NameVirtualHost directive, it's important to remember that all the other default settings in your configuration file are null and void. Consequently, if you wish to access the default server "localhost", you will need to include it in the list of virtual hosts.

    The second gotcha is the one mentioned a few pages back - clients which do not support HTTP/1.1 will not be able to view virtual hosts correctly. The Apache documentation addresses this problem via the ServerPath directive.

    Here's what it would look 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 ServerPath /alpha 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 ServerPath /beta ErrorLog logs/melonfire-beta.com-error_log CustomLog logs/melonfire-beta.com-access_log common </VirtualHost>
    How does this work? Very simply - any requests for URLs beginning with the descriptor /alpha will be automatically served from host "melonfire-alpha.com", while URLs beginning with the descriptor /beta will be served from host "melonfire-beta.com".

    For more information on this, you should take a look at the Apache documentation, which includes a working example.

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

       

    ADMINISTRATION ARTICLES

    - Network Booting via PXE: the Basics
    - Scalix: Linux Administrator`s Guide
    - Network Administration with FreeBSD 7
    - Components of an Information Architecture
    - The Anatomy of an Information Architecture
    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek