Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Apache/Perl question



On Thu, Aug 18, 2005 at 09:41:21PM -0400, Ronny Serrano wrote:
> 
> I have a server that is running linux and apache on it at a hosted site.
> A new requirement we have is to run some perl scripts on the box. I've
> gone in and modified the httpd.conf file and restarted apache. The
> following are the entries that I modified were the following:
> 
> ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
> 
> #
> # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
> # CGI directory exists, if you have that configured.
> #
> <Directory "/var/www/cgi-bin">
>     AllowOverride None
>     Options None
>     Order allow,deny
>     Allow from all
> </Directory>
> 
> AddHandler cgi-script .cgi .pl
> 
> On the options line I've tried ExecCGI, +ExecCGI and All. 
> The directory/scriptalias points to the correct directory. I've set the
> rights on the script as 755. For some reason I get a Forbidden or a 403
> everytime I try to run one of these scripts directly over http. The
> scripts are placed in the /var/www/cgi-bin directory. What am I missing?
> I'm not using any .htaccess file.. Not that I know of. Should the rights
> to the cgi-bin directory be 755 also? Any help would be greatly
> appreciated.

You certainly need ExecCGI as an Option.  Other than that, make sure the
owner of the Apache process (usually www-data, apache, or nobody) has
the correct permissions to read and execute files in the ScriptAlias'ed
directory.  Since you've chmod'ed the scripts to 755, it's most likely a
permissions problem on /var, /var/www, or /var/www/cgi-bin.  Make sure
these dirs are 755 as well.

The AddHandler directive specifies extensions for files _outside_ of the
ScriptAlias'ed directory that you want to execute as CGI scripts.  You
still need to add the ExecCGI option to the non-ScriptAlias'ed
directories you want to place the .cgi and .pl files in.

I'm not sure why it wouldn't be by default, but you can also check to
make sure that mod_cgi is being loaded.

-David




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org