httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@conman.org (Sean Conner)
Subject [users@httpd] Odd interaction between mod-rewrite and mod-cgi
Date Sat, 09 Jul 2005 07:26:09 GMT

  I have a few CGI scripts, written in C (legacy stuff that I don't wish to
rewrite if possible) that work fine under Apache 1.3.  When moved to Apache
2.0.54 (latest version) they still work, but Apache seems to include
additional output at the bottom of the page:

	HTTP/1.1 200 OK Date: Sat, 09 Jul 2005 07:14:04 GMT Server:
	Apache/2.0.54 (Unix) DAV/2 Content-Length: 0 Connection: close
	Content-Type: text/plain

  Now, the setup.  It's a stock install of Apache 2.0.54 from source, using
the pre-fork MPM with all the modules installed as DSOs.  CGIs with an
extention of .cgi can be run from anywhere, and there's one virtual host
defined:

	<VirtualHost 66.252.224.11>
	  ServerName    work.flummux.org
	  ServerAdmin   sean@conman.org
	  DocumentRoot  /home/spc/blog/htdocs
	  CustomLog     logs/work.flummux.org combined
	  <Directory /home/spc/blog/htdocs>
	    AllowOverride       All
	    Options             All
	  </Directory>
	</VirtualHost>

  The scripts (there are two, one's just purely for testing) that are
non-parsed headers CGIs, and indeed, if you go to them directly:

	http://work.flummux.org/nph-raw.cgi/test
	http://work.flummux.org/nph-blog.cgi/2005/07/08.1

  you can see they work fine.  Now, I also have a .htacess file with some
mod-rewrite rules:

	RewriteEngine on
	RewriteBase   /

	RewriteRule   ^([0-9][0-9])(.*) nph-blog.cgi/$1$2 [L]
	RewriteRule   ^(test)(.*)       nph-raw.cgi/$1$2  [L]
	RewriteRule   ^(foo)(.*)        nph-raw.cgi?$1$2  [L]

  Hit the following URLs:

	http://work.flummux.org/2005/07/08.1
	http://work.flummux.org/test
	http://work.flummux.org/foo

  And you'll see the spurious output at the bottom of the pages (at least in
Firefox and Lynx---the output appears after the </HTML> tag so some browsers
may ignore it, but it's there).  I did some searches and could not find any
bugs close to this behavior in Apache 2.0 (this all works fine under Apache
1.3, also the main page at http://work.flummux.org/ is a static page so
that's why there's no spurious output there).  And nothing appears in the
error log.

  Have I actually found a big in Apache 2.0.54?

  -spc



  

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