LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-06-2003, 08:45 PM   #1
adrianmak
Member
 
Registered: Dec 2002
Posts: 56

Rep: Reputation: 15
Have problem running .pl perl script in apache


my linux is RH9.0
apache 1.3.29

here is some directives I added to httpd.conf to work with perl script

ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"

<Directory "/usr/local/apache/cgi-bin">
AllowOverride None
Options FollowSymLinks +ExecCGI
Order allow,deny
Allow from all
</Directory>

AddHandler cgi-script .pl .cgi



And here is my testing perl script

#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "perl script run properly!\n";


My question is, if the perl script with a .pl extension, web browser just ask me to save the script. However without a .pl extension or with .cgi extension, the script can run properly.

who knows what's the problem ? Anything wrong on my httpd.conf ?
 
Old 11-06-2003, 09:21 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
After adding the .pl did you restart the apache server so it knows to recognize those as an executable script, etc?
 
Old 11-06-2003, 10:22 PM   #3
adrianmak
Member
 
Registered: Dec 2002
Posts: 56

Original Poster
Rep: Reputation: 15
yes sure. I restarted apache
 
Old 11-09-2003, 11:51 PM   #4
Mitchell
LQ Newbie
 
Registered: Nov 2003
Posts: 9

Rep: Reputation: 0
Did you perhaps forget to set the perl script as executable? Also note that the script would have to be executable by the user that apache runs as!.
 
Old 11-10-2003, 10:31 AM   #5
adrianmak
Member
 
Registered: Dec 2002
Posts: 56

Original Poster
Rep: Reputation: 15
i have made the script executable and apache should have permission to run the script
 
  


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
Running a Perl script with SendMail NewByy Linux - Newbie 4 08-25-2005 02:02 PM
Running a perl script bobfinners Linux - Software 1 06-23-2005 06:18 PM
running perl script dav_y2k Linux - Newbie 3 04-25-2005 06:00 AM
Apache CGI Problem : Browser not running script Zaknafien Linux - Software 3 12-31-2003 02:16 PM
Perl script not running on FreeBSD J_Szucs *BSD 12 07-13-2002 10:05 AM


All times are GMT -5. The time now is 10:15 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration