SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
Unable to access cgi interface
Author Message
Post Unable to access cgi interface 
Hello all:

I need a bit of help to run my install of backuppc. Details as follows:

Server is an AMD Athlon 1300, 256Mb RAM, 60 Gb HDD running a fresh install
of SuSE Linux 8.1
- Apache is running
- Perl cgi's installed by SuSE runned OK
- Apache has mod_perl installed (but I will try a setuid install)
-

To star I runned
opt/local/bin/BackupPC -d

It runs without confirmation messages on screen.

Then I take a look at backuppc/log/log the content of two starts is:

----------------------------------------------------------------------
2003/4/5 01:00:00 Running BackupPC_nightly (pid=1397)
2003/4/5 01:00:00 Next wakeup is 2003/4/5 02:00:00
2003/4/5 01:00:00 Pool nightly clean removed 0 files of size 0.00GB
2003/4/5 01:00:00 Pool is 0.00GB, 0 files (0 repeated, 0 max chain, 2 max
links), 1 directories2003/4/5 01:00:00 Cpool nightly clean removed 0 files of size 0.00GB
2003/4/5 01:00:00 Cpool is 0.00GB, 0 files (0 repeated, 0 max chain, 2 max
links), 1 directories2003/4/5 01:00:01 Finished admin (BackupPC_nightly)
2003/4/5 01:00:03 backup failed on pc2 (Can't find host pc2)
2003/4/5 01:27:22 Got signal TERM... cleaning up
2003/4/5 02:22:06 Reading hosts file
2003/4/5 02:22:06 BackupPC started, pid 1401
2003/4/5 02:22:06 Running BackupPC_trashClean (pid=1402)
2003/4/5 02:22:06 Next wakeup is 2003/4/5 03:00:00
-------------------------------------------------------------------

Then I run __INSTALLDIR__/bin/BackupPC_serverMesg status info

-------------------------------------------------------------
Got reply: %Info = ("poolFileCntRep" => 0,"cpoolFileCntRep" =>
0,"DUDailyMaxReset" => 0,"cpoolFileCnt" => 0,"cpoolFileCntRm" =>
0,"poolFileCnt" => 0,"DUDailyMaxTime" => "1049497200","pid" =>
1401,"cpoolKb" => 4,"startTime" => "1049502126","DUDailyMaxPrev" =>
10,"poolFileCntRename" => 0,"poolDirCnt" => 1,"cpoolKb2" => 0,"cpoolTime"
=> "1049497200","cpoolFileCntRename" => 0,"poolKb2" => 0,"nextWakeup" =>
"1049504400","Version" => "2.0.0beta1","DUlastValue" => 10,"HostsModTime"
=> "1049424631","poolKbRm" => 0,"cpoolFileRepMax" => 0,"poolFileCntRm" =>
0,"poolKb" => 4,"cpoolKbRm" => 0,"cpoolFileLinkMax" => 2,"ConfigModTime"
=> "1049425147","DUlastValueTime" => "1049497200","cpoolDirCnt" =>
1,"poolFileRepMax" => 0,"DUDailySkipHostCntPrev" => undef,"DUDailyMax" =>
10,"DUDailySkipHostCnt" => 0,"poolFileLinkMax" => 2,"poolTime" =>
"1049497200","DUDailyMaxStartTime" => "1049497200");-------------------------------------------------------------------
I have seen present the command /usr/bin/sperl5.8.0

I have tryed several permission combinations for
__CGIDIR__/BackupPC_Admin, actual for testing is:
backuppc < at > linux:/srv/www/cgi-bin> ls -l B*
-rwsrwsr-x 1 backuppc users 65863 2003-04-02 05:05 BackupPC_Admin


OK... testing cgi from local machine:

http://localhost/cgi-bin/BackupPC_Admin

output:
--------------------------------------------------------------------
Internal Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, webmaster < at > linux.local and inform
them of the time the error occurred, and anything you might have done
that may have caused the error.

More information about this error may be available in the server error log.


Apache/1.3.26 Server at linux.local Port 80
-------------------------------------------------------------------

snif.. OK going to error_log. Tail is:

-------------------------------------------------------------------
[Sat Apr 5 01:29:13 2003] [notice] Apache/1.3.26 (Linux/SuSE)
mod_python/2.7.8 Python/2.2.1 PHP/4.2.2 mod_perl/1.27 configured --
resuming normal operations[Sat Apr 5 01:29:13 2003] [notice] suEXEC mechanism enabled (wrapper:
/usr/sbin/suexec)[Sat Apr 5 01:29:13 2003] [notice] Accept mutex: sysvsem (Default: sysvsem)
Can't do setuid
[Sat Apr 5 02:06:30 2003] [error] [client 127.0.0.1] Premature end of
script headers: /srv/www/cgi-bin/BackupPC_Adminlinux:/var/log/httpd #
----------------------------------------------------------------

I have seen in the documentation that when using mod_perl with BackupPC
you need to create .htaccess for authentication or use LDAP. I suppouse I
don't need this for setuid install.

Any ideas? I don't know what to do now.

Thanks in advance: Javier Gonzalez




-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth!
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
BackupPC-users mailing list
BackupPC-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Post Unable to access cgi interface 
On Fri, Apr 04, 2003 at 06:54:18PM +0200, javier < at > flextrade.net wrote:
-------------------------------------------------------------------
[Sat Apr 5 01:29:13 2003] [notice] Apache/1.3.26 (Linux/SuSE)
mod_python/2.7.8 Python/2.2.1 PHP/4.2.2 mod_perl/1.27 configured --
resuming normal operations[Sat Apr 5 01:29:13 2003] [notice] suEXEC mechanism enabled (wrapper:
/usr/sbin/suexec)[Sat Apr 5 01:29:13 2003] [notice] Accept mutex: sysvsem (Default: sysvsem)
Can't do setuid
[Sat Apr 5 02:06:30 2003] [error] [client 127.0.0.1] Premature end of
script headers: /srv/www/cgi-bin/BackupPC_Adminlinux:/var/log/httpd #
----------------------------------------------------------------

It sounds like you may have suexec enabled in your Apache install.
Check the suexec log which is generally in __APACHE__/logs/suexec_log. I
found out the hard way that you have to run the script as the backuppc
user or else it won't work. Your mod_perl scripts are going to run as
the web user. I created a virtualhost and set the user to backuppc and
run the script as a cgi. Unfortunately, I still don't have any backups
yet, but it's not because my cgi script isn't working.

Good luck,
William

--
Knowmad Services Inc.
http://www.knowmad.com


-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth!
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
BackupPC-users mailing list
BackupPC-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Post Unable to access cgi interface 
Then I run __INSTALLDIR__/bin/BackupPC_serverMesg status info

Ok, it looks like BackupPC is running ok.

I have seen present the command /usr/bin/sperl5.8.0

I have tryed several permission combinations for
__CGIDIR__/BackupPC_Admin, actual for testing is:
backuppc < at > linux:/srv/www/cgi-bin> ls -l B*
-rwsrwsr-x 1 backuppc users 65863 2003-04-02 05:05 BackupPC_Admin


OK... testing cgi from local machine:

http://localhost/cgi-bin/BackupPC_Admin

What happens when you run BackupPC_Admin manually, ie, just run:

__CGIDIR__/BackupPC_Admin

(Use your actual path.) What output do you get? What happens when you
run it as the apache user (httpd?)?

The error_log output includes:

Can't do setuid

So it appears you have a setuid problem. Make sure that cgi-bin
is on a filesystem that doesn't have the nosuid mount option.

Failing that, experiment by creating this script:

#!/bin/perl

printf("My userid is $> (%s)\n", (getpwuid($>))[0]);

then chown it to backuppc and chmod u+s:

root# chown backuppc testsetuid
root# chmod u+s testsetuid
root# chmod a+x testsetuid
root# ls -l testsetuid
-rwsr-xr-x 1 backuppc wheel 76 Aug 26 09:46 testsetuid*

Now run this program as a normal user.

- What uid does it print?

- If it doesn't print backuppc, try changing the first line of the script
to be:

#!/usr/bin/sperl5.8.0

If you are unable to get the setuid stuff working you could instead
switch to mod_perl.

Craig

Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB