500 Internal Server Error (417)

1 Name: !WAHa.06x36 2005-02-21 17:46 ID:FqgLpoAw (Replies) [Del]

Since 500 Internal Server Errors aren't ever really caused by Wakaba or Kareha themselves, but are still a big problem for lots of people, I'm setting up this thread to discuss various problems and solutions related to them.

2 Name: !WAHa.06x36 2005-02-21 17:54 ID:FqgLpoAw (Replies) [Del]

Firstly, things that often cause Internal Server Errors:

  • Wrong permissions on the .pl files. They should have 755 permissions. NOT 777, because that may cause some servers to refuse to run them.
  • Incorrect hashbang. Most of the time, the default #!/usr/bin/perl is the correct one, but sometimes Perl is installed elsewhere. In that case, you will have to find out where, and change the hashbang. On Windows servers, it should often be changed to #!perl.
  • Incorrect options set up for CGI scripts. The configuration for the directory should contain Options +ExecCGI and AddHandler cgi-handler .pl. SOMETIMES, but definitely not always, this can be put into the .htaccess file. See the next point.
  • A broken .htaccess file. Spelling errors, trying to use modules that are not installed, or trying to use options that have been forbidden elsewhere will all cause Internal Server Errors.
  • An incorrect mod_suexec install. Mod_suexec is very temperamental, and getting it to allow running of Perl scripts at all is very hard. Don't ask me, I have no idea how to configure it.

3 Name: !WAHa.06x36 2005-02-21 17:57 ID:FqgLpoAw (Replies) [Del]

Secondly, things that DO NOT cause Internal Server Errors:

  • Wakaba or Kareha themselves. Unless you've horribly mangled the scripts by hand, they will never cause an Internal Server Error. The only thing in the script file itself that can cause problems is the hashbang on the first line.
  • Wakaba configuration. As a consequence of the above, no matter how badly you configure it, it should not cause an Internal Server Error.
  • Missing software or modules. Missing mysql or ImageMagick will cause errors, but not Internal Server Errors. A missing Perl might, though, but that's not very likely to be a problem.

4 Name: !WAHa.06x36 2005-02-21 18:01 ID:FqgLpoAw (Replies) [Del]

Third, what to do when you get Internal Server Errors?

  • Look at error_log. Internal Server Errors often generate two or more lines in the log file, make sure you read them all.
  • Try the Perl test script:

    #!/usr/bin/perl

    print "Content-Type: text/html\n\n";
    print "<html><body><h1>Perl is working!</h1></body></html>";

    If this doesn't run, work with the server config until it runs, and only when it does, get to work on Wakaba.

  • If you are sure you've got the permissions and hashbang right, ask your admin about what you need to do to get CGI scripts running.
Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: