Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Python script giving me a 500 Internal Server Error on nginx - Page 2
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Python script giving me a 500 Internal Server Error on nginx

2»

Comments

  • Read the "Permissions" section at http://www.acme.com/software/thttpd/thttpd_man.html

    Basically, ensure that files & directories are world-readable. Having them owned & readable by 'www-data' is not sufficient.

  • drmikedrmike Member
    edited January 2012

    @Freek said: #symlinks

    Hmmm, just noticed how that creates search links.

    edit: #test

    testme

    reedit: Weird. Guess not. Wonder why it works up there.

  • Guys I'm in the middle of my exams right now so I have not that much time on my hands. I will get back to you in 1.5 weeks ok :)?
    Tnx

  • FreekFreek Member
    edited January 2012

    Edit: --

  • FreekFreek Member
    edited January 2012

    Okay guys I got it up and running now :) After I binded it to 127.0.0.1 only and set the right permissions the thing finally came to live :)

    This tutorial also helped a little, http://nginxlibrary.com/running-cgi-scripts-using-thttpd/ but most help was from you guys!
    Once again, thanks soo much :D

  • Yeah! :) Hope the exams went well.

  • 2 down, 4 to go.
    They are split over 2 weeks :(

  • Ohoh, guys I need a little help over here... again.
    thttpd stops at random intervals. One moment it's there and the other moment poof it's gone.
    I checked thttpd's log file, but that doesn't mention anything about a crash or error.

    What logfiles should I check to see what's causing this?

    Thanks

  • Maybe /var/log/syslog? I am not sure if thttpd logs to syslog but... you can try and see

  • Hmm yes I'm seeing some entries from thttpd in syslog but nothing special. Just spawning cgi's processes and the start of thttpd itself after a reboot of my VPS...
    This is strange....

  • Strange indeed. I've written some pretty bad cgi scripts but never managed to crash thttpd :) I think thttpd also logs to /var/log/daemon.log. Anything interesting in there?

  • @sleddog /var/log/daemon.log is empty :O ?

  • @Freek said: /var/log/daemon.log is empty :O ?

    That's not a problem in itself. Whatever happened to thttpd didn't get logged.

  • Crap, tough luck for me again.

  • Got killed by OOM maybe?

    I don't know but, some time ago I used it just for static content, and it memory growed like an idiot (dunno why, but probably because the files were really big ? )

  • You need to work on reproducing the crash. Start with the thttpd and nginx access logs. What's the last thing thttpd logged? Browse from there and see if you can make it crash. If you can identify a particular script, or action within a script, then you're making progress... :)

  • @yomero Could php5 also have killed it? I have suspicion that that might be causing it. I have now commented out the first line in /etc/cron.d/php5. Lets see if that helps

    @sleddog I currently only have 1 very simple .cgi script hosted. If I check thttpd's access log I only see some get requests on the same .cgi script and that's all. nginx log is very clean as I'm not hosting anything else on it yet.

    If it keeps crashing, I'll remove the cgi script and see if it crashes out of itself, even without anything accessing it.

  • It just crashed again. Now removing the cgi file... Let's see what then happens.

  • @Freek said: @yomero Could php5 also have killed it? I have suspicion that that might be causing it. I have now commented out the first line in /etc/cron.d/php5. Lets see if that helps

    I think php has nothing to do with thttpd for this purpose, but if you got out of memory, or PHP used a lot, then probably the system killed thttpd because the lack of resources, but just a theory, I don't know your specs, your processes, etc =P

    Try what sleddog says, reproduce the issue.

  • Are you on OpenVZ? Any fail counts in /proc/user_beancounters?

  • I have a XEN VPS with 256MB RAM/512MB SWAP. I have around 90MB RAM free all the time so RAM shouldn't be an issue...

    The problem is that I can't see what's it crashing on. Just some simple get requests... and then suddenly, even when not being accessed, poof it's gone.

    Now it's just sitting there idle, so if it crashes now OOM must have killed it as there is nothing for it to do.

  • thttpd just crashed again...
    /var/log/daemon.log is empty
    /var/log/nginx/error.log does not contain anything noteworthy
    /var/log/thttpd.log contains no new loglines.
    /var/log/syslog contains this:

    Jan 28 15:55:56 alpha kernel: Kernel logging (proc) stopped.
    Jan 28 15:55:56 alpha rsyslogd: [origin software="rsyslogd" swVersion="5.8.1" x-pid="522" x-info="http://www.rsyslog.com"] exiting on signal 15.
    

    To make clear: I have removed the one and only .cgi script from the server so the only thing on it now is a simple default index.html...

    @sleddog I am on XEN. I cannot find /proc/user_beancounters.

    Any ideas are well appreciated as I have none anymore... I mean no .cgi files, enough free RAM.. What is this :S

  • I'm not the only one:
    http://wl500g.info/showthread.php?t=10619
    But the suggested fix is more like a workaround. I would rather discover the root of the problem before using such a fix..

Sign In or Register to comment.