Problems with CGI/Perl

patrik

Verified User
Joined
Sep 6, 2006
Messages
128
A user tries to run a perl script in her cgi-bin directory but we only get Internal Server Error (classical perl/cgi error message).

Her error_log says this:
[Mon Dec 18 11:42:45 2006] [error] [client 85.227.160.115] File does not exist: /home/web26224/domains/mingeltraffen.se/public_html/500.shtml
failed to open log file
fopen: No such file or directory
[Mon Dec 18 11:42:45 2006] [error] [client 85.227.160.115] Premature end of script headers: /home/web26224/domains/mingeltraffen.se/public_html/cgi-bin/formmail.pl

What does it mean by "failed to open log file"?? Which log file? It certainly writes to the vhost's error_log.
  • The cgi-bin directory is executable
  • The script is owned by the user and has 755 perm
  • .htaccess in cgi-bin contains Options +ExecCGI
  • The shebang looks like this #!/usr/local/bin/perl -wT
  • The script can be run in the terminal, either directly or by invoking perl
  • The script runs well in /var/www/cgi-bin (http://[HOSTNAME]/cgi-bin/formmail.pl)
I'm out of ideas... I have googled on this but didn't anything that could help me. This forum contains a few threads with the same issue addressed but no solution that works for me :(

I need some help on this. It's strange that it runs in /var/www/cgi-bin but not in the user's own cgi-bin directory.
 
sure ... but have you safe_mode off, isn't it ?

By default it is not safe in /var/www/ (DA apache php config to be ameliored !) so it will run there in cgi ! (argh...)

seems you can google a little more to find the right tip to run cgi in the domain cgi. Courage !
 
Problem is solved but sadly I don't exactly know why. I re-compiled apache, got a few (other) problems with apache so I re-installed it several times until THAT problem was solved and that's when I noticed that the first issue also was gone.
 
A user tries to run a perl script in her cgi-bin directory but we only get Internal Server Error (classical perl/cgi error message).

Her error_log says this:


What does it mean by "failed to open log file"?? Which log file? It certainly writes to the vhost's error_log.
  • The cgi-bin directory is executable
  • The script is owned by the user and has 755 perm
  • .htaccess in cgi-bin contains Options +ExecCGI
  • The shebang looks like this #!/usr/local/bin/perl -wT
  • The script can be run in the terminal, either directly or by invoking perl
  • The script runs well in /var/www/cgi-bin (http://[HOSTNAME]/cgi-bin/formmail.pl)
I'm out of ideas... I have googled on this but didn't anything that could help me. This forum contains a few threads with the same issue addressed but no solution that works for me :(

I need some help on this. It's strange that it runs in /var/www/cgi-bin but not in the user's own cgi-bin directory.


OK i have the same problem and i found that:

failed to open log file
fopen: No such file or directory

is a problem with /var/log/httpd permission apache cant create suexec_log, so i changed the permissions. Then in suexec_log i have:

[2007-11-06 15:25:12]: info: (target/actual) uid: (torren/torren) gid: (torren/torren) cmd: test.cgi
[2007-11-06 15:25:12]: emerg: failed to setgid (118: test.cgi)

and i dont now what to do next, i have this:
  • The cgi-bin directory is executable
  • The script is owned by the user and has 755 perm
  • .htaccess in cgi-bin contains Options +ExecCGI
  • The shebang looks like this #!/usr/bin/perl
  • The script can be run in the terminal, either directly or by invoking perl
  • The script runs well in /var/www/cgi-bin but not in users virtualhost

HELP
 
Back
Top