Running BackupPC with lighttpd instead of Apache
I was under the mistaken impression that BackupPC’s frontend only worked with Apache, so when I found instructions on the ArchLinux wiki to run it on lighttpd instead, I gave it a try on FreeBSD, and with these few changes to the configuration it runs just fine:
-
Delete Apache:
Terminal window pkg delete backuppc apache22 -
Delete dependencies installed for Apache:
Terminal window pkg autoremove -
Install lighttpd:
Terminal window pkg install lighttpd -
Edit lighttpd’s configuration:
Terminal window vi /usr/local/etc/lighttpd/lighttpd.confserver.port = 81server.username = "backuppc"server.groupname = "backuppc"server.document-root = "/usr/local/www/data/"server.errorlog = "/var/log/lighttpd/error.log"dir-listing.activate = "enable"index-file.names = ( "index.html", "index.cgi" )server.modules = ("mod_alias", "mod_cgi", "mod_auth", "mod_access")server.pid-file = "/var/run/lighttpd/lighttpd.pid"alias.url = ("/BackupPC_Admin" => "/usr/local/www/cgi-bin/BackupPC_Admin")alias.url += ("/backuppc" => "/usr/local/www/backuppc" )cgi.assign += (".cgi" => "/usr/bin/perl" )cgi.assign += ("BackupPC_Admin" => "/usr/bin/perl")server.event-handler = "freebsd-kqueue"server.network-backend = "writev"server.max-fds = 2048server.stat-cache-engine = "simple"server.max-connections = 1024url.access-deny = ( "~", ".inc" )static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".scgi" ) -
Edit rc.conf:
Terminal window vi /etc/rc.conflighttpd_enable="YES"lighttpd_pidfile="/var/run/lighttpd/lighttpd.pid"# ... other lines, such as (obviously) ...backuppc_enable="YES" -
Give backuppc user access to log and pid directories:
Terminal window mkdir /var/run/lighttpdchown -R backuppc: /var/log/lighttpdchown -R backuppc: /var/run/lighttpd -
Start lighttpd:
Terminal window service lighttpd start