I'm running an apache web server (version 2.0.49) on a Fedore Core 2 machine. I'm have a few users using it with a UserDir on (e.g. I can do http://www.example.com/~user
). I want to enable perl execution in the user's www directory. In each user's www directory is a cgi-bin directory. So I want users to run perl programs, like http://www.example.com/~user/cgi-bin/test.pl.
I've been testing this with test.pl (see below). When I run it from the server root cgi-bin directory, e.g., http://www.example.com/cgi-bin/test.pl,
it works totally fine. But when I test it in a user's directory, it fails. The error I get in the apache log is:
[Tue Dec 14 11:50:54 2004] [error] [client 192.168.1.104] Premature end of script headers: test.pl
I don't understand why it works under the document root and not under the user directories. Here is a portion of my httpd.conf file that I thought I configured correctly:
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# To enable requests to /~user/ to serve the user's public_html
# directory, use this directive instead of "UserDir disable":
Allow from from all
This is the test perl program i'm trying to run:
print "Content-type: text/html\n\n";
print "Hello, World.";
Right now the home directories are in a place that is not under the document root. I tried creating a test user who's home directory was in fact under the document root, and created a www and a cgi-bin folder inside that. When I go to it on the web without UserDir it works, with UserDir, it doesn't. In other words:
does NOT work.
Permissions are all fine, the appropriate user owns all the directories involved. And the same perl program can be executed on the command line. Apache is being run as user: apache, group: apache.
Anyone have any ideas why this is happening and how it can be fixed? I would appreciate any help on this, thanks!