httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael A Nachbaur <>
Subject [users@httpd] Proxying to a CGI gives 404
Date Wed, 26 Mar 2003 10:26:23 GMT
Hello all,  I apologize if this is an RTFM question, but I haven't been able 
to find any solution to this problem yet.  (Sorry if this gets here twice, my 
mail server hiccuped)

I am using a Mandrake Apache/mod_perl proxy server configuration, along with 
some very tweaked mod_rewrite rules to get mass virtual hosting working.  I 
have successfully gotten my rewrite rules established to do virtual hosting, 
and am configuring virtual-hosted AWStats to provide secure statistics 
information for my customers.  I'm running "" in the mod_perl 
server, with everything else in the plain Apache.

My mod_rewrite proxy rules are working beautifully, but when I pass 
query_string arguments to the CGI (e.g. /cgi-bin/ I 
get a 404, and the query is never sent to the mod_perl server.

Here is the relevant section of my configuration file:

    DocumentRoot     /opt/awstats/wwwroot
    UseCanonicalName off

    <IfDefine !ISPERL>
        RewriteEngine on
        RewriteMap    lc  int:tolower
        RewriteCond   ${lc:%{HTTP_HOST}}   ^stats\.((.).+)$
        RewriteRule   ^proxy:.*  -  [F]
        RewriteRule   ^.*(\/cgi-bin\/[^\?]*).*$  http://%{HTTP_HOST}:8200$1  
        RewriteRule ^(/?)$  /cgi-bin/  [L,R]

<IfDefine ISPERL>
    Alias /cgi-bin/ /opt/awstats/wwwroot/cgi-bin/
<Directory /opt/awstats/wwwroot/cgi-bin>
    Options ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all

    AuthName "Website Statistics"
    AuthType Basic
    Require valid-user

    <IfDefine ISPERL>
        SetHandler perl-script
        PerlModule SysAdmin::Apache::AWStatsAuthHandler
        PerlAuthenHandler SysAdmin::Apache::AWStatsAuthHandler
        PerlHandler Apache::Registry
        PerlSendHeader On

I have a directive in the mod_perl server that defines "ISPERL" so I can use 
the same configuration file for both servers (as per the default Mandrake 
install) but allowing me to include directives that will only work on one 
server or the other.

When I request /cgi-bin/ the page is proxied to the mod_perl server.  
When I add a query_string to the URL, I get the following:

==> /var/log/httpd/access_log <== - - [24/Mar/2003:10:53:42 -0800] "GET 
/cgi-bin/ HTTP/1.1" 404 330 
"" "Mozilla/5.0 (compatible; 
Konqueror/3.1; Linux)" -

==> /var/log/httpd/error_log <==
[Mon Mar 24 10:53:42 2003] [error] [client] File does not 

I know a bit about mod_rewrite, enough to do basic URL rewriting and to do 
some fancy mass virtual hosting, but nothing that can solve this problem.  
Any ideas?

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