View Single Post
Old 09-28-2005, 08:26 PM   #2 (permalink)
taylor
Junior Member
 
Join Date: Aug 2005
Posts: 28
Default

There are two parts to this. The first one is that you must issue a directive which gives Apache an IP address to serve the name based domains from. Like this:
PHP Code:
# If you want to use name-based virtual hosts you need to define at
           
   # least one IP address (and port number) for them.
           
   #
           
   
NameVirtualHost 12.34.56.78:80 
The second part is then to add the VirtualHost directives for each domain. Like this:
PHP Code:
# VirtualHost example (name based):
             
   # Almost any Apache directive may go into a VirtualHost container.
                
   #
              
   
<VirtualHost name.of.host.some_domain.com/>
              
   
ServerAdmin webmaster@host.some_domain.com
              
   DocumentRoot 
/www/docs/host.some_domain.com
              
   ServerName host
.some_domain.com/
             
   
ErrorLog logs/host.some_domain.com-error_log
            
   CustomLog logs
/host.some_domain.com-access_log common
         
   
</VirtualHost

This is just a basic outline there are many differnet ways to write your virtual host within your httpd file.
taylor is offline   Reply With Quote
Sponsored Links