freebsd_nginx_backuppc
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| freebsd_nginx_backuppc [2017/07/11 16:01] – [Configuration] k2patel | freebsd_nginx_backuppc [2020/08/10 02:35] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| Not going to discuss on setting up jail etc., this topic mainly focused on quick installation once your JAIL is setup. | Not going to discuss on setting up jail etc., this topic mainly focused on quick installation once your JAIL is setup. | ||
| - | ==== Installation ==== | + | Note: For Linux RHEL Based installation look ([[https:// | 
| + | ===== Installation  | ||
| Installing packages required.\\ | Installing packages required.\\ | ||
| Line 13: | Line 14: | ||
| </ | </ | ||
| - | I've built backuppc4, because i needed to choose more options than default. | + | I've built backuppc4, because i needed to choose more options than default.\\ | 
| + | But you can install using command  | ||
| <code bash> | <code bash> | ||
| cd / | cd / | ||
| Line 28: | Line 30: | ||
| </ | </ | ||
| + | Configure backuppc for first time | ||
| + | <code bash> | ||
| + | / | ||
| + | </ | ||
| ==== FCGI ==== | ==== FCGI ==== | ||
| Running Nginx going to use fcgiwrap package instead of CGI. | Running Nginx going to use fcgiwrap package instead of CGI. | ||
| Line 38: | Line 44: | ||
| fcgiwrap_main_user=" | fcgiwrap_main_user=" | ||
| </ | </ | ||
| + | |||
| + | ==== NGINX ==== | ||
| + | Enable nginx after system reboot and allow it to run. | ||
| + | <code bash> | ||
| + | sysrc nginx_enable=YES | ||
| + | </ | ||
| + | |||
| + | Configuring nginx to work with fcgiwrap. | ||
| + | <WRAP prewrap> | ||
| + | <code bash / | ||
| + | worker_processes  | ||
| + | |||
| + | events { | ||
| + |     worker_connections  | ||
| + | } | ||
| + | |||
| + | http { | ||
| + |     include  | ||
| + |     default_type  | ||
| + | |||
| + |     sendfile  | ||
| + | |||
| + |     keepalive_timeout  | ||
| + | |||
| + | gzip on; | ||
| + | |||
| + | server { | ||
| + |         listen  | ||
| + |         server_name  | ||
| + | |||
| + |         return 302 https://< | ||
| + | |||
| + | } | ||
| + | |||
| + | server { | ||
| + |         listen  | ||
| + |         server_name  | ||
| + | |||
| + | ssl on; | ||
| + |         ssl_certificate  | ||
| + |         ssl_certificate_key  | ||
| + |         ssl_trusted_certificate / | ||
| + | |||
| + | # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) | ||
| + |         add_header Strict-Transport-Security max-age=15768000; | ||
| + | |||
| + | # OCSP Stapling --- | ||
| + | # fetch OCSP records from URL in ssl_certificate and cache them | ||
| + | ssl_stapling on; | ||
| + | ssl_stapling_verify off; | ||
| + | |||
| + | # modern configuration. tweak to your needs. | ||
| + | ssl_protocols TLSv1.2; | ||
| + |         ssl_ciphers ' | ||
| + | ssl_prefer_server_ciphers on; | ||
| + | |||
| + | ssl_session_timeout 1d; | ||
| + |         ssl_session_cache shared: | ||
| + | ssl_session_tickets off; | ||
| + | |||
| + |         add_header Strict-Transport-Security max-age=63072000; | ||
| + | add_header X-Frame-Options DENY; | ||
| + | add_header X-Content-Type-Options nosniff; | ||
| + | |||
| + |         error_page  | ||
| + | location = /50x.html { | ||
| + |             root   / | ||
| + | } | ||
| + | |||
| + |         access_log  | ||
| + |         error_log  | ||
| + | |||
| + | location / { | ||
| + |           auth_basic " | ||
| + |           auth_basic_user_file / | ||
| + |           root / | ||
| + |           return 302 http://< | ||
| + |           index BackupPC.html; | ||
| + | } | ||
| + | |||
| + | location /backuppc { | ||
| + |            alias / | ||
| + |            index BackupPC.html; | ||
| + | } | ||
| + | |||
| + | #location ~\.cgi$ { | ||
| + |         location ~ ^/ | ||
| + |           auth_basic " | ||
| + |           auth_basic_user_file / | ||
| + | gzip off; | ||
| + |           include / | ||
| + |           fastcgi_pass unix:/ | ||
| + | |||
| + |           fastcgi_param REMOTE_ADDR  | ||
| + |           fastcgi_param REMOTE_USER  | ||
| + |           fastcgi_param SCRIPT_FILENAME / | ||
| + | } | ||
| + | |||
| + | location ~ /\.ht { | ||
| + | deny all; | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== Outgoing Mail ===== | ||
| + | In order to send notice and mail from backuppc i configured sendonly mail ' | ||
| + | |||
| + | **installation: | ||
| + | <code bash> | ||
| + | pkg install ssmtp | ||
| + | </ | ||
| + | |||
| + | **Configuration: | ||
| + | This is simple but few points to remember: | ||
| + |   - It does not use / | ||
| + | - change your mail configuration | ||
| + |   - You have to configure your aliases in `/ | ||
| + | - mail command does not read these aliases | ||
| + | |||
| + | <code bash / | ||
| + | # Alias look like this | ||
| + | root: | ||
| + | </ | ||
| + | |||
| + | <code bash / | ||
| + | # This is simplified version of my configuraiton | ||
| + | root=k2patel@hotmail.com | ||
| + | mailhub=smtp.k2patel.in | ||
| + | rewriteDomain=backup.k2patel.in | ||
| + | hostname=_HOSTNAME_ | ||
| + | </ | ||
| + | |||
| + | <code bash / | ||
| + | # this is what my mailer.conf file looks like | ||
| + | sendmail	/ | ||
| + | send-mail	/ | ||
| + | mailq		/ | ||
| + | newaliases	/ | ||
| + | hoststat	/ | ||
| + | purgestat	/ | ||
| + | </ | ||
| + | |||
| + | <code bash / | ||
| + | # this change does not require, unless you want to send email using mail command and want aliases to work | ||
| + | set append dot save ask crt | ||
| + | ignore Received Message-Id Resent-Message-Id Status Mail-From Return-Path Via | ||
| + | alias root backup@k2patel.in | ||
| + | </ | ||
| + | ===== Troubleshooting ===== | ||
| + | - If there is any issue related to fcgiwrap | ||
| + |       - Check permission of '/ | ||
| + |   - Creating user for nginx '/ | ||
| + | - openssl passwd -apr1 | ||
| + | |||
freebsd_nginx_backuppc.1499788878.txt.gz · Last modified: 2020/08/10 02:30 (external edit)
                
                