Debian 3.1 Sarge upgrade broke all CGIs?


#1

All of my CGIs are broken after the Sarge upgrade.

I’ve seen a couple of other threads about certain apps breaking with the Sarge upgrade (e.g. Movable Type), with some insinuation that file permissions need to be changed to work with the new set-up. But even a freshly created test CGI script seems to fail, and permissions do not appear to be the issue.

A simple test.cgi:


#!/usr/bin/perl

use warnings;
use strict;

print “Content-Type: text/html\n\n”;
print 'Hello! '.localtime();
print “\n”;
exit(0);


chmod 755 test.cgi

Runs fine from the command line (as me). Returns 500 error in a browser, and leaves only “Premature end of script headers” in the error log. Changing permissions to 777 does not fix the problem. These files are owned by me, with a group of “pg” followed by a bunch of numbers.

A similar script written for /bin/sh fails in the same way. This feels more like an Apache config issue than a file permissions issue. PHP appears unaffected.

Has anyone else fixed this problem for sure with their own apps? How, exactly?


#2

Thanks for testing my test script, glad to hear it worked for you. Can you tell me what file permissions and ownership you gave the file? I can’t think of any other environmental issue that may have broken all my stuff.

I got one response from Support so far, but no resolution yet. It looks like DH intentionally hides Apache config and the global Apache logs from the shared plans, so there’s little I can do without their direct assistance. (Support mentioned log entries that complained about permissions of my test script-- it won’t run something that’s world-writable-- but I think those only showed up because I was fiddling with the permissions to get it to work. In any case, I don’t seem to have access to the log file that contained that complaint…)


#3

Me too!

No perl scripts work. No compiled scripts work. PHP does work. I’ve tried every combination of ownership and permissions that I can imagine would work, but still no luck. These are previously working scripts that stopped working. I have tried the simplest possible perl “helloworld” script and it does not work either. I get a “Premature end of script headers” in the error log. The scripts all run fine from the commandline.

This sucks! I think Dreamhost’s apache configuration is borked.

When trying to fix this issue, the support staff needs to verify not only that a script THEY create works, but that a script that the customer creates and tries will work as well.


#4

DH support just fixed me this morning. It involved some management setting in their customer database that was either ignored until now (likely) or accidentally changed recently. As a result, Apache was running as a group that was not under my account. The new tighter suEXEC policy made this condition a fatal error.

Thanks and shout out to Mike of DH support for figuring this out. They may be working on a broader fix for everyone, but it’s worth contacting support to be sure.