Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
BackupPC/Admin/Apache2 web interface issue
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dspahn
Guru
Guru


Joined: 22 Jun 2006
Posts: 392

PostPosted: Tue Jan 16, 2007 10:40 pm    Post subject: BackupPC/Admin/Apache2 web interface issue Reply with quote

I am setting up BackupPC to check it out for use in my office. The test machine is a 3.4 GHz Pentium-D with 2GB RAM... Obviously plenty of muscle for a simple backup server. I previously had the software working on another machine (which was commandeered by other office needs) but I never figured out how to get the web interface up. I am not yet proficient with Linux, and am just beginning to learn how to use Apache for managing various applications (I have a working mythweb at home, and a couple of other little basic interfaces). When I navigate to the BackupPC web interface from a seperate machine (I don't have X on my BackupPC server), I get the following:

Code:

#!/usr/bin/perl #============================================================= -*-perl-*-w # # BackupPC_Admin: Apache/CGI interface for BackupPC. # # DESCRIPTION # BackupPC_Admin provides a flexible web interface for BackupPC. # It is a CGI script that runs under Apache. # # It requires that Apache pass in $ENV{SCRIPT_NAME} and # $ENV{REMOTE_USER}. The latter requires .ht_access style # authentication. Replace the code below if you are using some other # type of authentication, and have a different way of getting the # user name. # # Also, this script needs to run as the BackupPC user. To accomplish # this the script is typically installed as setuid to the BackupPC user, # or it can run under mod_perl with httpd running as the BackupPC user. # # AUTHOR # Craig Barratt # # COPYRIGHT # Copyright (C) 2001-2003 Craig Barratt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # #======================================================================== # # Version 2.1.2, released 5 Sep 2005. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; no utf8; use CGI; use CGI::Carp qw(fatalsToBrowser); use lib "/usr/lib"; use BackupPC::Lib; use BackupPC::CGI::Lib qw(:all); BackupPC::CGI::Lib::NewRequest; my %ActionDispatch = ( "summary" => "Summary", $Lang->{Start_Incr_Backup} => "StartStopBackup", $Lang->{Start_Full_Backup} => "StartStopBackup", $Lang->{Stop_Dequeue_Backup} => "StartStopBackup", $Lang->{Stop_Dequeue_Archive} => "StartStopBackup", "queue" => "Queue", "view" => "View", "LOGlist" => "LOGlist", "emailSummary" => "EmailSummary", "browse" => "Browse", "dirHistory" => "DirHistory", $Lang->{Restore} => "Restore", "RestoreFile" => "RestoreFile", "hostInfo" => "HostInfo", "generalInfo" => "GeneralInfo", "restoreInfo" => "RestoreInfo", "archiveInfo" => "ArchiveInfo", $Lang->{Start_Archive} => "Archive", "Archive" => "Archive", "Reload" => "ReloadServer", "startServer" => "StartServer", "Stop" => "StopServer", "adminOpts" => "AdminOptions", ); # # Set default actions, then call sub handler # $In{action} ||= "hostInfo" if ( defined($In{host}) ); $In{action} = "generalInfo" if ( !defined($ActionDispatch{$In{action}}) ); my $action = $ActionDispatch{$In{action}}; # # For some reason under mod_perl, the use lib above is unreliable, # and sometimes the module below cannot be found. Explicitly push # the directory onto INC if it is missing. This is an ugly hack; # need to figure out what's really going on... # my $installDir = '/usr/lib'; push(@INC, $installDir) if ( !grep($_ eq $installDir, @INC) ); # # Load the relevant action script and run it # require "BackupPC/CGI/$action.pm" if ( !defined($BackupPC::CGI::{"${action}::"}) ); $BackupPC::CGI::{"${action}::"}{action}();


I have tried re-emerging mod_perl, perl, CGI, I have run
Code:
BackupPC -Duva

as well as
Code:
emerge apache -Duva

and I have double-checked the configuration files.
I am navigating to http://[IP Address]/BackupPC.
I used the BackupPC documentation and the BackupPC page on gentoo-wiki.
The CGI test script on the wiki gives the following output:
Code:

#!/bin/sh

# disable filename globbing
set -f

echo Content-type: text/plain
echo

echo CGI/1.0 test script report:
echo

echo argc is $#. argv is "$*".
echo

echo SERVER_SOFTWARE = $SERVER_SOFTWARE
echo SERVER_NAME = $SERVER_NAME
echo GATEWAY_INTERFACE = $GATEWAY_INTERFACE
echo SERVER_PROTOCOL = $SERVER_PROTOCOL
echo SERVER_PORT = $SERVER_PORT
echo REQUEST_METHOD = $REQUEST_METHOD
echo HTTP_ACCEPT = "$HTTP_ACCEPT"
echo PATH_INFO = "$PATH_INFO"
echo PATH_TRANSLATED = "$PATH_TRANSLATED"
echo SCRIPT_NAME = "$SCRIPT_NAME"
echo QUERY_STRING = "$QUERY_STRING"
echo REMOTE_HOST = $REMOTE_HOST
echo REMOTE_ADDR = $REMOTE_ADDR
echo REMOTE_USER = $REMOTE_USER
echo AUTH_TYPE = $AUTH_TYPE
echo CONTENT_TYPE = $CONTENT_TYPE
echo CONTENT_LENGTH = $CONTENT_LENGTH


I copied/pasted from the httpd-backuppc.conf file given in the wiki to place those sections in my httpd.conf.Apache starts with a nice green
[ ok ]

I think I have a configuration issue, but I'm not sure where to begin. Any ideas? From what I have here, it looks like CGI is not working. What have I missed?
Thanks!

edit: I should also include the contents of /var/log/apache2/error_log:
Code:
[Tue Jan 16 12:46:57 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)
[Tue Jan 16 12:46:57 2007] [notice] Digest: generating secret for digest authentication ...
[Tue Jan 16 12:46:57 2007] [notice] Digest: done
[Tue Jan 16 12:46:57 2007] [notice] Apache configured -- resuming normal operations
Back to top
View user's profile Send private message
dspahn
Guru
Guru


Joined: 22 Jun 2006
Posts: 392

PostPosted: Wed Jan 17, 2007 12:09 am    Post subject: Authentication? Reply with quote

I know I must sound absolutely clueless, but I'm still trying to hammer this problem out.
I tried a different URL http://[IP Address]:8080 after messing with some configuration details.
I immediately get a popup dialog asking for authentication credentials. I created a user called 'admin' and gave it a password with htpasswd2. Apache is set to run as the backuppc user, and I have tried chmodding the web folders to that user. When I put the right credentials in, I get a 403 access denied error. I only have to put the correct credentials once to get this error- if I put in wrong credentials, it takes three times. So far, it could be one of the following:
backuppc user doesn't have proper permissions
bad authentication information
incorrect settings in httpd.conf

Here's what I think is the relevant section of httpd.conf:

Code:
<Directory "/var/www/localhost/htdocs/backuppc">
    AllowOverride AuthConfig
    Options Indexes FollowSymLinks ExecCGI Includes
    SetHandler cgi-script
    Order allow,deny
#    Allow from all
    Allow from 127.0.0.1 192.168.0.100
    AuthName "admin"
    AuthType Basic
    AuthUserFile /etc/backuppc/htpasswd.users
    Require valid-user
</Directory>


What should I change to make it work?
Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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