Solved

cgi-bin directory doesn't work

Posted on 2001-06-13
9
218 Views
Last Modified: 2013-11-18
I'm running RH Linux 7.0 with Apache web server.  When I try to run a .pl file or a .cgi file from cgi-bin, it (MSIE) prompts me to 'open file' or 'download file'.  I've never had this problem before with any other versions of Linux.  I already did a chmod 755 on the cgi-bin directory and all the files in it.  It still won't execute the files.  I'm running Linux 7.0 and it recommends that I don't modify the /etc/httpd/conf/access.conf file.  Only the /etc/httpd/conf/httpd.conf file.  What do I modify to allow execution of the files from a browser?  There IS a ExecCGI option in httpd.conf for <Directory /var/www/cgi-bin>.  HELP!
0
Comment
Question by:GorGor2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
9 Comments
 

Author Comment

by:GorGor2
ID: 6189494
oops, I'm running RHLinux7.1, not 7.0.  Not that it really matters.
0
 
LVL 8

Accepted Solution

by:
bebonham earned 50 total points
ID: 6193199
http://httpd.apache.org/docs/mod/mod_alias.html#scriptalias


if you want to put cgi in another directory other than the main scriptAlias

To persuade Apache to execute scripts in other locations, such as in directories where normal documents may also live, you must tell it how to recognize them - and also that it's okay to execute them. For this, you need to use something like the AddHandler directive.


In an appropriate section of your server configuration files, add a line such as

AddHandler cgi-script .cgi

The server will then recognize that all files in that location (and its logical descendants) that end in ".cgi" are script files, not documents.

Make sure that the directory location is covered by an Options declaration that includes the ExecCGI option.

In some situations, you might not want to actually allow all files named "*.cgi" to be executable. Perhaps all you want is to enable a particular file in a normal directory to be executable. This can be alternatively accomplished via mod_rewrite and the following steps:


Locally add to the corresponding .htaccess file a ruleset similar to this one:

RewriteEngine on
RewriteBase /~foo/bar/
RewriteRule ^quux\.cgi$ - [T=application/x-httpd-cgi]

Make sure that the directory location is covered by an Options declaration that includes the ExecCGI and FollowSymLinks option.


Bob
0
 

Author Comment

by:GorGor2
ID: 6193210
hmmm...the cgi-bin directory I'm trying to execute from IS the default cgi-bin directory that apache uses though....any ideas?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 8

Expert Comment

by:bebonham
ID: 6193346
sorry, I sure don't know apache...

I think the key is to set the directory as a ScriptAlias...

have you done that?

if so, I will quitely exit this question :)
0
 
LVL 6

Expert Comment

by:christopher sagayam
ID: 6193579
where is your cgi-bin located ? I mean the full path ..
0
 

Author Comment

by:GorGor2
ID: 6193619
/var/www/cgi-bin/ is the full path

I have entries for 'Alias' 'ScriptAlias' 'Directory' 'AddHandler cgi-script .cgi' and everything in httpd.conf.  Everything appears to be ok, but it still doesn't work!
0
 
LVL 17

Expert Comment

by:psimation
ID: 6196295
I think you need to have a .htaccess file containing the following in your root folder for that web as well

Allow override All
Options ExecCGI Includes

NB, file must be called .htaccess ( note the .)
0
 

Author Comment

by:GorGor2
ID: 6196736
The really strange thing is that in Netscape, there is no prompt.  Only in MSIE.  It never did this before with any other installation of Linux and Apache.
0
 
LVL 17

Expert Comment

by:psimation
ID: 6197196
If it's virtual domains, you MUST have a <Directory> directive inside the <VirtualHost> section for the domain stating the Options ExecCGI etc...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to count occurrences of each item in an array.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

630 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