-   Linux - Software (
-   -   Help with Apache 2+ user cgi (is there a bug?) (

verbal 05-09-2004 11:30 PM

Help with Apache 2+ user cgi (is there a bug?)
Hi there...

A long time ago, I upgraded my apache installation to the newer 2.0 series and ran into an issue with user accounts not being able to run their own CGIs. I again find myself in need of this feature and thought I'd ask once more before I go to the extreme of reverting to an older version.

I am running apache 2.0.40 on a redhat 9.0 server. I have apache set up to alow users to run their own pages under the typical userdir setup (i.e. ~user == /home/*/public_html) I actually use somethng other than "public_html" but you get the idea. The set up appears to work fine for both typical users and vhosts.

The only thing that doesn't work si the cgi-bin under the user directory (i.e. /home/*/public_html/cgi-bin) Any attempt to execute a script results in apache throwing a "premature end of header" error.

To rule out permissions as the issue, I chmod'd to 777 (first the script, then the cgi-bin).

I am confident that this is not really a headers issue, because if I move the script to the main cgi-bin of the server, it executes flawlessly. This error only occures under a user directory.

The configuration file changed in the 2.0 series, so I am assuming that I configured something wrong. The applicble entries follow:

<IfModule mod_userdir.c>
UserDir public_html
UserDir disabled root

# Control access to UserDir directories.
<Directory "/home/*/public_html">
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch
Order allow,deny
Allow from all
Order allow,deny
Allow from all

# User cgi-access
<Directory "/home/*/public_html/cgi-bin">
Options ExecCGI
AddHandler cgi-script .cgi .pl

I'll include the script as well, though I am fairly confident that it is not the issue:

#include <iostream>

int main( int argc, char **argv ) {

std::cout << "Content-type:text/html\n\n" << std::flush;
std::cout << "hello world!";


As stated above, this runs fine in the main cgi-bin. The CGI is owned by the user, and the group is "apache" (which is the group under which the server runs). For this test, the permissions are 777.

Could anyone offer any insight as to why this does not work? Any help at all would be greatly appreciated. If I don't solve this soon, I will be forced to reinstall the 1.3 series and thats going to be a nightmare as I have twenty-one users that will start screaming if I screw up the transfer :)

Thanks in advance


verbal 05-10-2004 04:56 PM

Thought I'd bump it once while I go re-compile 1.3 :(


All times are GMT -5. The time now is 07:23 PM.