You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Michael Reutter <li...@meinsenf.at> on 2001/12/11 11:05:51 UTC

Re : Re: 2 httpds on 1 server

hi Owen,

of course apache itself can't direct the request to a specific port - but using a firewall is a good idea!!!!

but what about virtual-hosts (so one httpd would be enough!!!):
in the normal way you have many webs on one host (many names - one IP).
all requests go to the same ip - but apache can distinguish between them, by looking at the "host"-header.

you mean it is possible to do it the other way??? (would be great)
but how can apache distinguish between the requests?
one request goes to "webserver" and IP 10.0.0.1 and the other one goes to "webserver" and IP 10.0.0.2 - IMO it would work, if the requests do not go to "webserver", but to the IP itself (using http://10.0.0.2 instead of http://webserver)

if I could do it with virtual hosts - it would be great!!!!

thanks
michael

>Michael Reutter wrote:
>> 
>> hi,
>> 
>> for testing a scenario:
>> my webserver (a single machine) has ONE name ("webserver"), but TWO IPs (10.0.0.1/2 - the DNS returns them rotational).
>> (in the future I should have two or three machines ...)
>> 
>> is it possible to let one apache run on port 8080 and the second on port 8090.
>> when a request goes to "10.0.0.1" it goes to port 8080
>> when a request goes to "10.0.0.2" it goes to port 8090
>
>Ummm... I think you're a bit mixed up about TCP/IP. Apache is passive,
>it listens for requests on defined IP addresses and port pairs. You can
>make apache listen to any address and port using the Listen directive:
>
>Listen 10.0.0.1:8080
><VirtualHost 10.0.0.1:8080>
>  VH directives...
>
>However, the default port for HTTP is port 80 so the browser (which is
>active) will send its request to port 80 - unless you want to put
>"http://webserver:8080/" in all links to your site.
>
>Note that since you are using different IP addresses, you can use the
>same port for both virtual hosts. Defining a different IP address AND
>port number for different VHs is overkill.
>
>If you want that:
>
>10.0.0.1:80 -> 10.0.0.1:8080
>
>then you need to do address translation *before* you hit apache. That
>means a firewall.
>
>Rgds,
>
>Owen Boyle.
>
>---------------------------------------------------------------------
>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: Re : Re: 2 httpds on 1 server

Posted by Owen Boyle <ob...@bourse.ch>.
Michael Reutter wrote:
> 
> hi Owen,
> 
> of course apache itself can't direct the request to a specific port - but using a firewall is a good idea!!!!
> 
> but what about virtual-hosts (so one httpd would be enough!!!):
> in the normal way you have many webs on one host (many names - one IP).
> all requests go to the same ip - but apache can distinguish between them, by looking at the "host"-header.
> 
> you mean it is possible to do it the other way??? (would be great)
> but how can apache distinguish between the requests?
> one request goes to "webserver" and IP 10.0.0.1 and the other one goes to "webserver" and IP 10.0.0.2 - IMO it would work, if the requests do not go to "webserver", but to the IP itself (using http://10.0.0.2 instead of http://webserver)

I'm a bit baffled about what you are trying to achieve. Do you one
servername in DNS which resolves randomly to one of two IP addresses and
each IP address leads to a different site?

Rgds,

Owen Boyle.

---------------------------------------------------------------------
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: Re : Re: 2 httpds on 1 server

Posted by Derek Conniffe <de...@rivertower.ie>.
On Tuesday 11 December 2001 10:05, you wrote:

> > hi Owen,
> 
> of course apache itself can't direct the request to a specific port - but
> using a firewall is a good idea!!!!
 

Apache can either redirect or proxy to individual ports - proxying will do 
this perfectly although sometimes you have to do a few funny things with the 
hosts file to allow name based virtual hosting with redirecting to work 
within the one box - but it works and it works well (except that log files 
get a bit messed around).

A firewall will also do the job fine but, perhaps, its a bit of an overkill.

> but what about virtual-hosts (so one httpd would be enough!!!):
> in the normal way you have many webs on one host (many names - one IP).
> all requests go to the same ip - but apache can distinguish between them,
> by looking at the "host"-header.
 
> you mean it is possible to do it the other way??? (would be great)
> but how can apache distinguish between the requests?
Check out the apache faq or the httpd.conf.default - it goes through the 
Listen and NameVirtualHost directives.

Derek

> one request goes to "webserver" and IP 10.0.0.1 and the other one goes to
> "webserver" and IP 10.0.0.2 - IMO it would work, if the requests do not go
> to "webserver", but to the IP itself (using http://10.0.0.2 instead of
> http://webserver)
 
> if I could do it with virtual hosts - it would be great!!!!
> 
> thanks
> michael
> 
>
> >Michael Reutter wrote:
> >
> >> 
> >> hi,
> >> 
> >> for testing a scenario:
> >> my webserver (a single machine) has ONE name ("webserver"), but TWO IPs
> >> (10.0.0.1/2 - the DNS returns them rotational).
 (in the future I should
> >> have two or three machines ...)
> >> 
> >> is it possible to let one apache run on port 8080 and the second on port
> >> 8090.
 when a request goes to "10.0.0.1" it goes to port 8080
> >> when a request goes to "10.0.0.2" it goes to port 8090
> >
> >
> >Ummm... I think you're a bit mixed up about TCP/IP. Apache is passive,
> >it listens for requests on defined IP addresses and port pairs. You can
> >make apache listen to any address and port using the Listen directive:
> >
> >Listen 10.0.0.1:8080
> ><VirtualHost 10.0.0.1:8080>
> >  VH directives...
> >
> >However, the default port for HTTP is port 80 so the browser (which is
> >active) will send its request to port 80 - unless you want to put
> >"http://webserver:8080/" in all links to your site.
> >
> >Note that since you are using different IP addresses, you can use the
> >same port for both virtual hosts. Defining a different IP address AND
> >port number for different VHs is overkill.
> >
> >If you want that:
> >
> >10.0.0.1:80 -> 10.0.0.1:8080
> >
> >then you need to do address translation *before* you hit apache. That
> >means a firewall.
> >
> >Rgds,
> >
> >Owen Boyle.
> >
> >---------------------------------------------------------------------
> >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
> >

----------------------------------------
Content-Type: text/plain; charset="us-ascii"; name="Attachment: 1"
Content-Transfer-Encoding: 7bit
Content-Description: 
----------------------------------------

---------------------------------------------------------------------
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