apache users cgi's

OK we have an old server running linux and apache where the users get to run cgi's out of their own dir's.

We just created a new server with a new version of linux (6.1 if I remember right) and for some reason I cant get the user cgi's to work.

Im fairly sure that the configs have been matched. Does anyone have specific experience with this problem?

LVL 2
GP1628Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

j2Commented:
RH 6.1 changed a LOT of stuff from older distros

Go into linuxconf "Apache web server / Sub Directory spec" then you (beleive it or not) have to add an entry for every user (or atleast i havent found a way to set this as default).

Provide the path to the CGI-bin dir Then check "May execute CGI" for the directory. Should do it.
0
GP1628Author Commented:
OK let me reject that answer but only because I need to keep this going for abit. There is NO way that I want to manually add every user...
But then this is unix (well linux is still kinda unix) so I shouldnt have to.

Do you know what it exactly adds to the configs for each user?
Do you happen to have an example of one users entry?

Ive never used the linuxconf but I guess if I have to I can add one user but then Im going to script the changes for all the others.

Gandalf
Yes, Computers were made to do repetitive work quickly and can do it better than you. But dont feel bad. Until they can do the creative work they still need us.
0
j2Commented:
it adds an entry like

<Directory /home/j2/public_html/cgi-bin>
AllowOverride None
Options ExecCGI
</Directory>

in /etc/httpd/conf/srm.conf  (assuming redhat filestructure here) of cource you can play with the allowoverrid and options, but this is the "basics"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

j2Commented:
(not that this Flat file system is quite as flexible as a *NIX one, but it's a quantum leap forward)
0
GP1628Author Commented:
EXCELLENT! I have doubled your points.
You dont KNOW how much work and aggravation you saved me.

Unfortunately the machine that we were running my mud on (only slightly older, I was so confused by this) was able to allow user dirs. The boss was considering moving the whole server project there which would have either bumped my favorite game, or made it run like sludge.

THANK YOU.
So would anyone be interested in a script for this?

Gandalf
And I was asked
   Oh great Guru, what is the meaning of life?
and I replied
    Bigger Better Toys!
0
GP1628Author Commented:
EXCELLENT! I have doubled your points.
You dont KNOW how much work and aggravation you saved me.

Unfortunately the machine that we were running my mud on (only slightly older, I was so confused by this) was able to allow user dirs. The boss was considering moving the whole server project there which would have either bumped my favorite game, or made it run like sludge.

THANK YOU.
So would anyone be interested in a script for this?

Gandalf
And I was asked
   Oh great Guru, what is the meaning of life?
and I replied
    Bigger Better Toys!
0
j2Commented:
oh! side note tho! i JUST realized that (or it might have been added in the latest linuxconf) that there is a entry in "defaults" for apache for "may execute CGI" now, that PROLLY means that a user can stick a .cgi in any dir in their public_html, but atleast you wouldnt have to add massive amounts of Directory directives?

The help (point 14.3) states that cgi exec is "globally disabled" by default.
0
j2Commented:
(once again, assuming redhat 6.1 with the latest linuxconf here)

I dont LIKE linuxconf, or redhat either, just happened to think that RH6.1 was a better distro then slack4, but with slack7 i might trade back.

Also note that restarting apache might not be enough, doing a 'real' stop / start of apache guarantees that the directives will be re-read.

(sorry for the multiple responses)
0
GP1628Author Commented:
AAARRRGGGHHHH
still not working for some reason.
It might be closer but in the error_log I get
[Mon Dec 27 07:55:54 1999] [error] [client 63.199.8.154] Premature end of script headers:

The same scripts work fine in the main cgi-bin but not in the users

Gandalf
Sure I'm a guru but beware of asking guru's what operating system you
should get. Guru's tend toward the most irritating system they can find.
Thats how they get to be guru's. Instead ask someone who uses a computer everyday and still knows nothing about computers.  
 Me?  Oh, I use Unix.
0
j2Commented:
the premat. end usually means that you are trying to call a .pl and only have .cgi defined as a script?
0
GP1628Author Commented:
how do I define ALL the way it used to be?
The shell scripts have no extension. I guess I can fix that if need be but its an old machine we are trying to upgrade and there are alot of users.
0
j2Commented:
RH's distro now assumes a suffix, otherwise it "disqualifies" the script. This isnt really RH, but rather the newer versions of apache.
0
GP1628Author Commented:
ok but the shell scripts and the .pl scripts are acting the same. they display code to the screen. The .cgi gives me a "premature end of script headers" error
0
j2Commented:
well, if the script does NOT have an extension which is linked to a module it will be handled as plain text. Can you give an example of how a .cgi of yours looks?

As default only .cgi is mapped to "cgi-script" (in srm.conf)

AddHandler cgi-script .cgi


I have a feeling that you were running a _very_ old apache version?
0
GP1628Author Commented:
yes they are moving from apache 1.1.1  :)
any examples of mapping .sh and .pl?
0
j2Commented:
Nope, i don't even have any modules to run shell scripts loaded. i stick to perl and php. But for perl, you SHOULD just be able to add .pl to the addhandler.. provided that ther perl module is loaded. (its described in srm.conf)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.