You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by John Iliffe <jo...@iliffe.ca> on 2010/06/06 22:30:53 UTC
[users@httpd] [Fwd: Reverse Proxy Configuration]
I sent the following request for help a couple of weeks back but so far
no response. Maybe I didn't make the actual question clear :-(
Anyhow, I have done quite a bit of experimentation since with the
following non-results.
What I'm trying to do:
I have a mail server with a web interface; to avoid conflict with Apache
HTTP I have it on port 8080. That port is blocked by the firewall so I
am trying to proxy it to HTTP/80 through Apache. Internally, the mail
server is reached as: http://192.168.1.12:8080 and works OK.
I read the Apache docs and also:
http://www.apachetutor.org/admin/reverseproxies
and created the following config file:
NameVirtualHost *:80
# Default host
<VirtualHost *:80>
ServerName www.xxxxx.ca
DocumentRoot /httpd/xxxxx
ProxyRequests off
ProxyPass /mymail/* !
ProxyPass /mymail/ http://192.168.1.12:8080
ProxyPassReverse /mymail/ http://192.168.1.12:8080
ProxyHTMLEnable On
<Location /mymail/ >
ProxyHTMLURLMap / /mymail/
</Location>
</VirtualHost>
I now have two (different) problems:
1. If I delete the lines from <ProxyHTMLEnable On> to the final
</Location>, everything works to bring up the first page of the mail
server but any further action is precluded because all references are to
port 8080 which is blocked by the firewall. (Internally, this works
fine, up to a point). Subsequent requests lead to:
----------------------------
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /mymail/kookie.
Reason: DNS lookup failure for: 192.168.1.12:7080kookie
-----------------------------
"kookie" can be any of a large list of html pages, php pages, or
subdirectory/html pages as defined internally by the e-mail system. The
proxy seems to be using the wrong document root but I can't prove that.
2. If I leave these lines in, as I suspect I have to to resolve problem
#1, apachectl -S throws errors on both ProxyHTMLEnable and
ProxyHTMLURLMap and asks if I spelled the names wrong.
apachectl -l gives:
Compiled in modules:
mod_proxy.c
mod_proxy_connect.c
mod_proxy_ftp.c
mod_proxy_http.c
mod_proxy_scgi.c
mod_proxy_ajp.c
mod_proxy_balancer.c
So, obviously I missed something. Does the above suggest anything?
Regards, and thanks in advance,
John
---------------------------------------------------------------------
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] [Fwd: Reverse Proxy Configuration]
Posted by Eric Covener <co...@gmail.com>.
> 2. If I leave these lines in, as I suspect I have to to resolve problem
> #1, apachectl -S throws errors on both ProxyHTMLEnable and
> ProxyHTMLURLMap and asks if I spelled the names wrong.
>
> apachectl -l gives:
>
> Compiled in modules:
> mod_proxy.c
> mod_proxy_connect.c
> mod_proxy_ftp.c
> mod_proxy_http.c
> mod_proxy_scgi.c
> mod_proxy_ajp.c
> mod_proxy_balancer.c
http://apache.webthing.com/mod_proxy_html/
--
Eric Covener
covener@gmail.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] [Fwd: Reverse Proxy Configuration]
Posted by John Iliffe <jo...@iliffe.ca>.
On Tue, 2010-08-06 at 10:54 +0200, Krist van Besien wrote:
> On Tue, Jun 8, 2010 at 4:34 AM, John Iliffe <jo...@iliffe.ca> wrote:
>
> > If I try to use either of the ProxyHTMLEnable On or ProxyHTMLURLMap
> > directives apachectl -S still flags them as errors.
>
> You have proxy_html 3.0.1. ProxyHTMLEnable is new to 3.1 ...
> Have a look here:
> http://apache.webthing.com/mod_proxy_html30/
>
> Also pay attention to your URL substitutions. You need to substitute /
> with /mymail/. Always keep the slash...
>
> Krist
>
Thanks you Krist, mostly works now, although I have some problems with
the underlying mail server permissions not related to Apache.
FYI, if you enter the mod-proxy_html website through this URL:
http://apache.webthing.com/mod_proxy_html30/
the the Availability section gives the latest version as
--------------------------------------------------
Current Version (3.0.1) as bzipped tar (signature) and as zipfile
(signature). 3.0.1 fixes a bug in 3.0.0 that could cause it to segfault
if you fail to read the README and omit proxy_html.conf entirely.
--------------------------------------------------
If you enter the web site using:
http://apache.webthing.com/mod_proxy_html/
then the Availability section gives the current version as
---------------------------------------------------
Current Version (3.1.2) as bzipped tar (signature) and as zipfile
(signature).
---------------------------------------------------
Seems to be a synchronization problem between the two entry points which
is how I got muddled up.
If you know who runs the site you might point that out to them.
Regards, and thanks again.
John
---------------------------------------------------------------------
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] [Fwd: Reverse Proxy Configuration]
Posted by Krist van Besien <kr...@gmail.com>.
On Tue, Jun 8, 2010 at 4:34 AM, John Iliffe <jo...@iliffe.ca> wrote:
> If I try to use either of the ProxyHTMLEnable On or ProxyHTMLURLMap
> directives apachectl -S still flags them as errors.
You have proxy_html 3.0.1. ProxyHTMLEnable is new to 3.1 ...
Have a look here:
http://apache.webthing.com/mod_proxy_html30/
Also pay attention to your URL substitutions. You need to substitute /
with /mymail/. Always keep the slash...
Krist
--
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?
---------------------------------------------------------------------
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] [Fwd: Reverse Proxy Configuration]
Posted by John Iliffe <jo...@iliffe.ca>.
On Mon, 2010-07-06 at 11:02 +0100, Tom Evans wrote:
> On Sun, Jun 6, 2010 at 9:30 PM, John Iliffe <jo...@iliffe.ca> wrote:
> > I sent the following request for help a couple of weeks back but so far
> > no response. Maybe I didn't make the actual question clear :-(
> > Anyhow, I have done quite a bit of experimentation since with the
> > following non-results.
> >
> > What I'm trying to do:
> >
> > I have a mail server with a web interface; to avoid conflict with Apache
> > HTTP I have it on port 8080. That port is blocked by the firewall so I
> > am trying to proxy it to HTTP/80 through Apache. Internally, the mail
> > server is reached as: http://192.168.1.12:8080 and works OK.
> >
> > I read the Apache docs and also:
> > http://www.apachetutor.org/admin/reverseproxies
> > and created the following config file:
> >
> > NameVirtualHost *:80
> >
> > # Default host
> > <VirtualHost *:80>
> > ServerName www.xxxxx.ca
> > DocumentRoot /httpd/xxxxx
> > ProxyRequests off
> > ProxyPass /mymail/* !
> > ProxyPass /mymail/ http://192.168.1.12:8080
> > ProxyPassReverse /mymail/ http://192.168.1.12:8080
>
> I'm not sure what you are trying to do here with the
> ProxyPass /mymail/* !
>
> This says not to proxy (literally) '/mymail/*'. If you didn't want to
> proxy anything below '/mymail/', the correct syntax is:
> ProxyPAss /mymail/ !
> although, given you other directives, why you have this one is a mystery.
>
> Also, your ProxyPass{,Reverse} directives aren't right:
>
> Proxy /mymail/ http://192.168.1..12:8080
>
> This says 'when path begins '/mymail/', substitute '/mymail/' with
> 'http://192.168.1..12:8080' and proxy to the resultant URL.
> When you have a requested URI like '/mymail/kookie', it will attempt
> to proxy to 'http://192.168.1..12:8080kookie' - this is what you asked
> it to do.
>
> A simple rule I follow is to always keep the trailing '/' matching on
> both arguments of ProxyPass and ProxyPassReverse - if one side has a
> trailing '/', so should the other.
>
> Cheers
>
> Tom
>
First, thanks for both Tom and Eric for the prompt responses.
I have followed Eric's note and installed mod_proxy_html (don't know how
I missed that!) I included the proxy_html.conf script that comes with
the module in the conf/extras directory and Included it in the
httpd.conf script. libxml2 is present on the system as noted in the
tutorial and I skipped mod_xml2enc because I don't have an
internationalization problem. That doesn't seem to be the issue at the
moment.
The startup log now says:
[Mon Jun 07 21:55:32 2010] [notice] caught SIGTERM, shutting down
[Mon Jun 07 21:55:43 2010] [notice] Apache/2.2.14 (Unix) mod_ssl/2.2.14
OpenSSL/0.9.8e-fips-rhel5 PHP/5.3.1 proxy_html/3.0.1 configured --
resuming normal operations
so mod_proxy_html is really loaded, BUT apachectl -l does NOT show
mod_proxy_html as being present. (Oddly, there is a similar error in
that apachectl shows mod_status as compiled in but the apachectl status
and fullstatus commands don't work).
If I try to use either of the ProxyHTMLEnable On or ProxyHTMLURLMap
directives apachectl -S still flags them as errors. The relevant part
of the httpd.conf file is:
# Default host
<VirtualHost *:80>
ServerName www.xxxxxxx.ca
DocumentRoot /xxxxxx
ProxyRequests off
ProxyPass /mymail http://192.168.1.12:8080
ProxyPassReverse /mymail http://192.168.1.12:8080
ProxyHTMLEnable On
<Location /mymail >
ProxyHTMLURLMap / /mymail
</Location>
</VirtualHost>
I followed your advice and the ProxyPass/ProxyPassReverse directives now
all have no trailing / and the initial screen comes up properly. Just
links fail due to the problems noted above.
Tom: I deleted the [ ProxyPass /mymail/* ! ] command. What I was
trying to do was prevent anyone from bypassing the login routine and
trolling for user mail directories on, for example: /mymail/mail/george.
This isn't a big issue, I can move the mail somewhere else.
John
---------------------------------------------------------------------
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] [Fwd: Reverse Proxy Configuration]
Posted by Tom Evans <te...@googlemail.com>.
On Sun, Jun 6, 2010 at 9:30 PM, John Iliffe <jo...@iliffe.ca> wrote:
> I sent the following request for help a couple of weeks back but so far
> no response. Maybe I didn't make the actual question clear :-(
> Anyhow, I have done quite a bit of experimentation since with the
> following non-results.
>
> What I'm trying to do:
>
> I have a mail server with a web interface; to avoid conflict with Apache
> HTTP I have it on port 8080. That port is blocked by the firewall so I
> am trying to proxy it to HTTP/80 through Apache. Internally, the mail
> server is reached as: http://192.168.1.12:8080 and works OK.
>
> I read the Apache docs and also:
> http://www.apachetutor.org/admin/reverseproxies
> and created the following config file:
>
> NameVirtualHost *:80
>
> # Default host
> <VirtualHost *:80>
> ServerName www.xxxxx.ca
> DocumentRoot /httpd/xxxxx
> ProxyRequests off
> ProxyPass /mymail/* !
> ProxyPass /mymail/ http://192.168.1.12:8080
> ProxyPassReverse /mymail/ http://192.168.1.12:8080
I'm not sure what you are trying to do here with the
ProxyPass /mymail/* !
This says not to proxy (literally) '/mymail/*'. If you didn't want to
proxy anything below '/mymail/', the correct syntax is:
ProxyPAss /mymail/ !
although, given you other directives, why you have this one is a mystery.
Also, your ProxyPass{,Reverse} directives aren't right:
Proxy /mymail/ http://192.168.1..12:8080
This says 'when path begins '/mymail/', substitute '/mymail/' with
'http://192.168.1..12:8080' and proxy to the resultant URL.
When you have a requested URI like '/mymail/kookie', it will attempt
to proxy to 'http://192.168.1..12:8080kookie' - this is what you asked
it to do.
A simple rule I follow is to always keep the trailing '/' matching on
both arguments of ProxyPass and ProxyPassReverse - if one side has a
trailing '/', so should the other.
Cheers
Tom
---------------------------------------------------------------------
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