Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Problem with apache server

by digioleg54 (Novice)
on May 11, 2017 at 14:27 UTC ( #1190065=perlquestion: print w/replies, xml ) Need Help??

digioleg54 has asked for the wisdom of the Perl Monks concerning the following question:

I have a problem with Apache on Linux. When I run the simple program, the error log sais:

suexec failure: could not open log file fopen: Permission denied failed to open log file /var/log/www/cgi_log: Permission denied (euid= +218637) failed whilst writing: Exec format error: exec failed Premature end of script headers

Could you help me to solve the problem?

Replies are listed 'Best First'.
Re: Problem with apache server
by derby (Abbot) on May 12, 2017 at 10:22 UTC

    Geez ... the number of non-answers here is not helpful. This could be a problem with your perl script -- does it try to write to /var/log/www/cgi_log -- or with your apache config. The main problem is either your cgi script or the apache server itself is trying to write to /var/log/www/cgi_log but the process does not have permission to write there. Check:

    • does your cgi-script write to /var/log/www/cgi_log .. if so, you cannot write there. Work with your apache admin to figure out where you can write (hint -- just write to STDERR and a properly config-ed apache will write to the proper log)
    • does your apache conf use /var/log/www/cgi_log as one of its' logs (look for CustomLog, ErrorLog, RewriteLog, etc) .. if so, then check what user your apache process runs as and ensure it has perms to write to /var/log/www/cgi_log or change your log to some place the running apache user can write to
    • and if /var/log/www/cgi_log is the *place* ... check its' permission and change them so the apache process user can write to it (I've had situations in the past where some off-line process would erroneously change permission on files it shouldn't have).

    -derby
Re: Problem with apache server
by Anonymous Monk on May 11, 2017 at 19:36 UTC

    Hi,

    Like CGI Help Guide says  use CGI::Carp qw/ fatalsToBrowser /;

    This avoids both the problems you reported, permission denied to open log file (an "admin" problem, he who configure apache and grant permissions), and premature end of script headers (your program)

    Every perl/CGI problem can be solved if you work through CGI Help Guide

    When you find a problem on the list, use a solution from the list,

    If you get stuck or find a problem not on the list, post the error message and problem description here

Re: Problem with apache server (OT?)
by LanX (Sage) on May 11, 2017 at 14:43 UTC
      We have Perl CGI programs on apache.

        That's like asking us for advice about a broken arm because you usually use your arms to type Perl code.

        Well, okay, maybe not quite that badů

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1190065]
Approved by beech
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2023-02-07 14:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (40 votes). Check out past polls.

    Notices?