BackupPC-users

[BackupPC-users] BackupPC on OpenSolaris

2009-03-30 06:47:13
Subject: [BackupPC-users] BackupPC on OpenSolaris
From: Simon Fishley <simonfishley AT gmail DOT com>
To: backuppc-users AT lists.sourceforge DOT net
Date: Mon, 30 Mar 2009 12:42:36 +0200
I have been trying to get this added to the Wiki on SourceForge but it
refuses to save my changes. Here then is a guide to installing
BackupPC on OpenSolaris10.  Please will someone try and get it onto
the wiki?

INSTALL BACKUPPC on SOLARIS (running onSunOS 5.10 Generic_138889-05
i86pc i386 i86pc). **Credit for all this hard work goes to Garith
Dugmore - THE Solaris Man.**

* Installation dependencies

 pkg-get -i samba_client par2cmdline apache2 apache2_manual
ap2_modphp5 ap2_modperl perl perldoc gcc4g++\
 pm_termreadkey pm_compressrawzlib pm_compresszlib pm_iocompresszlib
pm_iozlib rsync vim top sudo
 pkg install SUNWhea #Only on OpenSolaris

* Fix bug in IO:Compress:Zlib

 cd /tmp/
 wget 
http://search.cpan.org/CPAN/authors/id/P/PM/PMQS/IO-Compress-Zlib-2.015.tar.gz
 gzip -d IO-Compress-Zlib-2.015.tar.gz
 tar xf IO-Compress-Zlib-2.015.tar
 cd IO-Compress-Zlib-2.015
 CC=gcc /opt/csw/bin/perl Makefile.PL
 make
 make install

* Setup Sun Studio so we can use "cc" to compile.

 cd /tmp/
 wget StudioExpress-sol-x86-2008-11-v2-ii.sh (you will need to
register to get a url for this but it is free)
 mkdir /opt/studio
 cd /opt/studio
 sh /tmp/StudioExpress-sol-x86-2008-11-v2-ii.sh --accept-sla
 ln -s /opt/studio/SUNWspro/bin/cc /usr/bin/

* Adding perl modules

cpan

* Hit enter through all options and choose ftp.is.co.za as a mirror.
Once you at the cpan prompt:

 install File::RsyncP

* Install BackupPC

 mkdir /tmp/backuppc
 cd /tmp/backuppc
 wget http://url/BackupPC-3.1.0.tar.gz (insert working URL here)
 gzip -d BackupPC-3.1.0.tar.gz
 tar xf BackupPC-3.1.0.tar
 cd BackupPC-3.1.0

* For the next step hit enter for the defaults except for:

 /opt/csw/bin/perl configure.pl

   1. --> BackupPC should run as user [backuppc]? nobody
   2. --> Data directory (full path) [/data/BackupPC]? /data
   3. --> CGI bin directory (full path) []? /opt/csw/apache2/share/cgi-bin/
   4. --> Apache image directory (full path) []?
/opt/csw/apache2/share/htdocs/image
   5. --> URL for image directory (omit http://host; starts with '/')
[]? /image

* Configure BackupPC startup script

 cd /etc/init.d/ ; touch backuppc
 Insert the following into the backuppc file you just created:
___________________

#!/usr/bin/sh
#
# DESCRIPTION
#
#   Startup init script for BackupPC for solaris.
#
# Distributed with BackupPC version 3.1.0, released 25 Nov 2007.
#
# Not tested...
#

case "$1" in
  start)
        #
        # You can set the SMB share password here is you wish.  Otherwise
        # you should put it in the config.pl script.
        # If you put it here make sure this file has no read permissions
        # for normal users!  See the documentation for more information.
        #
        #BPC_SMB_PASSWD=
        #export BPC_SMB_PASSWD
        #
        su nobody -c "/usr/local/BackupPC/bin/BackupPC -d"
        ;;
  stop)
    /usr/bin/pkill -f "/usr/bin/perl /usr/local/BackupPC/bin/BackupPC -d"
        ;;
  restart)
        /usr/bin/pkill -f "/usr/bin/perl /usr/local/BackupPC/bin/BackupPC -d"
        su nobody -c "/usr/local/BackupPC/bin/BackupPC -d"
        ;;
  reload)
        /usr/bin/pkill -1 -f "/usr/local/BackupPC/bin/BackupPC -d"
        ;;
  *)
        echo "Usage: $0 {start|stop|restart|reload}"
        exit 1
esac

exit $?
________________________

 chmod 777 backuppc
 cd /etc/rc0.d
 ln -s ../init.d/backuppc K40backuppc
 cd /etc/rc2.d
 ln -s ../init.d/backuppc S99backuppc
 usermod -s /usr/bin/bash nobody
 /etc/init.d/backuppc restart
 chmod u+x /var/log/BackupPC/status.pl
 cd /opt/csw/apache2/share/cgi-bin/
 ln -s BackupPC_Admin index.cgi

* Setup up /opt/csw/etc/sudoers ; append:

 nobody  ALL=NOPASSWD: /usr/sfw/bin//gtar
 nobody  ALL=NOPASSWD: /usr/bin/env
 nobody  ALL=NOPASSWD: /usr/bin/ssh
 nobody  ALL=NOPASSWD: /opt/csw/bin/rsync

* Put sudo in its normal place:

 ln -s /opt/csw/bin/sudo /usr/bin/

Configure Apache2 (you may need to install apache)

* Append the following to /opt/csw/apache2/etc/httpd.conf
* NOTE that the ssl keys line in the httpd.conf will differ between
machines. If apache2 doesn't start (check using - ps -fel | grep
httpd) then try running /opt/csw/apache2/sbin/httpd to see what the
problem is. Also note we are using LDAP auth - choose your auth method
and modify accordingly

 Alias /BackupPC/ /opt/csw/apache2/share/cgi-bin/
 <Directory /opt/csw/apache2/share/cgi-bin>
       RewriteEngine on
       RewriteCond %{SERVER_PORT} =80
       RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI}
       AllowOverride None
       Options ExecCGI FollowSymlinks
       Order Allow,Deny
       Allow from all
       AddHandler cgi-script .cgi
       DirectoryIndex index.cgi
       AuthType basic
       AuthBasicProvider ldap
       AuthBasicAuthoritative On
       AuthLDAPURL ldap://<Your.LDAP>/ou=people,dc=<yourDC>?uid
       AuthName "BackupPC admin"
       require valid-user
 </Directory>
 LoadModule ssl_module libexec/mod_ssl.so
 Listen 443
 NameVirtualHost *:443
 <VirtualHost *:443>
       ServerAdmin root@<SERVERNAME>
       SSLEngine on
       SSLCertificateFile /opt/csw/apache2/etc/apache.pem
 <Directory "/opt/csw/apache2/share/cgi-bin">
       SSLOptions +StdEnvVars
 </Directory>
 </VirtualHost>

* Enable and start Apache:

 svcadm enable svc:/network/http:cswapache2
 svcadm refresh svc:/network/http:cswapache2


Done - hopefully.

------------------------------------------------------------------------------
_______________________________________________
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/

<Prev in Thread] Current Thread [Next in Thread>
  • [BackupPC-users] BackupPC on OpenSolaris, Simon Fishley <=