Running .cgi and .pl scripts from any subdirectory in Apache
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
There is a lot in the httpd.conf file and it looks like I can mess things up pretty bad by entering the incorrect information. I guess that is where I am stuck.
All I am looking at doing is allowing any .cgi and .pl script to run under the directory /var/www/html and all subdirectories.
Is it correct to just add
<Directory "/var/www/html">
Options ExecCGI
AddHandler cgi-script .cgi .pl
order allow,deny
allow from all
</Directory>
There is only one ScriptAlias directory per host(or VirtualHost). If you need additional locations to run cgi, that's why ExecCGI exists. Since your scripts run in cgi-bin, that is presumably already ScriptAlias'ed. (ScriptAlias behaves as Alias+ExecCGI)
Not sure you need AddHandler again in there if it's working globally.
.htaccess may not work unless you have a proper AllowOverride, depends on your globals. Easiest to get it working, then dial down authentication.
File ownership and permissions will bite you too......not that I've ever made that mistake myself.
Have you set the permissions on your cgi scripts to be
'executable by all users'? Do all users have permission to enter
the directory where the scipts are stored?
Have you set the permissions on your cgi scripts to be
'executable by all users'?
Yes. For sure. I also tried changing ownership to apache with same results.
Quote:
Originally Posted by shaunw
Do all users have permission to enter
the directory where the scipts are stored?
Would you mind expanding on this a little. It should be ok. The script that I have needs to access files in another directory, but further up in the same branch.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.