Ticket #1655 (closed defect: fixed)

Opened 2 weeks ago

Last modified 2 weeks ago

mod_cgi beheaves incorectly in lighttpd.git/stbuehler

Reported by: tx Assigned to: jan
Priority: normal Milestone: 1.5.0
Component: mod_cgi Version: 1.5.x-svn
Severity: normal Keywords: mod_cgi git
Cc: Blocking:
Need Feedback: 0

Description

I'm using latest lighttpd.git branch stbuehler (with small modifications), and found that mod_cgi refuse to serve some of my requests - gives Bad Gateway. Compiled with gcc version 4.2.3 (Debian 4.2.3-1) Here is my configuration:

var.PID              = 17495
var.CWD              = "/root"
server.modules       = (
    "mod_indexfile",
    "mod_rewrite",
    "mod_access",
    "mod_uploadprogress",
    "mod_auth",
    "mod_setenv",
    "mod_accesslog",
    "mod_proxy_core",
    "mod_proxy_backend_fastcgi",
    "mod_cgi",
    "mod_dirlisting",
    "mod_staticfile",
    "mod_chunked",
    # 13
)
server.document-root = "/var/www/"
server.errorlog      = "/var/log/lighttpd/error.log"
server.indexfiles    = ("index.php", "index.html", "index.htm", "default.htm")
accesslog.filename   = "/var/log/lighttpd/access.log"
url.access-deny      = ("~", ".inc")
server.pid-file      = "/var/run/lighttpd.pid"
server.dir-listing   = "disable"
server.username      = "www-data"
server.groupname     = "www-data"


$PHYSICAL["existing-path"] =~ "\.php$" {
    # block 1
    proxy-core.balancer         = "round-robin"
    proxy-core.protocol         = "fastcgi"
    proxy-core.allow-x-sendfile = "enable"
    proxy-core.backends         = ("unix:/tmp/php-fastcgi.sock")
    proxy-core.max-pool-size    = 16

} # end of $PHYSICAL["existing-path"] =~ "\.php$"

$HTTP["url"] == "/php5-cgi.php" {
    # block 2
    proxy-core.backends = ()
    cgi.assign          = (
        ".php" => "/usr/bin/php5-cgi",
    )

} # end of $HTTP["url"] == "/php5-cgi.php"

and example output from wget

for i in `seq 1 4`; do wget -S -O /dev/null http://192.168.0.91/php5-cgi.php 2>&1 | grep "^\ \ HTTP"; done
  HTTP/1.0 502 Bad Gateway
  HTTP/1.0 502 Bad Gateway
  HTTP/1.0 200 OK
  HTTP/1.0 200 OK

error.log contents

http_resp.c.302: (error) invalid status code -1
mod_cgi.c.319: (trace) response parser failed
http_resp.c.302: (error) invalid status code -1
mod_cgi.c.319: (trace) response parser failed

and the source of php5-cgi.php

<?
        print('asdf');
?>

but when i use fastcgi the problem goes away /source of php5-fastcgi.php is the same as php5-cgi.php/

for i in `seq 1 4`; do wget -S -O /dev/null http://192.168.0.91/php5-fastcgi.php 2>&1 | grep "^\ \ HTTP"; done
  HTTP/1.0 200 OK
  HTTP/1.0 200 OK
  HTTP/1.0 200 OK
  HTTP/1.0 200 OK

Attachments

Change History

05/03/2008 09:15:45 PM changed by stbuehler

  • status changed from new to closed.
  • resolution set to fixed.
  • severity changed from critical to normal.

Again, thx for testing; i think i found the error - if the response header wasn't complete and didn't contain the Status header this error was triggered; i think i fixed that now.

git pull will probably not work, you need to force the update with git pull -f as i manage the patches with stgit and change the history (so neither fast-forward nor merge will work).

Please don't use critical as severity for my experimental branch(es) - they are just experimental and only unofficial ones.


Add/Change #1655 (mod_cgi beheaves incorectly in lighttpd.git/stbuehler)




Change Properties
Action