[Nottingham] Apache 1.3 + CGI/Perl + suEXEC

Raphael Gangneux nlug at domainarena.net
Wed Oct 4 15:31:56 BST 2006


Hi Everyone,

I'm having problems with the execution of perl and cgi scripts for one of my
sites (and for any site on the box actually...).

The box is running Fedora C2 with apache 1.3.
Module suEXEC is loaded.

The vhost block is as follow:
################################
<VirtualHost XXX.XXX.XXX.XXX:80>
SuexecUserGroup #526 #513
ServerName domain.com
DocumentRoot /home/user/public_html
ErrorLog /home/user/logs/error_log
CustomLog /home/user/logs/access_log common ScriptAlias /cgi-bin/
"/home/user/cgi-bin/"
   <Location /cgi-bin>
        Options +ExecCGI
   </Location>
</VirtualHost>
################################ 

Permissions and ownership in cgi-bin dir as follow:
[root at ns]$ ls -lha /home/user/cgi-bin/
total 132K
drwxr-xr-x  2 user  user 4.0K Oct  4 12:49 .
drwxr-xr-x  6 user user 4.0K Oct  4 12:08 ..
-rwxr-xr-x  1 user user 51K Oct  4 12:21 BFormMail.pl -rwxr-xr-x  1 user
user 42 Oct  4 12:46 test.cgi



Any time I try to run that BFormMail script I get:
>From error_log:
[Wed Oct 04 14:32:48 2006] [error] [client ip.ip.ip.ip] Premature end of
script headers: BFormMail.pl, referer: http://www.domain.com/contacts.htm

>From suexec.log:
[2006-10-04 14:32:48]: uid: (526/user) gid: (513/513) cmd: BFormMail.pl
[2006-10-04 14:32:48]: command not in docroot
(/home/user/cgi-bin/BFormMail.pl)

I replaced the real domain by domain.com and the user by user for this
exercise only...

I have the same kind of setup on another box running Debian Sarge stable
with Apache2 and mod_suexec and  it works a treat...

Any comments on this would be much appreciated as I'll have no hair left
soon!!!

Thanks in advance.


Regards,

------------------------

Raphael Gangneux





More information about the Nottingham mailing list