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. |
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? |
Thanks for the quick response. If I use the cgi-bin do I have to redirect there? eg. http://localhost/cgi-bin/foo.cgi?
|
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 |
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?
|
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. |
All times are GMT -5. The time now is 11:35 PM. |