You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "H. Carter Harris" <ca...@technettn.net> on 2003/01/02 00:04:58 UTC

[users@httpd] Virtual Hosts ?

I have been following the list closely for the last few weeks trying to
become knowledgeable enough to configure an apache 1.3.23 as distributed by
Mandrake as a virtual host.

I want a default site and a name based site so I have the following:

NameVirtualHost 192.168.1.103

<VirtualHost _default_>
SeverName linuxserver.mydomain.net
DocumentRoot /var/www/html
</VirtualHost>

<VirtualHost 192.168.1.103>
ServerName www.domain2.com
DocumentRoot /usr/www/site.first/htdocs
</Virtual Host>

1. As written I get a 403 Forbidden error on both pages.

2. If I change the 192.168.1.103 in the second virtual host to *, requests
go to my default for both sites.

3. Changing the 192.168.1.103 to * in both the NameVirtualHost directive and
the second virtual host, returns a 403 Forbidden error when requesting
www.domain2.com and the default when requesting anything else at
192.168.1.103.

There are DocumentRoot directives outside the VirtualHost sections above.
Removing them gave me the same results as 3.

I would apprecaite any help I could get on this.



---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosts ?

Posted by Brad Alpert <BA...@fortbradford.com>.
Assuming you cut and pasted the vhost container info in your email,
you might want to fix this misspelling --> "SeverName
linuxserver.mydomain.net"

That might make a little bit of a difference.

Good luck,

Brad

> I have been following the list closely for the last few weeks
> trying to become knowledgeable enough to configure an apache
> 1.3.23 as distributed by Mandrake as a virtual host.
>
> I want a default site and a name based site so I have the
> following:
>
> NameVirtualHost 192.168.1.103
>
> <VirtualHost _default_>
> SeverName linuxserver.mydomain.net
> DocumentRoot /var/www/html
> </VirtualHost>
>
> <VirtualHost 192.168.1.103>
> ServerName www.domain2.com
> DocumentRoot /usr/www/site.first/htdocs
> </Virtual Host>




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Virtual Hosts ?

Posted by "H. Carter Harris" <ca...@technettn.net>.
The last couple of times I did use graceful ... thanks.

-----Original Message-----
From: Gary Turner [mailto:kk5st@sbcglobal.net]
Sent: Wednesday, January 01, 2003 9:53 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Virtual Hosts ?


H. Carter Harris wrote:

<snip>
>I can modify the httpd.conf file on the linux box
>then stop and restart apache to pick up the changes.

In Linux, use the utility 'apachectl graceful' to restart your server
without closing existing connections.  This effectively rereads
htppd.conf.  See man apachectl.  Maybe not necessary for this, but could
be handy.
--
gt                  kk5st@sbcglobal.net
 If someone tells you---
 "I have a sense of humor, but that's not funny." 
                                  ---they don't.

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosts ?

Posted by Gary Turner <kk...@sbcglobal.net>.
H. Carter Harris wrote:

<snip>
>I can modify the httpd.conf file on the linux box
>then stop and restart apache to pick up the changes.

In Linux, use the utility 'apachectl graceful' to restart your server
without closing existing connections.  This effectively rereads
htppd.conf.  See man apachectl.  Maybe not necessary for this, but could
be handy.
--
gt                  kk5st@sbcglobal.net
 If someone tells you---
 "I have a sense of humor, but that's not funny." 
                                  ---they don't.

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Virtual Hosts ?

Posted by Jeff Cohen <ap...@gej-it.com>.
If it works for you with the full path, then let it work.. if it doesn't
it means that the VHost see just the path where the DocumentRoot is and
that's why I'm using / and not the whole path to it.
If you want you can massage me privately and I'll send you my httpd.conf
file where I host 4 VHost, 1 is IP based and 3 are domain based.

You welcome and I think that we all enjoying helping you out,

Jeff Cohen

> -----Original Message-----
> From: H. Carter Harris [mailto:carter-lists@technettn.net]
> Sent: Wednesday, January 01, 2003 10:35 PM
> To: users@httpd.apache.org
> Subject: RE: [users@httpd] Virtual Hosts ?
> 
> Mandrake uses the following:
> 
> <IfModule mod_dir.c>
>     DirectoryIndex index.html index.php index.php3 index.shtml
index.cgi
> index.pl index.htm Default.htm default.htm
> </IfModule>
> 
> Jeff:  I tried your suggestion, partly (smile), and it worked, partly
> (smile).  I added the Directory to the second site and low and behold
I
> can
> get to the second site by requesting the domain name ...
www.domain2.com.
> But I can also get to the second domain by requesting the ip address
that
> is
> routed to 192.168.1.103 by my router.
> 
> Now, I have something to play with but I want to understand it not
just
> get
> it to work (that is not fashionable I know).
> 
> Here is what I entered in the second VirtualHost section:
> 
> <VirtualHost 192.168.1.103>
> ServerName www.domain2.com
> DocumentRoot /usr/www/site.first/htdocs
> <Directory /usr/www/site.first/htdocs>
> Options Indexes MultiViews
> AllowOverride None
> Order allow,deny
> Allow from all
> </Directory>
> </Virtual Host>
> 
> You suggested the line: <Directory "/">.  Should I really apply this
to
> the
> root?
> In the documentation they even recommend that the following be used:
> 
> <Directory />
> Order Deny,Allow
> Deny from All
> </Directory>
> 
> and then overriden for each directory you want available.
> 
> I am checking out the rest of the block but it looks like its going to
> work.
> I appreciate your help.  -Carter
> 
> 
> -----Original Message-----
> From: Jeff Cohen [mailto:apache@gej-it.com]
> Sent: Wednesday, January 01, 2003 7:50 PM
> To: users@httpd.apache.org
> Subject: RE: [users@httpd] Virtual Hosts ?
> 
> 
> I would suggest you to use the following directives inside the vhosts:
> DirectoryIndex index.htm index.php
>   <Directory "/">
>         Options Indexes MultiViews
>         AllowOverride None
>         Order allow,deny
>         Allow from all
>    </Directory>
> 
> 
> All the best and Happy New Year,
> Jeff Cohen
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Virtual Hosts ?

Posted by "H. Carter Harris" <ca...@technettn.net>.
Mandrake uses the following:

<IfModule mod_dir.c>
    DirectoryIndex index.html index.php index.php3 index.shtml index.cgi
index.pl index.htm Default.htm default.htm
</IfModule>

Jeff:  I tried your suggestion, partly (smile), and it worked, partly
(smile).  I added the Directory to the second site and low and behold I can
get to the second site by requesting the domain name ... www.domain2.com.
But I can also get to the second domain by requesting the ip address that is
routed to 192.168.1.103 by my router.

Now, I have something to play with but I want to understand it not just get
it to work (that is not fashionable I know).

Here is what I entered in the second VirtualHost section:

<VirtualHost 192.168.1.103>
ServerName www.domain2.com
DocumentRoot /usr/www/site.first/htdocs
<Directory /usr/www/site.first/htdocs>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</Virtual Host>

You suggested the line: <Directory "/">.  Should I really apply this to the
root?
In the documentation they even recommend that the following be used:

<Directory />
Order Deny,Allow
Deny from All
</Directory>

and then overriden for each directory you want available.

I am checking out the rest of the block but it looks like its going to work.
I appreciate your help.  -Carter


-----Original Message-----
From: Jeff Cohen [mailto:apache@gej-it.com]
Sent: Wednesday, January 01, 2003 7:50 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Virtual Hosts ?


I would suggest you to use the following directives inside the vhosts:
DirectoryIndex index.htm index.php
  <Directory "/">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
   </Directory>


All the best and Happy New Year,
Jeff Cohen




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Virtual Hosts ?

Posted by Jeff Cohen <ap...@gej-it.com>.
I would suggest you to use the following directives inside the vhosts:
DirectoryIndex index.htm index.php  
  <Directory "/">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
   </Directory>


All the best and Happy New Year,
Jeff Cohen

> -----Original Message-----
> From: H. Carter Harris [mailto:carter-lists@technettn.net]
> Sent: Wednesday, January 01, 2003 8:16 PM
> To: users@httpd.apache.org
> Subject: RE: [users@httpd] Virtual Hosts ?
> 
> Brad:  I didn't cut and paste I typed and it is correct in the conf
file.
> Thanks for catching me though (smile).
> 
> Michael:  I am currently running an IIS server (nt4) and a DNS server
> (win2k) that I would like to replace with the linux box.  So I'm
learning
> the linux world.  Abit not without some pain.
> 
> I am actually testing this over the internet.  I am using VPN to
access
> all
> three of these servers.  I can modify the httpd.conf file on the linux
box
> then stop and restart apache to pick up the changes.  I have a FQDN
that
> is
> not in production and I can modify the DNS server on win2k the same
way.
> I
> am testing by pointing my local browser to the ip address of the
router
> (which I also configured).   103 is a static address on the server and
the
> router ... I'm not using DHCP to get it.
> 
> I can configure apache (as described) and get the default site on the
> linux
> box.  If I point the default to the second document root I get the
second
> site instead of the default.  So it works okay for one site at at time
...
> either one.
> 
> But I want them both to work.  www.domain2.com when requested and the
> default when anything else is requested.  It ought to be simple.
> 
> I appreciate the reply and welcome any more suggestions.  I'm getting
to
> the
> server but I'm not serving up the right sites on demand.  Thanks again
to
> both of you.
> 
> -----Original Message-----
> From: Michael Olds [mailto:MikeOlds@themozone.net]
> Sent: Wednesday, January 01, 2003 6:18 PM
> To: users@httpd.apache.org
> Subject: RE: [users@httpd] Virtual Hosts ?
> 
> 
> > I have been following the list closely for the last few weeks trying
to
> > become knowledgeable enough to configure an apache 1.3.23 as
> > distributed by
> > Mandrake as a virtual host.
> >
> > I want a default site and a name based site so I have the following:
> >
> > NameVirtualHost 192.168.1.103
> >
> > <VirtualHost _default_>
> > SeverName linuxserver.mydomain.net
> > DocumentRoot /var/www/html
> > </VirtualHost>
> >
> > <VirtualHost 192.168.1.103>
> > ServerName www.domain2.com
> > DocumentRoot /usr/www/site.first/htdocs
> > </Virtual Host>
> >
> > 1. As written I get a 403 Forbidden error on both pages.
> >
> > 2. If I change the 192.168.1.103 in the second virtual host to *,
> requests
> > go to my default for both sites.
> >
> > 3. Changing the 192.168.1.103 to * in both the NameVirtualHost
> > directive and
> > the second virtual host, returns a 403 Forbidden error when
requesting
> > www.domain2.com and the default when requesting anything else at
> > 192.168.1.103.
> >
> > There are DocumentRoot directives outside the VirtualHost sections
> above.
> > Removing them gave me the same results as 3.
> >
> I'm just a duffer meself, but on a day like today you might not do any
> better.
> 
> How are you figuring you have IP# 192.168.1.103?
> 
> Try using the IP# in both VH containers (the first is always the
default)
> 
> My gut feeling tells me you are on a LAN and are using DHCP. Are you
just
> taking the number the router usually gives you? You need to set up
static
> IP
> numbers on the LAN (fiddle with router and Network setups on each
computer
> or the header information needed to sort out whichiwhicha doesn't get
> through.
> 
> Best Wishes!
> Mike Olds www.buddhadust.org
> 
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Virtual Hosts ?

Posted by Michael Olds <Mi...@themozone.net>.
> Michael:  I am currently running an IIS server (nt4) and a DNS server
> (win2k) that I would like to replace with the linux box.  So I'm learning
> the linux world.  Abit not without some pain.
>
> I am actually testing this over the internet.  I am using VPN to
> access all
> three of these servers.  I can modify the httpd.conf file on the linux box
> then stop and restart apache to pick up the changes.  I have a
> FQDN that is
> not in production and I can modify the DNS server on win2k the
> same way.  I
> am testing by pointing my local browser to the ip address of the router
> (which I also configured).   103 is a static address on the server and the
> router ... I'm not using DHCP to get it.
>
> I can configure apache (as described) and get the default site on
> the linux
> box.  If I point the default to the second document root I get the second
> site instead of the default.  So it works okay for one site at at time ...
> either one.
>
> But I want them both to work.  www.domain2.com when requested and the
> default when anything else is requested.  It ought to be simple.
>

Next we ask about /etc/hosts
you need to list all the alternatives:

127.0.0.1  localhost
192.168.1.103 domain1
192.168.1.103 domain2

Best Wishes!
Mike Olds www.buddhadust.org


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Virtual Hosts ?

Posted by "H. Carter Harris" <ca...@technettn.net>.
Jaqui:  The devil is in the details ... I think it will work out.

Thanks for supplying some of those details ... -Carter


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosts ?

Posted by "J. Greenlees" <ja...@shaw.ca>.

H. Carter Harris wrote:
> Thanks Owen; I think we are getting to what's behind door #2.

actually, I'm Jaqui, I just quoted Owen's post from another thread ;)
> 
> Here is the plan:  I am currently hosting about a dozen domains on an IIS
> server but I want to move them to apache and linux.  So, I will be hosting
> more than one domain.  IIS calls them host headers and processes them the
> same way apache does.
> 
> If I am understanding this correctly, I should be able to do this with a
> <VirtualHost> block for each domain and setting the ServerName to the domain
> name.  Apache is listening on 192.168.1.103:80 and should use the host
> header in each request to resolve to the correct directory on the linux box.
> 
> Though I didn't say it specifically, you read between the lines.  Later I
> will be moving a couple of other domains to the linux box as well and they
> will require certs.  Then I will add some public ip addresses and try to
> configure apache to handle some ip based virtual hosting for me as well.
> Everything I read tells me this is possible.
> 
yup, though you would need to specify a different port for each ssl 
cert. if you are using name based for thise sites, for the secure server 
you would have to specify a different port through the listen directive.

if ip based you wouldn't need to specify ports, though you would need to 
point apache to the certificate for each ip, in the virtual host 
definitions. it may be a good idea to use different ports even with ip 
based secure sites, to ensure no conflicts between them.


> I am really enjoying learning about apache and open source.  My goal right
> now is to get to where I can contribute back soon.  Thanks for your response
> ... it is appreciated.
> 
> 
> -----Original Message-----
> From: J. Greenlees [mailto:jaqui@shaw.ca]
> Sent: Wednesday, January 01, 2003 9:33 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Virtual Hosts ?
> 
> 
> from reading this thread, I can see that you are combining both name
> based and ip based virtual hosting. ( default is ip based )
> 
> the clearest description I have seen of both forms was from Owen Boyle.
> 
> "
> There are two ways you can go - depending on whether you want to declare
> many aliases for your IP in DNS...
> 
> (1) If you do not mind paying for many Domain-Names which resolve to
> your IP, then:
> 
> Use Name-based VirtualHosts, like this (assume your IP = 192.168.1.1 and
> your sites are called www.site1.com, www.site2.com etc..):
> 
> 	NameVirtualHost 192.168.1.1
> 
> 	<VirtualHost 192.168.1.1>
> 	  ServerName www.site1.com
> 	  DocumentRoot /home/site1/html
> 	  ... etc.
> 	</VirtualHost>
> 
> 	<VirtualHost 192.168.1.1>
> 	  ServerName www.site2.com
> 	  DocumentRoot /home/site2/html
> 	  ... etc.
> 	</VirtualHost>
> 
> (2) Alternatively, if you can have only one Domain Name, use Aliases to
> separate the document roots, e.g. (assuming your FQDN is www.mysite.com)
> 
> 	Listen 192.168.1.1
> 	ServerName www.mysite.com
> 	DocumentRoot /home/default/html
> 
> 	Alias /site1 /home/site1/html
> 	<Directory /home/site1/html>
> 	  Allow from all
> 	</Directory>
> 
> 	Alias /site2 /home/site2/html
> 	<Directory /home/site2/html>
> 	  Allow from all
> 	</Directory>
> 
> Now http://www.mysite.com/site1 will go to /home/site1/html etc. NB
> /home/default/html is necessary - this is where www.mysite.com ends up
> (you can just put a simple page there with links to the other sites).
> 
> Rgds,
> 
> Owen Boyle
> 
> "
> 
> hope this helps you puzzle out where it's not working for you.
> 
> Michael Olds wrote:
> 
>>Well my next suggestion is to bump the quesion tomorrow when there are
>>likely more experienced heads paying attention.
>>
>>Best Wishes!
>>Mike Olds www.buddhadust.org
> 
> 
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 



---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Virtual Hosts ?

Posted by "H. Carter Harris" <ca...@technettn.net>.
Thanks Owen; I think we are getting to what's behind door #2.

Here is the plan:  I am currently hosting about a dozen domains on an IIS
server but I want to move them to apache and linux.  So, I will be hosting
more than one domain.  IIS calls them host headers and processes them the
same way apache does.

If I am understanding this correctly, I should be able to do this with a
<VirtualHost> block for each domain and setting the ServerName to the domain
name.  Apache is listening on 192.168.1.103:80 and should use the host
header in each request to resolve to the correct directory on the linux box.

Though I didn't say it specifically, you read between the lines.  Later I
will be moving a couple of other domains to the linux box as well and they
will require certs.  Then I will add some public ip addresses and try to
configure apache to handle some ip based virtual hosting for me as well.
Everything I read tells me this is possible.

I am really enjoying learning about apache and open source.  My goal right
now is to get to where I can contribute back soon.  Thanks for your response
... it is appreciated.


-----Original Message-----
From: J. Greenlees [mailto:jaqui@shaw.ca]
Sent: Wednesday, January 01, 2003 9:33 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Virtual Hosts ?


from reading this thread, I can see that you are combining both name
based and ip based virtual hosting. ( default is ip based )

the clearest description I have seen of both forms was from Owen Boyle.

"
There are two ways you can go - depending on whether you want to declare
many aliases for your IP in DNS...

(1) If you do not mind paying for many Domain-Names which resolve to
your IP, then:

Use Name-based VirtualHosts, like this (assume your IP = 192.168.1.1 and
your sites are called www.site1.com, www.site2.com etc..):

	NameVirtualHost 192.168.1.1

	<VirtualHost 192.168.1.1>
	  ServerName www.site1.com
	  DocumentRoot /home/site1/html
	  ... etc.
	</VirtualHost>

	<VirtualHost 192.168.1.1>
	  ServerName www.site2.com
	  DocumentRoot /home/site2/html
	  ... etc.
	</VirtualHost>

(2) Alternatively, if you can have only one Domain Name, use Aliases to
separate the document roots, e.g. (assuming your FQDN is www.mysite.com)

	Listen 192.168.1.1
	ServerName www.mysite.com
	DocumentRoot /home/default/html

	Alias /site1 /home/site1/html
	<Directory /home/site1/html>
	  Allow from all
	</Directory>

	Alias /site2 /home/site2/html
	<Directory /home/site2/html>
	  Allow from all
	</Directory>

Now http://www.mysite.com/site1 will go to /home/site1/html etc. NB
/home/default/html is necessary - this is where www.mysite.com ends up
(you can just put a simple page there with links to the other sites).

Rgds,

Owen Boyle

"

hope this helps you puzzle out where it's not working for you.

Michael Olds wrote:
> Well my next suggestion is to bump the quesion tomorrow when there are
> likely more experienced heads paying attention.
>
> Best Wishes!
> Mike Olds www.buddhadust.org


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosts ?

Posted by "J. Greenlees" <ja...@shaw.ca>.
from reading this thread, I can see that you are combining both name 
based and ip based virtual hosting. ( default is ip based )

the clearest description I have seen of both forms was from Owen Boyle.

"
There are two ways you can go - depending on whether you want to declare
many aliases for your IP in DNS...

(1) If you do not mind paying for many Domain-Names which resolve to
your IP, then:

Use Name-based VirtualHosts, like this (assume your IP = 192.168.1.1 and
your sites are called www.site1.com, www.site2.com etc..):

	NameVirtualHost 192.168.1.1

	<VirtualHost 192.168.1.1>
	  ServerName www.site1.com
	  DocumentRoot /home/site1/html
	  ... etc.
	</VirtualHost>

	<VirtualHost 192.168.1.1>
	  ServerName www.site2.com
	  DocumentRoot /home/site2/html
	  ... etc.
	</VirtualHost>

(2) Alternatively, if you can have only one Domain Name, use Aliases to
separate the document roots, e.g. (assuming your FQDN is www.mysite.com)

	Listen 192.168.1.1
	ServerName www.mysite.com
	DocumentRoot /home/default/html

	Alias /site1 /home/site1/html
	<Directory /home/site1/html>
	  Allow from all
	</Directory>

	Alias /site2 /home/site2/html
	<Directory /home/site2/html>
	  Allow from all
	</Directory>

Now http://www.mysite.com/site1 will go to /home/site1/html etc. NB
/home/default/html is necessary - this is where www.mysite.com ends up
(you can just put a simple page there with links to the other sites).

Rgds,

Owen Boyle

"

hope this helps you puzzle out where it's not working for you.

Michael Olds wrote:
> Well my next suggestion is to bump the quesion tomorrow when there are
> likely more experienced heads paying attention.
> 
> Best Wishes!
> Mike Olds www.buddhadust.org


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Virtual Hosts ?

Posted by "H. Carter Harris" <ca...@technettn.net>.
Thanks Mike ... I appreciate your effort.

-----Original Message-----
From: Michael Olds [mailto:MikeOlds@themozone.net]
Sent: Wednesday, January 01, 2003 9:13 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Virtual Hosts ?


Well my next suggestion is to bump the quesion tomorrow when there are
likely more experienced heads paying attention.

Best Wishes!
Mike Olds www.buddhadust.org


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Virtual Hosts ?

Posted by Michael Olds <Mi...@themozone.net>.
Well my next suggestion is to bump the quesion tomorrow when there are
likely more experienced heads paying attention.

Best Wishes!
Mike Olds www.buddhadust.org


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Virtual Hosts ?

Posted by "H. Carter Harris" <ca...@technettn.net>.
When I want to test for the second domain I do use the domain name.  It's
only when I test for default that I go to an ip address.

-----Original Message-----
From: Michael Olds [mailto:MikeOlds@themozone.net]
Sent: Wednesday, January 01, 2003 7:43 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Virtual Hosts ?


I
> am testing by pointing my local browser to the ip address of the router
> (which I also configured).   103 is a static address on the server and the
> router ... I'm not using DHCP to get it.

You need to use the domain name. You are useing NameBased VirtualHosting.

Best Wishes!
Mike Olds www.buddhadust.org


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Virtual Hosts ?

Posted by Michael Olds <Mi...@themozone.net>.
I
> am testing by pointing my local browser to the ip address of the router
> (which I also configured).   103 is a static address on the server and the
> router ... I'm not using DHCP to get it.

You need to use the domain name. You are useing NameBased VirtualHosting.

Best Wishes!
Mike Olds www.buddhadust.org


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Virtual Hosts ?

Posted by "H. Carter Harris" <ca...@technettn.net>.
Brad:  I didn't cut and paste I typed and it is correct in the conf file.
Thanks for catching me though (smile).

Michael:  I am currently running an IIS server (nt4) and a DNS server
(win2k) that I would like to replace with the linux box.  So I'm learning
the linux world.  Abit not without some pain.

I am actually testing this over the internet.  I am using VPN to access all
three of these servers.  I can modify the httpd.conf file on the linux box
then stop and restart apache to pick up the changes.  I have a FQDN that is
not in production and I can modify the DNS server on win2k the same way.  I
am testing by pointing my local browser to the ip address of the router
(which I also configured).   103 is a static address on the server and the
router ... I'm not using DHCP to get it.

I can configure apache (as described) and get the default site on the linux
box.  If I point the default to the second document root I get the second
site instead of the default.  So it works okay for one site at at time ...
either one.

But I want them both to work.  www.domain2.com when requested and the
default when anything else is requested.  It ought to be simple.

I appreciate the reply and welcome any more suggestions.  I'm getting to the
server but I'm not serving up the right sites on demand.  Thanks again to
both of you.

-----Original Message-----
From: Michael Olds [mailto:MikeOlds@themozone.net]
Sent: Wednesday, January 01, 2003 6:18 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Virtual Hosts ?


> I have been following the list closely for the last few weeks trying to
> become knowledgeable enough to configure an apache 1.3.23 as
> distributed by
> Mandrake as a virtual host.
>
> I want a default site and a name based site so I have the following:
>
> NameVirtualHost 192.168.1.103
>
> <VirtualHost _default_>
> SeverName linuxserver.mydomain.net
> DocumentRoot /var/www/html
> </VirtualHost>
>
> <VirtualHost 192.168.1.103>
> ServerName www.domain2.com
> DocumentRoot /usr/www/site.first/htdocs
> </Virtual Host>
>
> 1. As written I get a 403 Forbidden error on both pages.
>
> 2. If I change the 192.168.1.103 in the second virtual host to *, requests
> go to my default for both sites.
>
> 3. Changing the 192.168.1.103 to * in both the NameVirtualHost
> directive and
> the second virtual host, returns a 403 Forbidden error when requesting
> www.domain2.com and the default when requesting anything else at
> 192.168.1.103.
>
> There are DocumentRoot directives outside the VirtualHost sections above.
> Removing them gave me the same results as 3.
>
I'm just a duffer meself, but on a day like today you might not do any
better.

How are you figuring you have IP# 192.168.1.103?

Try using the IP# in both VH containers (the first is always the default)

My gut feeling tells me you are on a LAN and are using DHCP. Are you just
taking the number the router usually gives you? You need to set up static IP
numbers on the LAN (fiddle with router and Network setups on each computer
or the header information needed to sort out whichiwhicha doesn't get
through.

Best Wishes!
Mike Olds www.buddhadust.org


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Virtual Hosts ?

Posted by Michael Olds <Mi...@themozone.net>.
> I have been following the list closely for the last few weeks trying to
> become knowledgeable enough to configure an apache 1.3.23 as
> distributed by
> Mandrake as a virtual host.
>
> I want a default site and a name based site so I have the following:
>
> NameVirtualHost 192.168.1.103
>
> <VirtualHost _default_>
> SeverName linuxserver.mydomain.net
> DocumentRoot /var/www/html
> </VirtualHost>
>
> <VirtualHost 192.168.1.103>
> ServerName www.domain2.com
> DocumentRoot /usr/www/site.first/htdocs
> </Virtual Host>
>
> 1. As written I get a 403 Forbidden error on both pages.
>
> 2. If I change the 192.168.1.103 in the second virtual host to *, requests
> go to my default for both sites.
>
> 3. Changing the 192.168.1.103 to * in both the NameVirtualHost
> directive and
> the second virtual host, returns a 403 Forbidden error when requesting
> www.domain2.com and the default when requesting anything else at
> 192.168.1.103.
>
> There are DocumentRoot directives outside the VirtualHost sections above.
> Removing them gave me the same results as 3.
>
I'm just a duffer meself, but on a day like today you might not do any
better.

How are you figuring you have IP# 192.168.1.103?

Try using the IP# in both VH containers (the first is always the default)

My gut feeling tells me you are on a LAN and are using DHCP. Are you just
taking the number the router usually gives you? You need to set up static IP
numbers on the LAN (fiddle with router and Network setups on each computer
or the header information needed to sort out whichiwhicha doesn't get
through.

Best Wishes!
Mike Olds www.buddhadust.org


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org