LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-13-2006, 10:31 PM   #1
CompleteNoob
LQ Newbie
 
Registered: Jan 2006
Location: NJ
Distribution: Debian
Posts: 9

Rep: Reputation: 0
Perl on debian question


Hey guys. Just setup a LAMP server (apache2, php5, mysql5). Heres my question. Can I setup apache2 to run perl scripts from the htdocs folder? and how do I know if perl is even working? Im assuming it came with debian.

Thanks in advance.
 
Old 02-13-2006, 10:37 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
perl -v will tell you if it's there and what version it is.

The ScriptAlias directive tells Apache that everything in a directory is a script and not a document. That's probably not exactly what you need - can you put the scripts in a sub-directory of the document directory?
 
Old 02-13-2006, 10:46 PM   #3
CompleteNoob
LQ Newbie
 
Registered: Jan 2006
Location: NJ
Distribution: Debian
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for the quick response. If I use the cgi-bin do I have to redirect there? eg. http://localhost/cgi-bin/foo.cgi?
 
Old 02-13-2006, 11:12 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Actually, a simpler way to do it might be with the AddHandler directive. It allows specific files within a location to be marked as scripts. For example, in my Bugzilla setup I have the following to allow CGI scripts to be executed:
Code:
Alias /bugzilla /usr/local/bugzilla-2.20
<Directory /usr/local/bugzilla-2.20>
  AddHandler cgi-script .cgi
  Options +Indexes +ExecCGI +FollowSymLinks
  DirectoryIndex index.cgi
  AllowOverride Limit
  Order allow,deny
  Allow from all
</Directory>
 
Old 02-15-2006, 08:52 PM   #5
CompleteNoob
LQ Newbie
 
Registered: Jan 2006
Location: NJ
Distribution: Debian
Posts: 9

Original Poster
Rep: Reputation: 0
OK, forgive the stupidity of this question but I'm not understanding. In my "htdocs" folder, I have my index page. However, I want to be able to run perl scripts in these pages. The cgi-bin folder is not in the htdocs folder, so to redirect a user there how do I do this? or is the cgi-bin supposed to be in htdocs?
 
Old 02-15-2006, 09:03 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
It's not a stupid question - I shouldn't have suggested the ScriptAlias directive in my first post. If you use the AddHandler command for the directory that your scripts live in, you can run the scripts without moving them to a cgi-bin directory.

Depending how curious you are, you can download Bugzilla from http://ftp.mozilla.org/pub/mozilla.o...la-2.20.tar.gz, extract it and see that they have a variety of scripts in their setup. But with the AddHandler directive set up the way I have it in my earlier post, only the .cgi files can be executed, not the .pl files.

You'd just use the suffix (.pl, .cgi, etc.) that suited your environment.
 
  


Reply



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
Can't compile XChat on Debian Sarge (Perl problem?) Ninja Cow Debian 4 04-15-2007 03:30 PM
reinstall perl question.. (urpme perl) rjcrews Mandriva 2 01-28-2006 06:19 PM
Compile Perl Gtk on debian? dicou Linux - General 2 04-25-2005 12:03 PM
Hiding code in PERL, perl gui question randomx Programming 1 06-26-2004 03:22 PM
writing a bash/ perl script on debian phr00ta Programming 4 01-29-2004 01:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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