Link to home
Start Free TrialLog in
Avatar of GP1628
GP1628

asked on

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?

Avatar of j2
j2
Flag of Sweden image

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.
Avatar of GP1628
GP1628

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of j2
j2
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
(not that this Flat file system is quite as flexible as a *NIX one, but it's a quantum leap forward)
Avatar of GP1628

ASKER

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!
Avatar of GP1628

ASKER

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!
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.
(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)
Avatar of GP1628

ASKER

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.
the premat. end usually means that you are trying to call a .pl and only have .cgi defined as a script?
Avatar of GP1628

ASKER

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.
RH's distro now assumes a suffix, otherwise it "disqualifies" the script. This isnt really RH, but rather the newer versions of apache.
Avatar of GP1628

ASKER

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
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?
Avatar of GP1628

ASKER

yes they are moving from apache 1.1.1  :)
any examples of mapping .sh and .pl?
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)