====== Proxy forwarding ======
/etc/apache2/site-available/001-octopi.conf
ServerName octopi.tech-lab.ch
ServerAdmin ivo.bloechliger@ksbg.ch
DocumentRoot /var/www/html
ProxyPreserveHost On
ProxyPass / http://192.168.1.21/
ProxyPassReverse / http://192.168.1.21/
ErrorLog ${APACHE_LOG_DIR}/octopi-error.log
CustomLog ${APACHE_LOG_DIR}/octopi-access.log combined
====== Letsencrypt ======
First added restricted and universe to /etc/apt/sources.list:
deb http://archive.ubuntu.com/ubuntu bionic main restricted universe
deb http://archive.ubuntu.com/ubuntu bionic-security main restricted universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe
Siehe https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-18-04
certbot --apache -d tech-lab.ch -d www.tech-lab.ch -d octopi.tech-lab.ch
====== Logrotate ======
Damit beim Backup nicht immer die gesamten logs gesichert werden, nur weil alle eine Nummer nachrücken. /etc/logrotate.d/apache2 folgende 2. Zeile eingefügt:
/var/log/apache2/*.log {
dateext
daily
und in der entsprechenden mysql-Datei auch.
====== fail2ban ======
apt install fail2ban
Mal schauen ob das schon reicht gegen ssh-bruteforce. Eventuell muss ufw noch konfiguriert werden...
====== Backup ======
Zur Zeit wie folgt gelöst.
# crontab -l
0 23 * * * bash /root/backup.d/make-backup.bash > /var/log/backup.log 2>&1
# cat /root/backup.d/make-backup.bash
echo "--------------- START ------------------"
date
DIRS=(/root /etc /usr/share /usr/local /home /var/www/html /var/log)
for d in ${DIRS[@]}
do
backupDir=/bulk/backup`dirname $d`
echo -- -p $backupDir
mkdir -p $backupDir
echo -- cp -varu --backup=numbered $d $backupDir
cp -varu --backup=numbered $d $backupDir
done
echo "----------------- END -------------------"