_Admin /var/www/backuppc/admin
# chmod 4554 /var/www/backuppc/admin
# cp init.d/debian-backuppc /etc/init.d/backuppc
# chown root:root /etc/init.d/backuppc
# chmod 755 /etc/init.d/backuppc
# update-rc.d backuppc default
# cd /etc/lighttpd
This next part creates a self signed ssl certificate. Self signed is
better than nothing for sure however with firefox/mozilla you will have
to accept it tempararly every time. You can desside if encryption is
worth it for you or not. I use it. You can make the days to
experation greater if you wish.
# openssl req -new -x509 -keyout lighttpd.pem -out lighttpd.pem -days 365 -nodes
No we are going to create you backuppc users for use in your
/etc/BackupPC/hosts file. There must be at least one. You can give
these users different privilages in the backuppc web interface. Ok
lets create the first user and the file.
# htdigest -c backuppc.auth.htdigest backuppc admin
To create a second user the command is the same just drop the -c flag and change the username from admin to something you want.
Now we need to setup the lighttpd.conf. Use your favorite editor to open /etc/lighttpd/lighttpd.conf. I use nano my self.
# nano -w /etc/lighttpd/lighttpd.conf
Find the server.modules section and add these three lines if they are not there:
"mod_cgi",
"mod_redirect",
"mod_auth",
Now go to the end of the file and add the following:
----snip--------------------------------------------
auth.debug = 0
auth.backend = "htdigest"
auth.backend.htdigest.userfile = "/etc/lighttpd/backuppc.auth.htdigest"
auth.require = ( "/backuppc" =>
( "method" => "digest",
"realm" => "backuppc",
"require" => "valid-user"
)
)
cgi.assign = (
"/backuppc/admin" => ""
)
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.use-sslv2 = "disable"
ssl.pemfile = "/etc/lighttpd/lighttpd.pem"
}
# Only allow acess to the backup pc interface over https.
$SERVER["socket"] == ":80" {
$HTTP["host"] =~ ".*" {
url.redirect = ( "^/backuppc(.*)" => "https://%0/backuppc$1" )
}
}
----snip--------------------------------------------
Now we will update the backuppc config.pl file to give full privlilages to the admin user we created for the web interface.
# sed -i -r -e "s/\\\$Conf\{CgiAdminUsers\} += ''/\\\$Conf\{CgiAdminUsers\} = 'admin'/" /etc/BackupPC/config.pl
Ok now we should be ready to restart the webserver and startup backuppc.
# /etc/init.d/lighttpd restart
# /etc/init.d/backuppc start
if all goes well that should be it. You can now browse to the backuppc cgi interface by using:
https://ip.of.your.server/backuppc/admin