LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-11-2001, 05:44 PM   #1
roadie
LQ Newbie
 
Registered: Jun 2001
Location: Colorado
Distribution: Redhat
Posts: 15

Rep: Reputation: 0

I'm having problems getting cgi scripts working in the directory i have specified in httpd.conf Is it possible to configure apache to allow scripts to be run from any directory? I find it unneccessary (and annoying) to have one specific directory for that. Any suggestions on what I should do? Thanks.
-Eliot
 
Old 06-11-2001, 08:00 PM   #2
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
Quote:
Originally posted by roadie
I'm having problems getting cgi scripts working in the directory i have specified in httpd.conf Is it possible to configure apache to allow scripts to be run from any directory? I find it unneccessary (and annoying) to have one specific directory for that. Any suggestions on what I should do? Thanks.
-Eliot
Just recompile your kernel with the added directive
Code:
make menuconfig --with WORLD_OF_HURT_AND_SUFFERING


Really don't think this is a great idea. I'd rather chew broken glass. Have you got a good handle on permissions? That's the angle I'd recommend you look at. Just my CDN$0.034.
 
Old 06-11-2001, 08:12 PM   #3
roadie
LQ Newbie
 
Registered: Jun 2001
Location: Colorado
Distribution: Redhat
Posts: 15

Original Poster
Rep: Reputation: 0
*laugh*

I take it that's not a good idea eh?
ok.. how about just all directories within /var/www/html/? can I specify having more than one directory run cgi scripts? Hrm...
-Eliot
 
Old 06-12-2001, 11:32 AM   #4
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
If you do want to enable CGI everywhere add
Code:
ExecCGI
options line in the <directory /> section of your httpd.conf. Then restart apache.

To just enable this for /var/www/html you would create a new <directory> entry that looks something like
Code:
<directory /var/www/html>
    Options +ExecCGI
</directory>
Note the use of the +. This means that you keep the options inherited from / and add the ExecCGI option. If the above line just read
Code:
Options ExecCGI
then it would enable CGI and disable all other options (like FollowSymLinks etc.).

You can have as many CGI dirs as you like. Any subdirectorys will also have the ExecCGI option enable so you may need to add <directory> entries for those to disable CGI where necessary. Clearly if this is a little home system then having CGIs executable from anywhere probably won't matter, but as mcleodnine has mentioned its not a good idea on a 'real' server.

HTH

Jamie...
 
Old 06-13-2001, 11:47 PM   #5
roadie
LQ Newbie
 
Registered: Jun 2001
Location: Colorado
Distribution: Redhat
Posts: 15

Original Poster
Rep: Reputation: 0
ack

I tried your idea, and I've changed everything in there. even the scriptalias. Here's what I have right now.

ScriptAlias /cgi-bin/ "/var/www/html/comments"

<Directory "/var/www/html/comments">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

I still can't get my cgi script to work, it worked on a different server, until I moved it over here. It's a guestbook, and it gives me this:
Method Not Allowed
The requested method POST is not allowed for the URL /comments/comments.cgi.

No matter what I do to httpd.conf (and yes, i am rebooting httpd)
It still gives me that. I'm quite annoyed with it. Please point out my flaw.
-Eliot
 
Old 06-14-2001, 12:20 PM   #6
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
Have you chmod'd the file CGI file to atleast 755, also is the CGI handler enabled? Have a look for the following lines in httpd.conf (they're not all in the same place):
Code:
LoadModule cgi_module         libexec/mod_cgi.so
AddModule mod_cgi.c
    #
    # AddHandler allows you to map certain file extensions to "handlers",
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action command (see below)
    #
    # If you want to use server side includes, or CGI outside
    # ScriptAliased directories, uncomment the following lines.
    #
    # To use CGI scripts:
    #
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
HTH

Jamie...
 
Old 06-16-2001, 07:15 PM   #7
roadie
LQ Newbie
 
Registered: Jun 2001
Location: Colorado
Distribution: Redhat
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks

Wow.. Yeah. I knew there had to be something else. i skimmed the entire file, but missed that addhandler cgi script line. thanks. I also ran into some problems with the cgi file not being chowned to user apache group apache
That was odd, cause I've never had to worry about that before.. *shrug* Anyway, it's fixed now. Thanks for the help
-Eliot
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
configuring cgi-bin in apache gtgoku Linux - General 1 01-19-2004 06:22 AM
Redhat 9 / Apache / cgi-bin ???? jeff0628 Linux - General 16 10-18-2003 06:50 AM
Apache server and cgi-bin? WorldBuilder Linux - Networking 15 09-18-2003 12:13 PM
.htaccess and cgi-bin (apache of course) finegan Linux - Software 4 05-01-2003 04:21 PM
no access to cgi-bin within Apache Mackeral Linux - Software 6 05-14-2002 05:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:05 AM.

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