----- Original Message ----- 
From: "matt farey" <[EMAIL PROTECTED]>
To: <users@httpd.apache.org>
Sent: Tuesday, February 20, 2007 10:51 PM
Subject: Re: [EMAIL PROTECTED] setting up virtual hosting


> 
> 
> Sam Carleton wrote:
> > Matt,
> >
> > I do want to set things up as you suggested, but it isn't working.
> > When I type in the IP address, I get the webdev.miltonstreet.com site
> > on port 80 and the subversion site on port 443.  Here is what I have:
> >
> > Listen 80
> > Listen 443
> >
> > NameVirtualHost 192.168.0.4:80
> >
> > ServerAdmin [EMAIL PROTECTED]
> > ServerName internal.miltonstreet.com
> >
> > DocumentRoot "/http/www/internal"
> >
> > <VirtualHost _default_:80>
> >    ServerName internal.miltonstreet.com
> >    DocumentRoot "/http/www/internal"
> > </VirtualHost>
> >
> > <Directory "/http/www/internal">
> >    Options None
> >    AllowOverride None
> >    Order allow,deny
> >    Allow from all
> > </Directory>
> >
> > <VirtualHost webdev.miltonstreet.com:80>
> >
> >    ServerName      webdev.miltonstreet.com
> >    DocumentRoot    "/http/www/webdev.miltonstreet.com"
> >
> >    ErrorLog /var/log/apache2/webdev.miltonstreet.com-error_log
> >    CustomLog /var/log/apache2/webdev.miltonstreet.com-access_log combined
> >
> >    <Directory "/http/www/webdev.miltonstreet.com">
> >        Options Indexes FollowSymLinks
> >        AllowOverride None
> >        Order allow,deny
> >        Allow from all
> >    </Directory>
> >
> > </VirtualHost>
> >
> > <VirtualHost *:443>
> >    DocumentRoot "/http/www/internal"
> > </VirtualHost>
> >
> > <VirtualHost subversion.miltonstreet.com:443>
> >
> >    ServerName subversion.miltonstreet.com
> >    DocumentRoot "/http/subversion/wwwRoot"
> >
> >    <Directory /http/subversion/wwwRoot>
> >        Order Allow,Deny
> >        Allow from all
> >    </Directory>
> >
> >    # more stuff here
> >
> > </VirtualHost>
> >

  It's probably because if you have one virtual host then you have to have ALL 
virtual hosts.  Any traffic coming directly to your IP address will by default 
go to the first VH. Any traffic coming to a host name will go to the 
appropriate VH. My setup looks like:


NameVirtualHost *
<VirtualHost *>
    ServerAdmin [EMAIL PROTECTED]
    ServerName www.your_default_site.com
    DocumentRoot "d:/xxx/xxx/default"
etc.
</VirtualHost>
<VirtualHost *>
    ServerAdmin [EMAIL PROTECTED]
    ServerName www.your_other_site_#1.com
    DocumentRoot "d:/xxx/xxx/other_site_1"
etc.
</VirtualHost>
<VirtualHost *>
    ServerAdmin [EMAIL PROTECTED]
    ServerName www.your_other_site_#2.com
    DocumentRoot "d:/xxx/xxx/other_site_2"
etc.
</VirtualHost>


---
Norm


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to