LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-12-2006, 06:26 PM   #1
cheycomm
LQ Newbie
 
Registered: Mar 2006
Posts: 6

Rep: Reputation: 0
Apache CGI problems


SuSE 10
Apache2

I just enable cgi on my apache2 server and when I point a browser to the script it tries to download it instead of executing it.

It works if I use the extension .cgi but .pl will only try to download, both files are identical with the exception of the extension.

I have tried adding "AddType cgi-script .pl" to the mod_mime0defaults.conf as well as the mime.types file. I also tried adding AddHandler to the directory directive.

Please help, I have been fighting this for hours and am dumbfounded.

Thanks,
 
Old 03-12-2006, 06:57 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Can you post the section of your httpd.conf file where you used the AddHandler directive? It should have worked - here is an example for a Bugzilla box (I added the .pl to the AddHandler directive only to show the syntax):
Code:
<Directory /usr/local/bugzilla-2.20.1>
  AddHandler cgi-script .cgi .pl
  Options +Indexes +ExecCGI +FollowSymLinks
  DirectoryIndex index.cgi
  AllowOverride Limit
  Order allow,deny
  Allow from all
</Directory>
 
Old 03-12-2006, 07:05 PM   #3
cheycomm
LQ Newbie
 
Registered: Mar 2006
Posts: 6

Original Poster
Rep: Reputation: 0
This is what I have listed in the default-server.conf file. It is included

ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"

# "/srv/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/srv/www/cgi-bin">
AddHandler cgi-script .pl
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>
 
Old 03-12-2006, 08:15 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
That's odd - the one I posted above works for .cgi or .pl files. The only way I could make it stop was to add a .htaccess file to the directory to deny access to .pl files. Do you use .htaccess files at all?
 
Old 03-12-2006, 10:08 PM   #5
cheycomm
LQ Newbie
 
Registered: Mar 2006
Posts: 6

Original Poster
Rep: Reputation: 0
I am using it, in other directories, not in this one.
 
Old 03-12-2006, 10:23 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Apart from confirming that the file is executable by whatever user Apache is running as, have you had a look at http://httpd.apache.org/docs/2.0/how...l#troubleshoot?
 
Old 03-12-2006, 10:58 PM   #7
cheycomm
LQ Newbie
 
Registered: Mar 2006
Posts: 6

Original Poster
Rep: Reputation: 0
rights are properly set, -rwxr-xr-x. I will review the docs, thanks for your help.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache CGI problems clb Linux - Networking 2 11-24-2004 11:03 AM
Apache 1.4.7 cgi problems Sm0k3 Programming 1 10-19-2003 03:12 PM
Problems with apache and cgi Joshsawyer77 Linux - General 3 01-25-2003 02:39 PM
Problems CGI apache Joshsawyer77 Linux - Software 5 01-23-2003 09:56 PM
Apache and SSI/CGI PROBLEMS morbo Linux - Networking 2 01-18-2003 05:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:14 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