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.

5 Post deleted by moderator.

6 Name: anon!21anon4H3U : 2005-12-22 01:11 ID:Heaven [Del]

Dear >>5,

Thank you for you opinion on the matter. It is being reviewed by our trained message scripts for traces of intellegence, and will be fowarded to a human if any is found. We at iichan thank you for your understanding, and will respond at the soonest a representitive is available.

7 Name: Anonymous : 2005-12-22 03:54 ID:M2ggLmkd [Del]

I'm getting this error when I run wakaba.pl

The server encountered an internal error and was unable to complete your request.

Error message:
Premature end of script headers: wakaba.pl

I am not quite sure what is causing this

8 Name: !WAHa.06x36 : 2005-12-22 05:16 ID:Heaven [Del]

>>7

Perhaps you should try reading >>1-4?

9 Name: Anonymous : 2005-12-22 12:57 ID:M2ggLmkd [Del]

I read 1-4 and applied your suggested fixes under those 5 paragraphs of reasons it would have internal error. I am still encountering the same problems even though the server is configured to run CGI natively.

10 Name: narunet!parlrLMFwQ : 2006-01-02 01:00 ID:8TjWRFyR [Del]

Yeah, I did the same thing as he did but I cant get it working.....

I just recently moved to a new webserver and perl does work... I used the test script to find that out.

11 Name: !WAHa.06x36 : 2006-01-02 06:01 ID:FSFjgm0j [Del]

And what does the error_log say?

12 Name: narunet!parlrLMFwQ : 2006-01-02 21:17 ID:8TjWRFyR [Del]

I fixed it...
For some reason I had to replace all the wakaba files except for the config.....

13 Name: Anonymous : 2006-02-22 17:23 ID:DjW7qxze [Del]

I feel stupid here, but I just keep getting:

Forbidden
You don't have permission to access /kareha/kareha.pl on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Even when I set everything to 777.

14 Name: dmpk2k!hinhT6kz2E : 2006-02-22 17:51 ID:Heaven [Del]

Do you have permission to access /kareha/?

15 Name: Anonymous : 2006-02-22 17:59 ID:DjW7qxze [Del]

I do indeed.

16 Name: !WAHa.06x36 : 2006-02-22 18:13 ID:Heaven [Del]

You shouldn't set everything to 777. The scripts should be 755. Some Apache installations will flat out refuse to run scripts set to 777, because of security issues. They may even refuse to run scripts in directories set to 777.

17 Name: Anonymous : 2006-02-22 20:05 ID:DjW7qxze [Del]

Well, of course I tried 755 first, same error. I'll try to set them back.

18 Name: Anonymous : 2006-02-22 20:11 ID:DjW7qxze [Del]

And zero change.

19 Name: dmpk2k!hinhT6kz2E : 2006-02-22 20:23 ID:Heaven [Del]

What I mean is, do you get a 500 when accessing /kareha/? If the wrong execute bit is off in the dir permission, even though you can physically navigate in there on the filesystem, apache won't let you view it.

20 Name: Anonymous : 2006-02-22 20:30 ID:DjW7qxze [Del]

When I go to /kareha/ I can see everything in there, go into all the folders, view the css files, view txt files, etc, etc.

21 Name: dmpk2k!hinhT6kz2E : 2006-02-22 22:03 ID:Heaven [Del]

Does the test perl script in >>4 work?

IIRC, Apache takes a couple of configuration steps to run CGI, not just one.

22 Name: dmpk2k!hinhT6kz2E : 2006-02-22 22:05 ID:Heaven [Del]

Unrelated: what's up with the "reply" links next to the IDs in earlier posts of this thread?

23 Name: Anonymous : 2006-02-23 03:32 ID:Heaven [Del]

24 Name: dmpk2k!hinhT6kz2E : 2006-02-23 05:30 ID:Heaven [Del]

Did that feature get removed?

25 Name: !WAHa.06x36 : 2006-02-23 08:38 ID:Heaven [Del]

Yes. It kind of sucked.

26 Name: Anonymous : 2006-03-01 08:09 ID:YSlq56iY [Del]

Okay, I'm having some problems. I'm testing out kareha (3.0.9) on my Linux home server with Apache 2 before actually making a proper site. I was having some permission-related 500 errors, and now all dir permissions are fixed. I can view kareha/ and its subdirectories as well as look at non-executable files in them as text, like example.htaccess and the css templates. Running kareha.pl from a broweser, however returns a 500 error still, though not because it cannot write or read a certain directory. Here's some relevant info from error_log:

[Wed Mar 01 12:27:12 2006] [error] [client 192.168.1.68] File does not exist: 
/var/www/localhost/htdocs/favicon.ico, referer: http://192.168.1.68/kareha/
[Wed Mar 01 12:27:14 2006] [error] Can't locate config_defaults.pl in
@INC(@INC contains: . /home/httpd/perl /etc/perl /usr/lib/perl5/site_perl/5.8.7/
i686-linux /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl /usr/lib/perl5/
vendor_perl/5.8.7/i686-linux /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/
vendor_perl/5.8.6/i686-linux /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/
vendor_perl /usr/lib/perl5/5.8.7/i686-linux /usr/lib/perl5/5.8.7 /usr/local/lib/
site_perl /usr/lib/apache2) at /var/www/localhost/htdocs/kareha/kareha.pl
line 13.\nBEGIN failed--compilation aborted at /var/www/localhost/htdocs/
kareha/kareha.pl line 13.\n

(Hope that formats correctly.)

This seems related to the path specified in kareha.pl: use lib '.';. I assume it isn't expanding . to the dir in which kareha.pl is situated. If I edit kareha.pl and input the full path, it still doesn't work. I didn't really think it would. Disabling suexec does nothing as well. test.pl works in kareha/, so mod_perl seems to be fine.

I apologise if I'm missing something obvious, but I'm sort of at a dead end at the moment. Help would be appreciated :)

27 Name: !WAHa.06x36 : 2006-03-01 12:06 ID:Heaven [Del]

>>26

Your problem is most likely that you're using mod_perl, if I read that correctly. It is theoretically possible to run Kareha on mod_perl, but it requires some tweaks, and I've never gotten around to testing it properly.

28 Name: Anonymous : 2006-03-01 14:43 ID:Heaven [Del]

>>27
Oh, okay. Thanks very much. Mod_perl was a bit of a pain, anyway. Guess it'll be easier to get kareha up than I thought.

Thanks very much for this wonderful piece of software.

29 Name: Anonymous : 2006-04-08 18:26 ID:sfumrPWG [Del]

I get an Internal Server error, but everything is fine. I have tried everything here and asked my host for help. I was told to put perl scripts into my cgi-bin folder. I did this but it still failed to help the situation. I think im using mod_perl, what are the "tweaks" that need to be made exactly.

30 Name: !WAHa.06x36 : 2006-04-08 19:06 ID:Heaven [Del]

>>29

Did you try the test script in >>4, outside cgi-bin and inside it?

Also, some hosts only allow you to run CGI scripts in cgi-bin, but then don't let you access normal files in there. Yet other hosts don't let you run perl scripts in directories that are writeable.

You need to gather some more information about what exactly you have and haven't done before we can really help you. Also, look at your server's error_log and see what it says (and remember that you may have several different problems).

31 Name: kai!oYghx6mQzU : 2006-04-08 21:37 ID:n/CVwfOs [Del]

i've been having issues with the cgi bin and .pl files too, i'm an awfull programmer so i have no clue what to do to fix this problem. I'm really only sponsoring the board that me and a few freinds are trying to make and i don't have a programmer anymore
is there anyone here who wants to come and join up as a programmer for my board?

32 Name: Anonymous : 2006-04-09 08:34 ID:QYv1f/9P [Del]

>>30

I tried the test script both outside cgi-bin and inside and it doesnt work. I get an internal server error both times.

I have contacted my host but they say they cant help with issues like this, that I (the administrator) should locate the problem and fix it, but my knowlage of cgi is limited.

33 Name: kai!oYghx6mQzU : 2006-04-09 09:44 ID:n/CVwfOs [Del]

>>32 I have the same issue my hosts don't make any attempt to help

34 Name: !WAHa.06x36 : 2006-04-09 12:44 ID:Heaven [Del]

>>32

So what does error_log say?

35 Post deleted by user.

36 Name: Anonymous : 2006-04-10 20:20 ID:q9vtTej5 [Del]

My error log gives me:
Premature end of script headers[My domain info/kareha.pl][client info]

37 Name: !WAHa.06x36 : 2006-04-10 20:24 ID:Heaven [Del]

And what else?

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: