unexpected end-of-file error. Need help
Added by litium almost 15 years ago
Hi,
im trying to setup a webserver(server 1) that will forward all requests to another application server(server 2) via fastcgi. both servers are installed with solaris 10 and both are configured with opensolaris coolstack php and lighttpd. however i can't get things working when pointing a url at server 1.
from the error log on server 1, i found out this:
2010-05-04 09:49:32: (mod_fastcgi.c.2471) unexpected end-of-file (perhaps the fastcgi process died): pid: 0 socket: tcp:192.2.1.201:8001
2010-05-04 09:49:32: (mod_fastcgi.c.3281) response not received, request sent: 809 on socket: tcp:192.2.1.201:8001 for /app1.php , closing connection
on server 2 (192.2.1.201), port 8001 was listening.
My config on server 2
# lighttpd configuration file # # use it as a base for lighttpd 1.0.0 and above # # $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $ ############ Options you really have to take care of #################### ## modules to load # at least mod_access and mod_accesslog should be loaded # all other module should only be loaded if really neccesary # - saves some time # - saves memory server.modules = ( # "mod_rewrite", # "mod_redirect", # "mod_alias", "mod_access", "mod_status", "mod_fastcgi", "mod_accesslog" ) ## a static document-root, for virtual-hosting take look at the ## server.virtual-* options server.document-root = "/opt/coolstack/lighttpd/htdocs" ## where to send error-messages to server.errorlog = "/opt/coolstack/lighttpd/logs/error.log" # files to check for if .../ is requested index-file.names = ( "index.php", "index.html", "index.htm", "default.htm" ) ## set the event-handler (read the performance section in the manual) server.event-handler = "solaris-devpoll" server.network-backend = "writev" #### accesslog module accesslog.filename = "/opt/coolstack/lighttpd/logs/access.log" ## deny access the file-extensions # # ~ is for backupfiles from vi, emacs, joe, ... # .inc is often used for code includes which should in general not be part # of the document-root url.access-deny = ( "~", ".inc" ) $HTTP["url"] =~ "\.pdf$" { server.range-requests = "disable" } ## # which extensions should not be handle via static-file transfer # # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) ######### Options that are good to be but not neccesary to be changed ####### ## bind to port (default: 80) server.port = 8001 ## bind to localhost (default: all interfaces) #server.bind = "127.0.0.1" ## to help the rc.scripts server.pid-file = "/opt/coolstack/lighttpd/var/run/lighttpd.pid" ## virtual directory listings #dir-listing.activate = "enable" ## change uid to <uid> (default: don't care) server.username = "webservd" ## change uid to <uid> (default: don't care) server.groupname = "webservd" #### fastcgi module ## read fastcgi.txt for more info ## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini fastcgi.server = ( ".php" => ( "localhost" => ( "socket" => "/tmp/php-fastcgi.socket", "bin-path" => "/opt/coolstack/php5/bin/php-cgi -c /opt/coolstack/php5/lib/php.ini" ) ) ) # Set max-worker at least equal to number of cores/threads on system server.max-worker = 4
My config on server 1 (everything is the same except this)
fastcgi.server = ( ".php" => (( "host" => "192.2.1.201", "port" => 8001, "check-local" => "disable", )) )
am i doing the thing right or there's something that missed?
Thanks in advance!
Replies (3)
RE: unexpected end-of-file error. Need help - Added by nitrox almost 15 years ago
Server2 has the php files? It knows about the directory structure and paths of your request? Set debug.log-request-handling = "enable" and watch your errorlog on server1. Start only one php daemon on server2 and use "strace -ff -o foo.txt -s 1024 -p <pidofphpdaemon>" and watch submit the results here or to a pastebin. Else join #lighttpd on irc.freenode.net and report back to this thread if your problem got fixed.
RE: unexpected end-of-file error. Need help - Added by nitrox almost 15 years ago
Uhm, wait a second. On server2 you also have lighty and launch php locally (for localhost?). How should lighty on server1 use the fastcgi protocol and talk to server2 if it spawned php locally? Its not lighty that should listen on server2 and port 8001, thats where lighty on server1 expects your php daemon to listen.
So forget my first answer, think about this one instead.
RE: unexpected end-of-file error. Need help - Added by litium almost 15 years ago
Thanks nitrox for helping.
Actually i was confused with this form the start _
i thought that both of the servers would communicate via lighty.
So you're saying that i have to spawn php-cgi on server 2 instead of lighty. The big picture is server 1 (lighty) will communicate with server 2 (spawn-fcgi process) right?
is this the right command for spawing a php-cgi to listen to port 8001 on server2?
/opt/coolstack/lighttpd/bin/spawn-fcgi -h localhost -p 8001
one more thing do i need to change any values on my lighty configurations server 2 ?