I, a relative linux n00b, am trying to set up an Apache web server on a random old box running Debian (sarge, I do believe. I also don't think this is at all the problem). I have Apache2 (the version that one obtains through apt-get) up and running - it serves html and so forth. However, I set up this server for the purpose of first learning perl, and then using it in some CGI. It's not working. I get 403'd when I try to execute cgi scripts in /var/www or cgi-bin.
What I have tried so far:
- chmod 755
script-name.cgi
- chmod 755 /var/www
- adding either Options +ExecCGI or Options ExecCGI (inside <Directory /var/www> tags)
- ScriptAlias'ing cgi-bin and trying to run it from there
- chmod 755 /usr/local/cgi-bin
- testing the script by running it in the shell (it runs just fine)
- some other random stuff, which I didn't thoroughly understand, involving mod_perl (I was fortunately able to reverse the damage)
- AddHandler cgi-script .cgi
- AddType application/perl .cgi
What it keeps doing is giving me this rather unfortunate message in the error log:
[date][error][client ***.***.***.***][Options ExecCGI is off in this directory: /var/www/index.cgi]
when it clearly couldn't be off.
By the way, I am accessing the server from another computer on my LAN.
Here is my apache2.conf, if it is of any help:
Code:
ServerRoot "/etc/apache2"
LockFile /var/lock/apache2/accept.lock
PidFile /var/run/apache2.pid
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 20
MaxRequestsPerChild 0
</IfModule>
# pthread MPM
# StartServers ......... initial number of server processes to start
# MaxClients ........... maximum number of server processes allowed to start
# MinSpareThreads ...... minimum number of worker threads which are kept spare
# MaxSpareThreads ...... maximum number of worker threads which are kept spare
# ThreadsPerChild ...... constant number of worker threads in each server process
# MaxRequestsPerChild .. maximum number of requests a server process serves
<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
# perchild MPM
# NumServers ........... constant number of server processes
# StartThreads ......... initial number of worker threads in each server process
# MinSpareThreads ...... minimum number of worker threads which are kept spare
# MaxSpareThreads ...... maximum number of worker threads which are kept spare
# MaxThreadsPerChild ... maximum number of worker threads in each server process
# MaxRequestsPerChild .. maximum number of connections per server process (then it dies)
<IfModule perchild.c>
NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 0
AcceptMutex fcntl
</IfModule>
User www-data
Group www-data
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
ErrorLog /var/log/apache2/error.log
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
Include /etc/apache2/httpd.conf
Include /etc/apache2/ports.conf
Include /etc/apache2/conf.d/[^.#]*
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
UseCanonicalName Off
TypesConfig /etc/mime.types
DefaultType text/plain
HostnameLookups Off
IndexOptions FancyIndexing VersionSort
ReadmeName README.html
HeaderName HEADER.html
IndexIgnore .??* *~ *# HEADER* RCS CVS *,t
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
AddType application/x-tar .tgz
AddHandler cgi-script .cgi .pl
Include /etc/apache2/sites-enabled/[^.#]*
AddType application/perl .cgi
ScriptAlias /cgi-bin /usr/local/cgi-bin
<Directory /var/www>
AllowOverride All
Options +ExecCGI
</Directory>
Thanks - any help shall be greatly appreciated.