Click to See Complete Forum and Search --> : Apache help needed - getting user cgi-bins to work


Lance
11-02-1999, 05:38 PM
Ok. Redhat 6.1 - Latest version of Apache. I have Apache setup to allow user pages (ie /~someone ) to be view but I can't get users to have cgi-bin access. I can create the directory and the file but it does not execute the files.

Is there a simple way to allow all users to have a cgi-bin directory without individual ScriptAlias commands?

And is it just me - or is the Apache documentation next to useless.

Appreciate any help or comments.

-Lance

I posted this to tech support too.

takshaka
11-02-1999, 09:02 PM
The ScriptAliasMatch directive is what you want.

The following should do it, assuming users' html directories are in /home/<username>/public_html/

ScriptAliasMatch ^/~([^/].*)/cgi-bin/([^/].*) /home/$1/public_html/cgi-bin/$2

Lance
11-02-1999, 09:42 PM
Ok. After adding that line ( I had it written out by hand for each user before - that line saves me some lines of code. ) I get a new error (making progress it seems) - a 500 internal server error. Upon checking my logs, they say that there was a "Premature end of script headers".

The script consisted of the following:
------
#!/usr/bin/perl
print "Content-type:text/plain\n\n";
print "This appears to have worked.\n";
------

Not too much to screw up. And this exact same script works in /home/httpd/cgi-bin/ but does not in /home/user/public_html/cgi-bin/.

Which leads me to beleive it is not a problem with the script but with an Apache setting.

Any ideas ?

-Lance

Sensei
11-02-1999, 10:13 PM
this is out of left field...can it be a permissions related problem?

------------------
Sensei
Join the Linuxnewbie.org SETI Black Belts!
http://setiathome.ssl.berkeley.edu/cgi-bin/cgi?cmd=team_join_form&id=11027

Lance
11-02-1999, 10:44 PM
No. Thought of that already. From 711 to 777 nothing wants to work.

-Lance

zeppelinx
11-02-1999, 11:40 PM
You only need these two things for per user cgi-bin dirs:

<Directory /home/*/public_html/cgi-bin>
options execcgi
whatever_else_you_feel_you_want_here
</Directory>

then find the addhander line and make it resemble:

addhandler cgi-script .pl

HUP httpd and give it another whirl.

Cheers,
Jim Hewlett

Lance
11-03-1999, 02:14 PM
After that I was still getting a 500 error. So i decided to check if it was suexec that was screwing things up. It was. I reconfigured it - changed some permissions in the cgi-bin and now it works great.

Thanks for the help.

-Lance

[This message has been edited by Lance (edited 03 November 1999).]

jlink
09-04-2000, 10:25 AM
I realize this is a really old post...almost a year, but I seem to be having identical problems. If someone wouldn't mind explaining what SUEXEC is and how to modify it I would be greatful....
Thanks, Jim

tnordloh
12-18-2000, 01:16 PM
Me too. And me too. I'm going to continue to search for this suexec problem. If I find it, I'll post it here. If someone else cares to post it, please do. Thank you.

Sweede
12-18-2000, 01:37 PM
Modifying suexec beyond the means that apache developers had written it is bad.

this is the only thing you need to know, and pretty much all that can be said about suexec
http://httpd.apache.org/docs/suexec.html