You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Dmitri Tikhonov <dm...@netilla.com> on 2004/07/07 21:29:41 UTC
Proxying DirectoryIndex files.
Dear list,
I have set up a dual apache system -- a front-end and a back-end that
runs CGI scripts. I wanted to proxy all .cgi files in a directory,
including index.cgi, which is set up by DirectoryIndex. I have the
following configuration:
DirectoryIndex index.cgi
<Location /index.cgi>
ProxyPass http://127.0.0.1:8088/index.cgi
</Location>
However, by default, this does not work:
[root@plato root]# telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
GET / HTTP/1.1
Host: plato
HTTP/1.1 404 Not Found
Date: Wed, 07 Jul 2004 19:26:14 GMT
Server: Apache
Content-Length: 198
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL / was not found on this server.</p>
</body></html>
I googled a bit and searched apache bug system and found these two links:
http://archive.apache.org/gnats/3596
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15112
Combining the patches provided in these two, I was able to get the
proxying to work.
The questions:
- what is the status of this problem?
- is this considered a problem? According to the first link, this
goes back five and a half years.
- what is to be fixed, mod_dir or mod_proxy?
My setup: Linux 2.4, Apache 2.0.46.
Thank you,
- Dmitri.
Re: Proxying DirectoryIndex files.
Posted by Dmitri Tikhonov <dm...@netilla.com>.
On Thu, Jul 08, 2004 at 12:23:52AM +0200, Andr? Malo wrote:
> * Graham Leggett <mi...@sharp.fm> wrote:
>
> > Dmitri Tikhonov wrote:
> >
> > > Sure, check out bug 29961; you are CC'd:
> > >
> > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=29961
> >
> > According to http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15112
> > this problem is fixed in v2.1 - can you try that version and confirm if
> > it's fixed? If so, then we can organise it gets into v2.0
>
> Or just the mod_dir patch provided in the report as link.
I applied the patch to a freshly downloaded apache 2.0.50, but something
does not add up:
[Wed Jul 07 18:52:45 2004] [debug] proxy_http.c(66): proxy: HTTP: canonicalising URL //localhost:8088/index.cgi
[Wed Jul 07 18:52:45 2004] [error] [client 127.0.0.1] File does not exist: proxy:http://localhost:8088/index.cgi
However, changing from
ap_internal_fast_redirect(rr, r);
to
ap_internal_redirect(rr->uri, r);
made it work, but not without a glitch (index.cgi is a redirector, and
thus returns no body): an error body is appended to the document and error
is logged:
[Wed Jul 07 18:56:44 2004] [error] [client 127.0.0.1] Attempt to serve directory: /var/www/
This error is generated by default_handler() in server/core.c; I am not
sure how the request gets there, as it is handled by mod_proxy.
- Dmitri.
Re: Proxying DirectoryIndex files.
Posted by André Malo <nd...@perlig.de>.
* Graham Leggett <mi...@sharp.fm> wrote:
> Dmitri Tikhonov wrote:
>
> > Sure, check out bug 29961; you are CC'd:
> >
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=29961
>
> According to http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15112
> this problem is fixed in v2.1 - can you try that version and confirm if
> it's fixed? If so, then we can organise it gets into v2.0
Or just the mod_dir patch provided in the report as link.
nd
--
"Solides und umfangreiches Buch"
-- aus einer Rezension
<http://pub.perlig.de/books.html#apache2>
Re: Proxying DirectoryIndex files.
Posted by Graham Leggett <mi...@sharp.fm>.
Dmitri Tikhonov wrote:
> Sure, check out bug 29961; you are CC'd:
>
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=29961
According to http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15112
this problem is fixed in v2.1 - can you try that version and confirm if
it's fixed? If so, then we can organise it gets into v2.0
Regards,
Graham
--
Re: Proxying DirectoryIndex files.
Posted by Dmitri Tikhonov <dm...@netilla.com>.
On Wed, Jul 07, 2004 at 11:24:12PM +0200, Graham Leggett wrote:
> Dmitri Tikhonov wrote:
>
> >Not according to the docs:
> > http://httpd.apache.org/docs-2.0/mod/mod_proxy.html#proxypass
> >
> >Including /index.cgi argument to ProxyPass directive inside <Location>
> >gives me a syntax error.
>
> Hmmm - you're right.
>
> Can you open/update the bug in bugzilla so that it can be kept track of?
Sure, check out bug 29961; you are CC'd:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=29961
Thanks,
- Dmitri.
Re: Proxying DirectoryIndex files.
Posted by Graham Leggett <mi...@sharp.fm>.
Dmitri Tikhonov wrote:
> Not according to the docs:
> http://httpd.apache.org/docs-2.0/mod/mod_proxy.html#proxypass
>
> Including /index.cgi argument to ProxyPass directive inside <Location>
> gives me a syntax error.
Hmmm - you're right.
Can you open/update the bug in bugzilla so that it can be kept track of?
Regards,
Graham
--
Re: Proxying DirectoryIndex files.
Posted by Dmitri Tikhonov <dm...@netilla.com>.
On Wed, Jul 07, 2004 at 11:11:15PM +0200, Graham Leggett wrote:
> Dmitri Tikhonov wrote:
>
> > DirectoryIndex index.cgi
> > <Location /index.cgi>
> > ProxyPass http://127.0.0.1:8088/index.cgi
> ^^^
> > </Location>
>
> The above looks wrong, it should be:
>
> ProxyPass /index.cgi http://127.0.0.1:8088/index.cgi
Not according to the docs:
http://httpd.apache.org/docs-2.0/mod/mod_proxy.html#proxypass
Including /index.cgi argument to ProxyPass directive inside <Location>
gives me a syntax error.
- Dmitri.
Re: Proxying DirectoryIndex files.
Posted by Graham Leggett <mi...@sharp.fm>.
Dmitri Tikhonov wrote:
> DirectoryIndex index.cgi
> <Location /index.cgi>
> ProxyPass http://127.0.0.1:8088/index.cgi
^^^
> </Location>
The above looks wrong, it should be:
ProxyPass /index.cgi http://127.0.0.1:8088/index.cgi
Regards,
Graham
--