Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 05-09-2004, 11:30 PM   #1
Registered: Jul 2002
Location: New York
Distribution: Red Hat 7.2, SuSE 7.3
Posts: 60

Rep: Reputation: 15
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


Last edited by verbal; 05-09-2004 at 11:32 PM.
Old 05-10-2004, 04:56 PM   #2
Registered: Jul 2002
Location: New York
Distribution: Red Hat 7.2, SuSE 7.3
Posts: 60

Original Poster
Rep: Reputation: 15
Thought I'd bump it once while I go re-compile 1.3



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache getenv bug? wu1821 Linux - General 1 06-29-2005 10:00 AM
CGI and Apache Sevoma Linux - Software 7 02-06-2005 05:55 PM
Slackware 9.1 and Apache bug? xipxap Slackware 3 10-14-2003 11:09 AM
apache 2.0 user cgi-bin directories JHuizingh Linux - Software 3 03-19-2003 03:58 PM
apache v2.0.44 + cgi ; securing cgi-support in apache markus1982 Linux - General 0 01-20-2003 01:03 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:24 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration