You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jeremie Le Hen <je...@le-hen.org> on 2007/03/15 21:05:23 UTC
[users@httpd] Cannot use ServerName with a reverse proxy
Hi list,
I'm fiddling a bit with OpenBSD's default httpd(8) to create a very
simple reverse proxy. Unfortunately, I'm experiencing a weird
behaviour when I use the ServerName directive.
The configuration file is straightforward:
% ServerType standalone
% ServerRoot "/var/www"
% PidFile logs/httpd.pid
% ScoreBoardFile logs/apache_runtime_status
%
% Listen 10.0.40.100:80
%
% User www
% Group www
% Port 80
% ServerAdmin hostmaster@jeremie.vmware
% ServerName proxy.jeremie.vmware
%
% UseCanonicalName On
%
% LogLevel debug
%
% LogFormat "%h %l %u %t \"%r\" %>s %b" common
% CustomLog logs/access_log common
%
% LoadModule proxy_module /usr/lib/apache/modules/libproxy.so
% <IfModule mod_proxy.c>
% ProxyPass / http://www.jeremie.vmware/
% ProxyPassReverse / http://www.jeremie.vmware/
% </IfModule>
When I comment out the ServerName directive, the reverse proxy works.
When ServerName is used, it doesn't work anymore and I get the
following error message in Firefox:
% Proxy Error
% The proxy server could not handle the request GET /.
%
% Reason: Host not found
DNS names are correctly set:
% tintin:/var/www/conf 223# host www.jeremie.vmware
% www.jeremie.vmware is an alias for haddock80.jeremie.vmware.
% haddock80.jeremie.vmware has address 10.0.80.200
% www.jeremie.vmware is an alias for haddock80.jeremie.vmware.
% www.jeremie.vmware is an alias for haddock80.jeremie.vmware.
%
% tintin:/var/www/conf 224# host proxy.jeremie.vmware
% proxy.jeremie.vmware is an alias for tintin40.jeremie.vmware.
% tintin40.jeremie.vmware has address 10.0.40.100
% proxy.jeremie.vmware is an alias for tintin40.jeremie.vmware.
% proxy.jeremie.vmware is an alias for tintin40.jeremie.vmware.
As you can see, I asked for debug message in ErrorLog, but I can't
see anything relevant. The only line issued when the query is made
is :
% [Thu Mar 15 18:40:40 2007] [debug] proxy_cache.c(0): No CacheRoot,
% so no caching. Declining.
Though this may appear quite off-topic, I tried to provide
httpd.conf(5) with a CacheRoot directive, but this doesn't resolve my
problem... Instead I have the following messages:
% [Thu Mar 15 18:42:31 2007] [debug] proxy_cache.c(0): Request for
% http://www.jeremie.vmware/, pragma_req=(unset), ims=0
% [Thu Mar 15 18:42:31 2007] [debug] proxy_util.c(0): File
% /proxy/K/A/I/_dgyuc5xAy6ph@OoPlA not found
% [Thu Mar 15 18:42:31 2007] [debug] proxy_cache.c(0): Local copy
% not present or expired. Declining.
Any clue will be welcome!
Thank you.
Regards,
--
Jeremie Le Hen
< jeremie at le-hen dot org >< ttz at chchile dot 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
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Cannot use ServerName with a reverse proxy
Posted by Jeremie Le Hen <je...@le-hen.org>.
Hi Joshua,
On Fri, Mar 16, 2007 at 09:29:30AM -0400, Joshua Slive wrote:
> I don't see any direct way this could happen. Some thoughts:
>
> 1. OpenBSD's "apache" is somewhat-heavily patched based on an obsolete
> version and therefore might do any number of things different from
> regular apache. So you might need to consult with OpenBSD lists for
> problems with that server.
I can indeed confirm this problem is OpenBSD-centric. I've tried with
the latest release of Apache 1.3 and it works correctly.
Thank you.
Best regards,
--
Jeremie Le Hen
< jeremie at le-hen dot org >< ttz at chchile dot 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
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Cannot use ServerName with a reverse proxy
Posted by Joshua Slive <jo...@slive.ca>.
On 3/16/07, Jeremie Le Hen <je...@le-hen.org> wrote:
> Hi list,
>
> my previous email might be to big and nobody has had enough courage to
> read it :-).
>
> So, I will try to be more compact here:
>
> In Apache 1.3.29, how could the ServerName directive prevent a
> reverse-proxy from functionning and instead show the message:
>
> % Proxy Error
> % The proxy server could not handle the request GET /.
> %
> % Reason: Host not found
I don't see any direct way this could happen. Some thoughts:
1. OpenBSD's "apache" is somewhat-heavily patched based on an obsolete
version and therefore might do any number of things different from
regular apache. So you might need to consult with OpenBSD lists for
problems with that server.
2. Try tracing the communication on the line and see what is going on.
Exactly what host is the proxy requesting? Is there a redirect
involved?
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
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Cannot use ServerName with a reverse proxy
Posted by Jeremie Le Hen <je...@le-hen.org>.
Hi list,
my previous email might be to big and nobody has had enough courage to
read it :-).
So, I will try to be more compact here:
In Apache 1.3.29, how could the ServerName directive prevent a
reverse-proxy from functionning and instead show the message:
% Proxy Error
% The proxy server could not handle the request GET /.
%
% Reason: Host not found
Thank you,
Regards
On Thu, Mar 15, 2007 at 09:05:23PM +0100, Jeremie Le Hen wrote:
> Hi list,
>
> I'm fiddling a bit with OpenBSD's default httpd(8) to create a very
> simple reverse proxy. Unfortunately, I'm experiencing a weird
> behaviour when I use the ServerName directive.
>
> The configuration file is straightforward:
> % ServerType standalone
> % ServerRoot "/var/www"
> % PidFile logs/httpd.pid
> % ScoreBoardFile logs/apache_runtime_status
> %
> % Listen 10.0.40.100:80
> %
> % User www
> % Group www
> % Port 80
> % ServerAdmin hostmaster@jeremie.vmware
> % ServerName proxy.jeremie.vmware
> %
> % UseCanonicalName On
> %
> % LogLevel debug
> %
> % LogFormat "%h %l %u %t \"%r\" %>s %b" common
> % CustomLog logs/access_log common
> %
> % LoadModule proxy_module /usr/lib/apache/modules/libproxy.so
> % <IfModule mod_proxy.c>
> % ProxyPass / http://www.jeremie.vmware/
> % ProxyPassReverse / http://www.jeremie.vmware/
> % </IfModule>
>
> When I comment out the ServerName directive, the reverse proxy works.
>
> When ServerName is used, it doesn't work anymore and I get the
> following error message in Firefox:
> % Proxy Error
> % The proxy server could not handle the request GET /.
> %
> % Reason: Host not found
>
> DNS names are correctly set:
> % tintin:/var/www/conf 223# host www.jeremie.vmware
> % www.jeremie.vmware is an alias for haddock80.jeremie.vmware.
> % haddock80.jeremie.vmware has address 10.0.80.200
> % www.jeremie.vmware is an alias for haddock80.jeremie.vmware.
> % www.jeremie.vmware is an alias for haddock80.jeremie.vmware.
> %
> % tintin:/var/www/conf 224# host proxy.jeremie.vmware
> % proxy.jeremie.vmware is an alias for tintin40.jeremie.vmware.
> % tintin40.jeremie.vmware has address 10.0.40.100
> % proxy.jeremie.vmware is an alias for tintin40.jeremie.vmware.
> % proxy.jeremie.vmware is an alias for tintin40.jeremie.vmware.
>
>
> As you can see, I asked for debug message in ErrorLog, but I can't
> see anything relevant. The only line issued when the query is made
> is :
> % [Thu Mar 15 18:40:40 2007] [debug] proxy_cache.c(0): No CacheRoot,
> % so no caching. Declining.
>
> Though this may appear quite off-topic, I tried to provide
> httpd.conf(5) with a CacheRoot directive, but this doesn't resolve my
> problem... Instead I have the following messages:
> % [Thu Mar 15 18:42:31 2007] [debug] proxy_cache.c(0): Request for
> % http://www.jeremie.vmware/, pragma_req=(unset), ims=0
> % [Thu Mar 15 18:42:31 2007] [debug] proxy_util.c(0): File
> % /proxy/K/A/I/_dgyuc5xAy6ph@OoPlA not found
> % [Thu Mar 15 18:42:31 2007] [debug] proxy_cache.c(0): Local copy
> % not present or expired. Declining.
>
>
> Any clue will be welcome!
> Thank you.
> Regards,
> --
> Jeremie Le Hen
> < jeremie at le-hen dot org >< ttz at chchile dot 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
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
--
Jeremie Le Hen
< jeremie at le-hen dot org >< ttz at chchile dot 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
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org