BackupPC-users

Re: [BackupPC-users] Backup, Lighttp and my mess

2009-10-06 08:44:00
Subject: Re: [BackupPC-users] Backup, Lighttp and my mess
From: Holger Parplies <wbppc AT parplies DOT de>
To: Laura_marpplet <backuppc-forum AT backupcentral DOT com>, cuentatemporal AT wanadoo DOT es
Date: Tue, 6 Oct 2009 14:14:05 +0200
Hi,

Laura_marpplet wrote on 2009-10-05 13:33:31 -0400 [[BackupPC-users]  Backup, 
Lighttp and my mess]:
> [...]
> But when I try to run the CGI script I got a "500 - Internal Server Error".
> Reading the lighttpd error file it just says "Can't access() script". I
> checked the permissions and they look good to me (/srv/lighttpd/cgi-bin/):
> 
> -r-sr-xr--  1 backuppc backuppc 3995 Oct  5 17:54 BackupPC_Admin.pl
> -rwsr-xr--  1 root     root     3993 Oct  2 14:10 sample2.pl
> -rw-r--r--  1 root     root      116 Oct  2 14:09 sample.pl

this really says nothing about the web server's ability to access the files.
sample.pl and sample2.pl are accessible to user root and group root.
BackupPC_Admin.pl is accessible to user backuppc and group backuppc. Presuming
lighttpd is not running as user root, but as a user in *group* root but not in
group backuppc, what you are observing makes perfect sense.

> I can also run "sample.pl" and "sample2.pl" with no problems. It doesn't
> work either if the owner is "root".

If lighttpd were running as user root, it could access BackupPC_Admin.pl no
matter who it belongs to. I'd guess it's the group membership that makes the
difference.

All of that said, it could probably be a completely different problem, but the
error message points in this direction (presuming "access()" refers to the
system call). If it's not permissions (which you could fix by either
'chmod a+x BackupPC_Admin.pl' or 'chgrp root BackupPC_Admin.pl' or even adding
the user lighttpd is running as to the group backuppc in /etc/group -
depending on which of those fits your taste and security needs best), you
could try some other things:

- perl -c BackupPC_Admin.pl
  Is your script garbled in some way that makes it syntactically incorrect or
  unable to find its library files? You might have to temporarily remove the
  setuid bit from the permissions for this test.

- Look at the first line of the script ('head -1 BackupPC_Admin.pl'). Is the
  path to the Perl binary correct? (Don't know if that's relevant for
  lighttpd.)

- Give us more information on your setup (which version of BackupPC, what
  OS and version, what user is lighttpd running as, where did you install
  BackupPC to (which paths), is SElinux enabled, output of
  'md5sum BackupPC_Admin.pl' ...).

But try fixing the permissions first, that seems to be the most likely
problem.

Regards,
Holger

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/