LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-03-2006, 12:45 AM   #1
dewert
LQ Newbie
 
Registered: May 2005
Location: Canada
Distribution: Slackware 12.1 on laptop, Slackware 12.0 on ancient desktop
Posts: 13

Rep: Reputation: 0
Apache2 on Debian won't execute perl cgi scripts, have tried chmod, Options ExecCGI


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.
 
Old 07-03-2006, 12:44 PM   #2
dewert
LQ Newbie
 
Registered: May 2005
Location: Canada
Distribution: Slackware 12.1 on laptop, Slackware 12.0 on ancient desktop
Posts: 13

Original Poster
Rep: Reputation: 0
Oh wow. I am an idiot. Turns out there is a lovely little file called 000-default in the sites-enabled/ directory which is overriding all my efforts in apache2.conf. *sigh* Will change some stuff there and see if it helps - methinks it will.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 cannot execute cgi files on a USB drive bhoult Linux - Software 2 07-11-2005 10:19 AM
how to execute shell scripts from cgi script rajatgarg Linux - General 1 07-08-2004 01:39 PM
Apache2 CGI-Perl will not read files fefeh Linux - Software 0 06-30-2003 08:07 PM
Apache Config for users to execute CGI scripts CragStar Linux - General 9 01-20-2003 12:37 AM
Can't execute *.cgi scripts. BrianG Linux - General 1 04-11-2001 03:38 AM


All times are GMT -5. The time now is 04:05 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration