Running .cgi and .pl scripts from any subdirectory in Apache
I have searched Google and this site and am still confused.
How and what do I need to change in the httpd.conf file to allow running of .pl and .cgi scripts from anywhere on my server? I tried a .htaccess file but it doesn't seem to do anything. Since they work in the cgi-bin directory and not others, its a configuration thing. Please help. |
|
Thanks. I read that one as well from my searches.
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> and what should I put for a ScriptAlias? |
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. |
I had to put this on the back burner for a little while, but I am now back. Problems still exist. They do not seem consistant.
In one directory when I run a rather simple script, I get this error -> Software Error: permission denied (on a file that is trying to be updated. Then in another subdirectory on a more complex script I get this error -> Error 500 with Premature end of script headers: I have tried to follow what is being suggested above, but I am still somewhat confused with this permissions thing. |
Here's what gets me is that the .cgi scripts work just fine from the command prompt.
|
cgi scripts
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? |
Quote:
Quote:
|
Problem solved -> http://www.linuxquestions.org/questi...d.php?t=426662
|
All times are GMT -5. The time now is 07:31 AM. |