You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Subscribed <su...@myarchive.biz> on 2002/04/29 20:40:38 UTC

Virtual Hosts in Apache

Im trying to get Virtual Hosts for two domains to run in apache 1.3.24

I'm obviously messing up the syntax, because the sites both point to the
same page-

Here's what I've got so far- thanks in advance!

<VirtualHost www.site1.com>
    NameVirtualHost www.site1.com
    ServerAdmin webmaster@site1.com
    DocumentRoot H:/Webhost/
    ServerName www.site1.com
    ErrorLog logs/www.site1.com-error_log
    Options Indexes FollowSymLinks
    Options +ExecCGI
    AddHandler cgi-script cgi pl exe
</VirtualHost>
<VirtualHost www.site2.com>
    NameVirtualHost www.site2.com
    ServerAdmin webmaster@site2.com
    DocumentRoot H:/site2web/
    ServerName www.site2.com
    ErrorLog logs/www.site2.com-error_log
    Options Indexes FollowSymLinks
    Options +ExecCGI
    AddHandler cgi-script cgi pl exe
</VirtualHost>


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


Re: Virtual Hosts in Apache

Posted by Subscribed <su...@myarchive.biz>.
Then I am at a loss after checking the docs.
It would SEEM (with my foggy head) that this would
allow browsers requesting site1 to get files from H:/Webhost/
and allow browsers requesting site2 to get files from
H:/site2web, but they both get from site1.....

What am i missing?
(thanks for the patience! :)


VirtualHost www.site1.com>
    ServerAdmin webmaster@site1.com
    DocumentRoot H:/Webhost/
    ServerName www.site1.com
    ErrorLog logs/www.site1.com-error_log
    Options Indexes FollowSymLinks
    Options +ExecCGI
    AddHandler cgi-script cgi pl exe
</VirtualHost>
<VirtualHost www.site2.com>
    ServerAdmin webmaster@site2.com
    DocumentRoot H:/site2web/
    ServerName www.site2.com
    ErrorLog logs/www.site2.com-error_log
    Options Indexes FollowSymLinks
    Options +ExecCGI
    AddHandler cgi-script cgi pl exe
</VirtualHost>




====================================
"It is said that if you line up all the cars in the
world end to end, someone would be stupid
enough to try and pass them."
====================================
----- Original Message -----
From: "Esteban" <es...@epnet.com.ar>
To: <us...@httpd.apache.org>
Sent: Monday, April 29, 2002 2:00 PM
Subject: Re: Virtual Hosts in Apache


> You can configure more than one virtual hosts in only one IP address. It
> depends of your dns configuration and which IP bind each virtual host.
>
> ----- Original Message -----
> From: "Subscribed" <su...@myarchive.biz>
> To: <us...@httpd.apache.org>
> Sent: Monday, April 29, 2002 3:56 PM
> Subject: Re: Virtual Hosts in Apache
>
>
> > Thanks for the link, thats where I've been crawling over
> > I've removed the Named Virtual Hosts directive, but
> > am I correct in thinking that each site needs a specific IP address?
> >
> >
> >
> >
> >
> >
> >
> > ====================================
> > ----- Original Message -----
> > From: "Joshua Slive" <jo...@slive.ca>
> > To: <us...@httpd.apache.org>
> > Sent: Monday, April 29, 2002 1:44 PM
> > Subject: Re: Virtual Hosts in Apache
> >
> >
> > > On Mon, 29 Apr 2002, Subscribed wrote:
> > >
> > > > Im trying to get Virtual Hosts for two domains to run in apache
1.3.24
> > > >
> > > > I'm obviously messing up the syntax, because the sites both point to
> the
> > > > same page-
> > >
> > > Yep, you screwed up the syntax.  Rather than detailing every single
> > > problem, let me just point out the bigest problem: you need to read
the
> > > docs:
> > >
> > > http://httpd.apache.org/docs/vhosts/name-based.html
> > >
> > > Joshua.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
> > > 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
> > 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
> 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
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual Hosts in Apache

Posted by Esteban <es...@epnet.com.ar>.
You can configure more than one virtual hosts in only one IP address. It
depends of your dns configuration and which IP bind each virtual host.

----- Original Message -----
From: "Subscribed" <su...@myarchive.biz>
To: <us...@httpd.apache.org>
Sent: Monday, April 29, 2002 3:56 PM
Subject: Re: Virtual Hosts in Apache


> Thanks for the link, thats where I've been crawling over
> I've removed the Named Virtual Hosts directive, but
> am I correct in thinking that each site needs a specific IP address?
>
>
>
>
>
>
>
> ====================================
> ----- Original Message -----
> From: "Joshua Slive" <jo...@slive.ca>
> To: <us...@httpd.apache.org>
> Sent: Monday, April 29, 2002 1:44 PM
> Subject: Re: Virtual Hosts in Apache
>
>
> > On Mon, 29 Apr 2002, Subscribed wrote:
> >
> > > Im trying to get Virtual Hosts for two domains to run in apache 1.3.24
> > >
> > > I'm obviously messing up the syntax, because the sites both point to
the
> > > same page-
> >
> > Yep, you screwed up the syntax.  Rather than detailing every single
> > problem, let me just point out the bigest problem: you need to read the
> > docs:
> >
> > http://httpd.apache.org/docs/vhosts/name-based.html
> >
> > Joshua.
> >
> >
> > ---------------------------------------------------------------------
> > 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
> > 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
> 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
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual Hosts in Apache

Posted by Subscribed <su...@myarchive.biz>.
Thanks Brian, but it was a problem with my not specifying IP addresses in
the two areas.

:)



====================================
"The things that come to those that wait may be
the things left by those who got there first."
====================================
----- Original Message -----
From: "Brian" <bb...@qwest.net>
To: <us...@httpd.apache.org>
Sent: Monday, April 29, 2002 2:55 PM
Subject: Re: Virtual Hosts in Apache


> try using:
>
> #
> # UseCanonicalName:  (new for 1.3)  With this setting turned on, whenever
> # Apache needs to construct a self-referencing URL (a URL that refers back
> # to the server the response is coming from) it will use ServerName and
> # Port to form a "canonical" name.  With this setting off, Apache will
> # use the hostname:port that the client supplied, when possible.  This
> # also affects SERVER_NAME and SERVER_PORT in CGI scripts.
> #
> UseCanonicalName OFF
>
>
> Brian
>
>
>
>
> ----- Original Message -----
> From: "Joshua Slive" <jo...@slive.ca>
> To: <us...@httpd.apache.org>
> Sent: Monday, April 29, 2002 12:08 PM
> Subject: Re: Virtual Hosts in Apache
>
>
> >
> > On Mon, 29 Apr 2002, Subscribed wrote:
> >
> > > Thanks for the link, thats where I've been crawling over
> > > I've removed the Named Virtual Hosts directive, but
> > > am I correct in thinking that each site needs a specific IP address?
> >
> > No, that is not correct.  You should use the exact example from the page
> > that I referenced, and just change the ServerName and DocumentRoot in
each
> > <VirtualHost> to fit your site (and add other directives as needed).
> >
> > Joshua.
> >
> >
> > ---------------------------------------------------------------------
> > 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
> > 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
> 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
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual Hosts in Apache

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 29 Apr 2002, Brian wrote:

> try using:
> UseCanonicalName OFF

Why are you suggesting that?   It has almost nothing to do with virtual
hosts.

Joshua.


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


Re: Virtual Hosts in Apache

Posted by Brian <bb...@qwest.net>.
try using:

#
# UseCanonicalName:  (new for 1.3)  With this setting turned on, whenever
# Apache needs to construct a self-referencing URL (a URL that refers back
# to the server the response is coming from) it will use ServerName and
# Port to form a "canonical" name.  With this setting off, Apache will
# use the hostname:port that the client supplied, when possible.  This
# also affects SERVER_NAME and SERVER_PORT in CGI scripts.
#
UseCanonicalName OFF


Brian




----- Original Message -----
From: "Joshua Slive" <jo...@slive.ca>
To: <us...@httpd.apache.org>
Sent: Monday, April 29, 2002 12:08 PM
Subject: Re: Virtual Hosts in Apache


>
> On Mon, 29 Apr 2002, Subscribed wrote:
>
> > Thanks for the link, thats where I've been crawling over
> > I've removed the Named Virtual Hosts directive, but
> > am I correct in thinking that each site needs a specific IP address?
>
> No, that is not correct.  You should use the exact example from the page
> that I referenced, and just change the ServerName and DocumentRoot in each
> <VirtualHost> to fit your site (and add other directives as needed).
>
> Joshua.
>
>
> ---------------------------------------------------------------------
> 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
> 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
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual Hosts in Apache

Posted by Subscribed <su...@myarchive.biz>.
BINGO!

Thanks Joshua! It was the NamedVirtualHosts directive that was off, along
with the
<virtualhost> specification. They needed to be NamedVirtualHost (my ip)
and <VirtualHost (myip)> and volia!
My fear was that specifying the IP address in both virtualhosts would make
them both point to the same page.

Thanks again!







====================================
"The things that come to those that wait may be
the things left by those who got there first."
====================================
----- Original Message -----
From: "Joshua Slive" <jo...@slive.ca>
To: <us...@httpd.apache.org>
Sent: Monday, April 29, 2002 2:08 PM
Subject: Re: Virtual Hosts in Apache


>
> On Mon, 29 Apr 2002, Subscribed wrote:
>
> > Thanks for the link, thats where I've been crawling over
> > I've removed the Named Virtual Hosts directive, but
> > am I correct in thinking that each site needs a specific IP address?
>
> No, that is not correct.  You should use the exact example from the page
> that I referenced, and just change the ServerName and DocumentRoot in each
> <VirtualHost> to fit your site (and add other directives as needed).
>
> Joshua.
>
>
> ---------------------------------------------------------------------
> 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
> 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
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual Hosts in Apache

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 29 Apr 2002, Subscribed wrote:

> Thanks for the link, thats where I've been crawling over
> I've removed the Named Virtual Hosts directive, but
> am I correct in thinking that each site needs a specific IP address?

No, that is not correct.  You should use the exact example from the page
that I referenced, and just change the ServerName and DocumentRoot in each
<VirtualHost> to fit your site (and add other directives as needed).

Joshua.


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


Re: Virtual Hosts in Apache

Posted by Subscribed <su...@myarchive.biz>.
Thanks for the link, thats where I've been crawling over
I've removed the Named Virtual Hosts directive, but
am I correct in thinking that each site needs a specific IP address?







====================================
----- Original Message -----
From: "Joshua Slive" <jo...@slive.ca>
To: <us...@httpd.apache.org>
Sent: Monday, April 29, 2002 1:44 PM
Subject: Re: Virtual Hosts in Apache


> On Mon, 29 Apr 2002, Subscribed wrote:
>
> > Im trying to get Virtual Hosts for two domains to run in apache 1.3.24
> >
> > I'm obviously messing up the syntax, because the sites both point to the
> > same page-
>
> Yep, you screwed up the syntax.  Rather than detailing every single
> problem, let me just point out the bigest problem: you need to read the
> docs:
>
> http://httpd.apache.org/docs/vhosts/name-based.html
>
> Joshua.
>
>
> ---------------------------------------------------------------------
> 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
> 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
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual Hosts in Apache

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 29 Apr 2002, Subscribed wrote:

> Im trying to get Virtual Hosts for two domains to run in apache 1.3.24
>
> I'm obviously messing up the syntax, because the sites both point to the
> same page-

Yep, you screwed up the syntax.  Rather than detailing every single
problem, let me just point out the bigest problem: you need to read the
docs:

http://httpd.apache.org/docs/vhosts/name-based.html

Joshua.


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