Problem - CGI Script Installation


I just installed a perl cgi script on the server, set all chmods, checked the cr/lf characters and print “Content-type: text/html\n\n” string.

Using shell and perl xxxx.cgi it runs well without any problem.

Now, if i use browser (IE5) then "500 Internal Server Error"
appears. The error log shows “premature end of script” which is strange to me.

Any one an idea what is behind? I’m not able to fix it up to now and I have no idea how to solve it…

Thanx a lot



it seems as I finally solved the issue.
I carefully checked again my chmod settings for the directories and recognized that one dir was set 777 instead 755. I modified using ftp --> it now runs with browser!

have a nice day!

Yes, that’s the easiest way to screw up a CGI script on Dreamhost. Anything that the script instructions say to set to 777 should be set to 755 instead, for security reasons. Dreamhost has their system tweaked so that Perl scripts run as owner instead of as nobody, so they only need to be executable by the owner (i.e. the first 7).

Of course the usual ways of screwing up CGI scripts elsewhere, like uploading them in binary mode or getting the paths wrong, work here too. :slight_smile: