Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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>
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.