Support #636
Updated by Daniel Curtis over 9 years ago
This is a guide for installing BackupPC on FreeBSD 9.3. h2. Setting up the Environment * Start by making sure everything is up to date: <pre> pkg update && pkg upgrade portsnap fetch extract </pre> * Install portmaster: <pre> pkg install portmaster </pre> h2. Install BackupPC * Install BackupPC from ports: <pre> portmaster sysutils/backuppc </pre> *NOTE*: I decided to enable @[X]NMBLOOKUP@, @[X]SMBCLIENT@ and @[X]FILE_RSYNCP@ during the port configuration. * Create a config file for backuppc: <pre> cp /usr/local/etc/backuppc/config.pl.sample /usr/local/etc/backuppc/config.pl </pre> * And then enable the service to start at boot: <pre> echo 'backuppc_enable="YES"' >> /etc/rc.conf </pre> * Start backuppc: <pre> service backuppc </pre> h2. Install Nginx * Install nginx: <pre> portmaster www/nginx </pre> * Create a configuration directory to make managing individual server blocks easier <pre> mkdir /usr/local/etc/nginx/conf.d </pre> * Configure Nginx by editing the *main nginx configuration* file: <pre> vi /usr/local/etc/nginx/nginx.conf </pre> #* And add/modify the following <pre> user backuppc backuppc; worker_processes 4; error_log /var/log/nginx/error.log notice; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; tcp_nopush on; keepalive_timeout 65; tcp_nodelay on; # Load config files from the /etc/nginx/conf.d directory include /usr/local/etc/nginx/conf.d/*.conf; } </pre> * Then add a *backuppc site server block*: <pre> vi /usr/local/etc/nginx/conf.d/backuppc.conf /usr/local/etc/nginx/conf.d/default.conf </pre> #* Add the following: <pre> server { listen 80 default; server_name _; index index.html; root /usr/local/www; location ~ \.cgi$ { try_files $uri =404; include fastcgi_params; fastcgi_pass unix:/var/run/fcgiwrap/fcgiwrap.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param REMOTE_USER $remote_user; } } </pre> * And then enable the service to start at boot: <pre> echo 'nginx_enable="YES"' >> /etc/rc.conf </pre> * Start nginx: <pre> service nginx start </pre> h3. Install Fcgi Start by installing spawn-fcgi and fcgiwrap: <pre> portmaster www/spawn-fcgi www/fcgiwrap </pre> * And then enable the service to start at boot: <pre> echo 'spawn_fcgi_enable="YES"' >> /etc/rc.conf echo 'fcgiwrap_enable="YES"' >> /etc/rc.conf echo 'fcgiwrap_user="backuppc"' >> /etc/rc.conf </pre> * Now open http://backuppc.example.com/cgi-bin/BackupPC_Admin in a web browser