?
Solved

apache users cgi's

Posted on 1999-12-26
16
Medium Priority
?
440 Views
Last Modified: 2013-12-16
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?

0
Comment
Question by:GP1628
  • 9
  • 7
16 Comments
 
LVL 12

Expert Comment

by:j2
ID: 2307330
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
 
LVL 2

Author Comment

by:GP1628
ID: 2307587
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
 
LVL 12

Accepted Solution

by:
j2 earned 800 total points
ID: 2307608
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 12

Expert Comment

by:j2
ID: 2307616
(not that this Flat file system is quite as flexible as a *NIX one, but it's a quantum leap forward)
0
 
LVL 2

Author Comment

by:GP1628
ID: 2307618
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
 
LVL 2

Author Comment

by:GP1628
ID: 2307619
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
 
LVL 12

Expert Comment

by:j2
ID: 2307625
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
 
LVL 12

Expert Comment

by:j2
ID: 2307633
(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
 
LVL 2

Author Comment

by:GP1628
ID: 2307803
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
 
LVL 12

Expert Comment

by:j2
ID: 2308082
the premat. end usually means that you are trying to call a .pl and only have .cgi defined as a script?
0
 
LVL 2

Author Comment

by:GP1628
ID: 2308094
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
 
LVL 12

Expert Comment

by:j2
ID: 2308105
RH's distro now assumes a suffix, otherwise it "disqualifies" the script. This isnt really RH, but rather the newer versions of apache.
0
 
LVL 2

Author Comment

by:GP1628
ID: 2308122
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
 
LVL 12

Expert Comment

by:j2
ID: 2308149
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
 
LVL 2

Author Comment

by:GP1628
ID: 2308171
yes they are moving from apache 1.1.1  :)
any examples of mapping .sh and .pl?
0
 
LVL 12

Expert Comment

by:j2
ID: 2308179
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

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will learn how to dynamically set the form action using jQuery.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question