httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Karakashian" <>
Subject [users@httpd] Reverse Proxying Questions
Date Sun, 03 Aug 2003 16:04:42 GMT
I have a few questions about using Apache as a reverse proxy.  I've dug
through the docs and mailing lists and have picked up "snippets" of how to
do this, but it's still not working for me.  I'm hoping with everyone's help
I can a) get it working b) create a howto for others who might be trying to
do what I am.    As I realize this is probably a very isolated need, I
didn't expect to find and step-by-steps.  However, I'm sure others will want
to do this, so if I can help 'em out, so much the better!

So, let's get to the nitty gritty.  Apache is setup on my Linux firewall
which has a dynamic IP provided by my cable modem.  I have a few web
services that run on different machines, and different ports, and I would
like to be able to access them all through a single port.  This is mainly
because our corporate IT guys at work block all outgoing traffic except for
"approved ports" and also because I don't want to punch many, many holes
through the firewall.  The final reason would be to provide SSL for services
that don't support it, if possible.  I've read on the lists that this last
one doesn't seem to work too well, so I'm willing to use stunnel
( if it'll be better.  I'd still need Apache to proxy the
requests, though.

Here's the machines we're talking about:

1.  Firewall.  Running Linux, external IP is dynamic, internal is
It also runs webmin on port 10000, but that's currently only accessible
interally.  I'd like it to be accessible externally, on a different
hostname, and using SSL.
2.  Webserver. Running W2K and IIS.  My primary webserver, its interal IP is  On top of being "", it also redirects to virtual
hosts based on host headers.  For example, I have where
lives Squirrelmail, myPHPAdmin, and a few other admin scripts.   This
machine also runs some home automation software which has its own built-in
webserver running on port 8000.
3.  Linux box.  Running Apache, mostly used for testing PHP stuff.  Its IP
4.  Media server.  Lives in my living room, runs Windows & Showshifter
(  I run a program called WebShifter on port 9000 that
allows me to schedule Showshifter to record TV programs.  Its IP is

I have a domain name that I use (we'll call it and have
dynamic DNS services provided by TZO.  The goal is the following: to provide
access to all of those machines by changing the hostname.  So:

Connecting to will give me the main pages off the
Connecting to will give me the webmin pages on the
firewall, but over SSL.
Connecting to will give me the home automation
pages running on machine #2, port 8000.  Again, over SSL as this webserver
doesn't support it.
Connecting to will give me SSL access to each of the
web services provided by machine #2 on the alternate hostname.  These are
subdivided by,, etc.
Connecting to will take me to the Linux box.

What I've done is pulled all the relevent portions of my httpd.conf, and
will ask specific questions:

Below is the list of modules that are in the auto-generated httpd.conf.
Notice I've added the mod_proxy stuff at the end.  Since this apache is
going to act as a reverse proxy only, which of the others do I really need?

LoadModule access_module modules/
LoadModule auth_module modules/
LoadModule auth_anon_module modules/
LoadModule auth_dbm_module modules/
LoadModule auth_digest_module modules/
LoadModule ext_filter_module modules/
LoadModule include_module modules/
LoadModule log_config_module modules/
LoadModule env_module modules/
LoadModule mime_magic_module modules/
LoadModule cern_meta_module modules/
LoadModule expires_module modules/
LoadModule headers_module modules/
LoadModule usertrack_module modules/
LoadModule unique_id_module modules/
LoadModule setenvif_module modules/
LoadModule mime_module modules/
LoadModule dav_module modules/
LoadModule status_module modules/
LoadModule autoindex_module modules/
LoadModule asis_module modules/
LoadModule info_module modules/
LoadModule cgi_module modules/
LoadModule dav_fs_module modules/
LoadModule vhost_alias_module modules/
LoadModule negotiation_module modules/
LoadModule dir_module modules/
LoadModule imap_module modules/
LoadModule actions_module modules/
LoadModule speling_module modules/
LoadModule userdir_module modules/
LoadModule alias_module modules/
LoadModule proxy_module modules/
LoadModule proxy_connect_module modules/
LoadModule proxy_http_module modules/
LoadModule proxy_ftp_module modules/

Do I add only the "main" server name (probably, or do I
add a line for each (admin. webmin., etc)?


Similar question to above.  Does this stay as off?  I'm assuming it would.

UseCanonicalName Off

Virtual Hosts, I've seen some indication in the forums that I should be
using virtual hosts to describe each hostname I want to proxy.  Is this
correct, or does it apply only when Apache's serving all the pages?  Such

NameVirtualHost *

<VirtualHost *>
    DocumentRoot /opt/apache/docs/
    ErrorLog logs/
    CustomLog logs/ common

<VirtualHost *>
    DocumentRoot /opt/apache/docs/
    ErrorLog logs/
    CustomLog logs/ common


Finally, the proxy stuff.  My firewall uses its own internal DNS, so
redirecting to the below hostnames resolves to their internal IPs. I wanted
to put the real hostnames in, since for some of the sites, it's host-header
dependant.  I assume Apache will pass those to the proxied server.  For
those that it isn't necessary (the home automation server doesn't care about
host-headers, for example), I  just put in the IP.

ProxyRequests Off

<Proxy *>

Order deny,allow
Allow from all



I hope this all made sense.   I'm relatively new to this setup, but it's
what I've been looking for for YEARS! :)

Thanks in advance for any help.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message