Quickstart Guide for BackupPC 4 in a jail on FreeNAS

Joined
May 25, 2021
Messages
1
If you install the BackupPC Plugin, you can use this script to get the Admin UI working, using scgi:


Code:
# Prepare the Apache config
config="
LoadModule scgi_module        libexec/apache24/mod_scgi.so
SCGIMount /admin 127.0.0.1:10268
<Location /admin>
    AuthUserFile /usr/local/etc/backuppc/htpasswd
    AuthType basic
    AuthName "access"
    require valid-user
</Location>
"

# Write the config to the Includes
echo "$config" > /usr/local/etc/apache24/Includes/backuppc.conf

# Installed the extra packages requirements
pkg install -y ap24-mod_scgi p5-SCGI rsync-bpc

# Enable the SCGI port, fix the image location, allow 'admin' user as an Admin
sed -i .bak 's|^$Conf{SCGIServerPort}.*|$Conf{SCGIServerPort} = 10268;|g' /usr/local/etc/backuppc/config.pl
sed -i .bak 's|^$Conf{CgiAdminUsers}.*|$Conf{CgiAdminUsers}     = "*";|g' /usr/local/etc/backuppc/config.pl
sed -i .bak 's|^$Conf{CgiImageDirURL}.*|\$Conf{CgiImageDirURL} = "";|g' /usr/local/etc/backuppc/config.pl

# Create the htpasswd file
htpasswd -b -c /usr/local/etc/backuppc/htpasswd admin password

# Allow backuppc user to modify the config
chown backuppc /usr/local/etc/backuppc

# Restart services to implement chnages
service backuppc restart
service apache24 restart

Hi, so sorry to re-open this thread again. When i try to access http://ip.of.the.jail/admin or http://ip.of.the.jail/bpc, i just get a message saying "The requested URL was not found on this server". When I just type the IP, I get a message saying "it works!". I have been googling for hours how to fix this and came across your comment, but i'm not sure how to use scgi to work. If you or anyone could clarify I would be super grateful!

Thanks :)
 
Top