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

Configuring Apache to Permit CGI Debian Jessie Apache2 2.4

Hi all,

I’m new to sysadmin and Apache configuration. Trying to get AWStats running, but in troubleshooting have gotten to trying to run a simple Hello World (html output) script on port 8888 and have been hitting a wall of 403 Forbidden.

It’s not the script:
mikekilmer@glitchbox:/var/www/html$ perl /usr/lib/cgi-bin/hello.pl
Content-type: text/html


<TITLE>Hello, world!</TITLE>

<H1>Hello, world!</H1>


Shebang matches path to perl: #!/usr/bin/perl

These are the main config settings:
<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied

<Directory /usr/share>
        AllowOverride None
        Require all granted

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted

Directory and file permissions are 755 and 644 with ownership being root:root (on cgi-bin, perl files).

Apache’s html/index.html shows up:

This is what the error log says:
[Sat Jun 06 05:53:24.412867 2015] [authz_core:error] [pid 28374:tid 140381836453632] [client] AH01630: client denied by server configuration: /usr/local/apache2

I think maybe I’m missing something with Configuring Apache to permit CGI.

1. Note: If Apache has been built with shared module support you need to ensure that the module is loaded; in your apache2.conf you need to make sure the LoadModule directive has not been commented out. A correctly configured directive may look like this:
LoadModule cgi_module modules/mod_cgi.so

I don’t know if it was built with shared module support. Installed with apt-get. Not finding the line LoadModule in the config file. Trying to add above line Apache won’t restart.

2. There is one ScriptAlias in the config file, put there by AWStats. Adding this directive `ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/` didn’t seem to do anything. I even tried moving my hello (or should i say hellp) script into `/usr/local/apache2/cgi-bin/` still 403.

Explicitly using Options
Even tried adding
    Options +ExecCGI
    AddHandler cgi-script .cgi
to the <Directory /var/www/> directive.

All to no avail. Any ideas for next step?

Thanks mucho.

Michael Kilmer
Media Zen Organic Outreach 
Music, Theater, Multimedia and Web Development

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply to: