Lighttpd Cgi Error 500
Contents |
years ago Setup:¶ OS: Debian 6.0.4Lighttpd: lighttpd/1.4.28 (ssl) Build-Date: Mar 15 2013 20:08:27Hardware: VPS OpenVZ, w/ abundant free RAM (1GB +), free disk space (90GB), and low CPU load (in light of eventual race conditions)lighttpd.conf: file attached; also at http://pastebin.mozilla.org/4701923User agent: lighttpd error 500 Iceweasel 8.0, Debian Description of problem:¶ I get intermittent HTTP 500 responses when
Lighttpd Debug Log
requesting a CGI (no FastCGI) script.About 80% of the requests return HTTP 200, the rest HTTP 500, for no particular lighttpd error log reason.This is a shell script, named cloudGenerator.js.sh, with ending .sh extension. As per the attached lighttpd.conf, lighttpd is instructed to handle .sh files via the default system shell - in this case Bash. The script, cloudGenerator.js.sh, is a "self-extracting" javascript file: at line 1, its sha-bang points to the extractor program; by line 2, it becomes regular JavaScript: #!/usr/local/bin/jsMinCacher.sh var genericJsFunction = function() { return []; }; The extractor program, /usr/local/bin/jsMinCacher.sh, is a small (20 lines) regular Bash script (#!/bin/bash) which outputs to stdout a shrunk version of the original file. Its execution is consistent in that it's not influenced by volatile runtime factors, like environment variables or date; it always executed the same algorithms and produces the same output: #!/bin/bash source=${1##*/} cache_dir=/tmp/jsMinCacher/ compressor=/usr/bin/yui-compressor To summarize, executing "bash cloudGenerator.js.sh" launches "bash /usr/local/bin/jsMinCacher.sh", which in turn produces the stdout to feed thru CGI. Running "bash cloudGenerator.js.sh" directly via command line never fails. This is tested with 2000 iterations and with PWD environment variable set to the path of cloudGenerator.js.sh.Instead, when "bash cloudGenerator.js.sh" is called by CGI, 20% of the times I get HTTP 500. When this happens, the script still doesn't encounter any error by its own, and correctly completes its execution from start to end, producing the expected stdout, with stderr empty, and returning the exit status 0. Apparently, I'm getting HTTP 500 in vain.How can I debug this further? lighttpd.conf View - Same file, with syntax highlight: pastebin.mozilla.org/4701923 (3.53 KB) Replies (5) RE: Intermittent HTTP 500 on CGI - Added by Davide_Baldini over 2 years ago I found a similar report on this support forum, dating 2009-05: Random 500 Internal Server Error with Perl That report doesn't specify whether the script correctly executes thru the end. Still, dating a similar repor
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top How to diagnose Internal Server error on Lighttpd? up vote 4 down vote favorite I have Lighttpd on Centos 5 https://redmine.lighttpd.net/boards/2/topics/5989 with Fcgi and Memcached. Periodically, once per week or two i get internal server error 500 and i must manually restart lighttpd to get it to work again. In my lighttpd config I've defined error log file: server.errorlog = "/home/lxadmin/httpd/lighttpd/error.log" But when I open it, it has no rows for last days, only one month ago. So my question is how to diagnose what is the issue and how to enable error log for my configuration? lighttpd fastcgi logging share|improve http://serverfault.com/questions/140700/how-to-diagnose-internal-server-error-on-lighttpd this question asked May 11 '10 at 15:40 tomaszs 49531424 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote accepted Edit: nano /etc/lighttpd/lighttpd.conf And put: fastcgi.debug = 1 share|improve this answer answered Jun 7 '10 at 10:55 tomaszs 49531424 add a comment| up vote 0 down vote My guess is that the problem is related with trouble connecting with the fcgi processes. Have you tried to strace lighttpd process when the internal server errors are happening? That should give you a clue of what's happening. Try something like this: strace -p pidof lighttpd -o strace.output then take a look at strace.output. Hope this helps. share|improve this answer answered May 11 '10 at 16:07 Marco Ramos 2,3871524 Thank you I will try this and come back with results –tomaszs May 12 '10 at 9:22 And by the way, check if lighttpd has permissions to write to the error_log. Might be an issue as well. –Marco Ramos May 12 '10 at 10:37 How can I contact with you in private? –tomaszs May 12 '10 at 13:34 @Tomaszs: direct message me on twitter (@mramos29) –Marco Ramos May 16 '10 at 23:34 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a g
uploaded a PERL script into the cgi-bin folder of my Apache2, but whenever I'm trying to run it in my browser https://www.howtoforge.com/community/threads/internal-server-error-with-cgi-scripts.16/ I get the error "500 Internal Server Error". Is it something serious? How can I fix it? Any help is greatly appreciated! lola lola, Apr 21, 2005 #1 tylerdurden New Member Is it something serious?Click to expand... Don't worry, it doesn't break your server! I bet the problem is that you didn't make your Perl script error 500 executable. Try to make a Code: chmod 755 on your Perl script and try to access it in your browser. You always have to make Perl scripts executable! tyler tylerdurden, Apr 21, 2005 #2 lola New Member Yes, that was it, it's working now! Thanks! lola, Apr 21, 2005 #3 (You must log in or sign lighttpd cgi error up to reply here.) Show Ignored Content Share This Page Tweet Log in with Facebook Log in with Twitter Log in with Google Your name or email address: Do you already have an account? No, create an account now. Yes, my password is: Forgot your password? Stay logged in Sign up now! Forum Statistics Discussions: 53,605 Messages: 284,263 Members: 91,761 Latest Member: ok ny Share This Page Tweet Howtoforge - Linux Howtos and Tutorials Home Forums > Linux Forums > Programming/Scripts > English | Deutsch Tutorials Tags Forums Forums Quick Links Search Forums Recent Posts Members Members Quick Links Notable Members Current Visitors Recent Activity New Profile Posts Contribute Subscribe ISPConfig News Menu Search Search titles only Posted by Member: Separate names with a comma. Newer Than: Search this thread only Search this forum only Display results as threads Useful Searches Recent Posts More... Xenforo skin by Xenfocus Contact Us Help Imprint Home Top RSS Terms and Rules Forum software by XenForo™ ©2010-2014 XenForo Ltd. Tac Anti Spam from Surrey Forum