httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael A Nachbaur <m...@nachbaur.com>
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 "awstats.pl" 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/awstats.pl?options=full) I 
get a 404, and the query is never sent to the mod_perl server.

Here is the relevant section of my configuration file:

<VirtualHost 192.168.111.241>
    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  
[NS,P]
        RewriteRule ^(/?)$  /cgi-bin/awstats.pl  [L,R]
    </IfDefine>
</VirtualHost>

<IfDefine ISPERL>
    Alias /cgi-bin/ /opt/awstats/wwwroot/cgi-bin/
</IfDefine>
<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
    </IfDefine>
</Directory>

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/awstats.pl 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 <==
192.168.111.107 - - [24/Mar/2003:10:53:42 -0800] "GET 
/cgi-bin/awstats.pl?output=urldetail HTTP/1.1" 404 330 
"http://stats.testdomain.com/cgi-bin/awstats.pl" "Mozilla/5.0 (compatible; 
Konqueror/3.1; Linux)" -

==> /var/log/httpd/error_log <==
[Mon Mar 24 10:53:42 2003] [error] [client 192.168.111.107] File does not 
exist: 
proxy:http://stats.testdomain.com:8200/cgi-bin/awstats.pl?output=urldetail


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: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


Mime
View raw message