Re: setting up virtual hosting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- Original Message ----- 
From: "matt farey" <matt.farey@xxxxxxxxx>
To: <users@xxxxxxxxxxxxxxxx>
Sent: Tuesday, February 20, 2007 10:51 PM
Subject: Re:  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 scarleton@xxxxxxxxxxxxxxxx
> > 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 xxxx@xxxxxxx
    ServerName www.your_default_site.com
    DocumentRoot "d:/xxx/xxx/default"
etc.
</VirtualHost>
<VirtualHost *>
    ServerAdmin xxxx@xxxxxxx
    ServerName www.your_other_site_#1.com
    DocumentRoot "d:/xxx/xxx/other_site_1"
etc.
</VirtualHost>
<VirtualHost *>
    ServerAdmin xxxx@xxxxxxx
    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: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux