Errin when executing a cgi script that sets a cookie in the browser
Νικόλαος Κούρας
nikos.gr33k at gmail.com
Thu Jun 6 15:01:29 EDT 2013
Τη Πέμπτη, 6 Ιουνίου 2013 9:40:04 μ.μ. UTC+3, ο χρήστης ru... at yahoo.com έγραψε:
> On 06/06/2013 04:53 AM, Νικόλαος Κούρας wrote:> I have re-enabled 'suexec' and set cgi as default phphandler and then trying:
>
> >
>
> > print( cookie )
>
> > print( '''Content-type: text/html; charset=utf-8\n''' )
>
> > print( message )
>
> >
>
> > ---------------------------------
>
> > nikos at superhost.gr [~/www/data/apps]# [Thu Jun 06 13:51:28 2013] [error] [client 79.103.41.173] suexec failure: could not open log file
>
> > [Thu Jun 06 13:51:28 2013] [error] [client 79.103.41.173] fopen: Permission denied
>
> > [Thu Jun 06 13:51:28 2013] [error] [client 79.103.41.173] Premature end of script headers: koukos.py
>
> >
>
> > Even if dissable/enable suexec still this output error.
>
>
>
> This is only a guess but...
>
>
>
> The permissions on koukos.py have to be exactly right.
>
> Obviously if they are too restrictive Apache won't be
>
> able to read or execute it. But they can't be to open
>
> either -- in particular the file must have execute
>
> permission and must not have write permission for either
>
> group or others (write for user only).
>
>
>
> If the permissions are too open, Apache will try to write
>
> an error message to suexec.log. I suspect that your
>
> permissions (or file owner) is wrong on your suexec.log
>
> file (or containing directory) and that is the cause of
>
> the "could not open log file " message.
>
>
>
> So I think you have too problems: wrong permissions on
>
> koukos.py and wrong owner or permissions on suexec.log.
>
>
>
> For reference this is working here:
>
> -rw-r--r-- 1 apache apache 314 Jun 6 12:19 /var/log/httpd/suexec.log
>
>
>
> -rwxr-xr-x 1 me me 1113 Jun 5 14:40 koukos.py
>
>
>
> You'll need to adjust things for your particular Apache
>
> environment.
>
>
>
> As I said, this is only a guess. Hope it helps.
Hello! thanks for trying to help.
Here they are:
nikos at superhost.gr [~/www/cgi-bin]# ls -l koukos.py
-rwxr-xr-x 1 nikos nikos 1160 Jun 6 06:27 koukos.py*
nikos at superhost.gr [~/www/cgi-bin]# ls -l /var/log/httpd/suexec.log
-rw-rw-rw- 1 root apache 0 Jun 1 02:52 /var/log/httpd/suexec.log
nikos at superhost.gr [~/www/cgi-bin]# ls -l /usr/local/apache/logs/suexec_log
-rw-rw-r-- 1 root apache 675097 Jun 6 21:43 /usr/local/apache/logs/suexec_log
I have applied to them the group 'apache' so Apache User can utilize them.
But its still a wonder to me why two different suexec logs exist.
Please tell me wht else you want me to try.
More information about the Python-list
mailing list