You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by sam newman <sa...@fdnassociates.com> on 2002/10/25 12:27:39 UTC
[users@httpd] Redirection to a local webserver
Hi all,
I have a (relatively) quick question regarding redirecting requests with
Apache. We have several machines hosting webpages, currently hidden
behind a dedicated (smoothwall) firewall machine. Our main webserver
(Bob) runs Apache, and is setup with a few VirutalHosts. We also host
our main site on a dedicated machine (Fred). Currently Bob redirects any
traffic for the main website using a port redirect in a normal
VirtualHost directive:
<VirtualHost OurIP>
ServerName www.mainwebsite.com
ErrorLog /usr/local/httpd/weblogs/www.mainwebsite.com-error_log
CustomLog /usr/local/httpd/weblogs/www.mainwebsite.com-common_log common
TransferLog /usr/local/httpd/weblogs/www.mainwebsite.com-access_log
#Redirect all traffic to port :8080. This goes back to the client
browser and
#on to the firewall
Redirect /index.html http://www.mainwebsite.com:8080
</VirtualHost>
The important line here is the redirect - traffic is diverted back to
the firewall, this time on port 8080. The Smoothwall firewall has a port
redirect setup to send traffic on port :8080 to Fred.
Now the question. I don't really like using the port redirect - the
request gets sent back to the client which then makes another
connection, this time on a new port. So all traffic to our main website
has an overhead. Also, some firewalls will block outgoing access to
certain ports, meaning some potential customers might not be able to see
the site. What I would really want to do is to direct to a locally
available webserver (e.g. a known IP of a machine available behind the
firewall) without generating a second request from the client brwoser -
is their an alternative to redirect that can do this?
I have read over every mod_rewrite, alias and redirect
manual/tutorial/guide I could find, but they either redirect to a
locally available directory (Freds directory structure is not available
to Bob) or make another request via the firewall, or get me so confused
that I almost wish I was debugging obfuscated perl programs again....
Thanks in advance,
Sam Newman
sam.newman@fdnassociates.com
---------------------------------------------------------------------
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] Redirection to a local webserver
Posted by Rich Bowen <rb...@rcbowen.com>.
On Fri, 25 Oct 2002, sam newman wrote:
> The important line here is the redirect - traffic is diverted back to
> the firewall, this time on port 8080. The Smoothwall firewall has a port
> redirect setup to send traffic on port :8080 to Fred.
> Now the question. I don't really like using the port redirect - the
> request gets sent back to the client which then makes another
> connection, this time on a new port. So all traffic to our main website
> has an overhead. Also, some firewalls will block outgoing access to
> certain ports, meaning some potential customers might not be able to see
> the site. What I would really want to do is to direct to a locally
> available webserver (e.g. a known IP of a machine available behind the
> firewall) without generating a second request from the client brwoser -
> is their an alternative to redirect that can do this?
What you are looking for is (probably) mod_proxy. Give Bob permission to
make connections through the firewall to Fred, and use mod_proxy to have
Bob make the requests directly to Fred, returning the content to the
client. See http://httpd.apache.org/docs/mod/mod_proxy.html for all the
details on mod_proxy, and come back if there is any confusion.
--
rbowen@apache.org
http://coopermcgregor.com/training/ - Apache Training
http://apachecon.com/ - Come to ApacheCon!
---------------------------------------------------------------------
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