Initial commit
This commit is contained in:
commit
ce9c64f563
|
@ -0,0 +1,59 @@
|
||||||
|
# Ubuntu Server 18.04 auf Hetzner Cloud
|
||||||
|
|
||||||
|
Als erstes das System aktualisieren
|
||||||
|
```
|
||||||
|
apt update
|
||||||
|
apt upgrade
|
||||||
|
```
|
||||||
|
Falls der Port für SSH geändert werden soll:
|
||||||
|
```
|
||||||
|
vim /etc/ssh/sshd_config
|
||||||
|
service ssh restart
|
||||||
|
```
|
||||||
|
Nun die Firewall aktivieren und die wichtigsten Ports freischalten
|
||||||
|
```
|
||||||
|
ufw allow 22
|
||||||
|
ufw allow 80
|
||||||
|
ufw allow 443
|
||||||
|
ufw enable
|
||||||
|
```
|
||||||
|
Ein paar hilfreiche Tools installieren:
|
||||||
|
```
|
||||||
|
apt install -y htop iftop mytop tcpdump landscape-common mercurial git software-properties-common
|
||||||
|
```
|
||||||
|
## Strorage Box mounten
|
||||||
|
Die Festplatte soll über SAMBA/CIFS gemounted werden, daher müssen die entsprechenden Tools installiert sein:
|
||||||
|
```
|
||||||
|
apt install cifs-utils
|
||||||
|
```
|
||||||
|
Die Zugangsdaten für die Storagebox werden unter `/etc/storage-bx20-credentials` in folgender Form gespeichert:
|
||||||
|
```
|
||||||
|
username=<BENUTZERNAME>
|
||||||
|
password=<PASSWORT>
|
||||||
|
```
|
||||||
|
In `/etc/fstab` folgende Zeile einfügen:
|
||||||
|
```
|
||||||
|
//u138460.your-storagebox.de/backup /mnt/storage-bx20 cifs iocharset=utf8,rw,credentials=/etc/storage-bx20-credentials,uid=www-data,gid=www-data,file_mode=0660,dir_mode=0770 0 0
|
||||||
|
```
|
||||||
|
## Docker und Docker-Composer installieren
|
||||||
|
Zuerst einmal Docker
|
||||||
|
```
|
||||||
|
apt install docker.io
|
||||||
|
```
|
||||||
|
Nun Docker-Composer und hier kann man die aktuelle Release-Nr. herausfinden: https://github.com/docker/compose/releases
|
||||||
|
```
|
||||||
|
sudo curl -L https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
|
||||||
|
sudo chmod +x /usr/local/bin/docker-compose
|
||||||
|
```
|
||||||
|
## Wichtige Befehle
|
||||||
|
Festplattenverbrauch ermitteln:
|
||||||
|
```
|
||||||
|
df -h
|
||||||
|
```
|
||||||
|
Rsync ohne Rechteübernahme (gut für gemountete Laufwerke SAMBA)
|
||||||
|
```
|
||||||
|
sudo rsync -rltv --exclude '/storage/var/lib/nextcloud/*' /storage/ /mnt/backup-storage/
|
||||||
|
```
|
||||||
|
## Gute Quellen
|
||||||
|
* Bash-Skripte: https://wiki.ubuntuusers.de/Shell/Bash-Skripting-Guide_für_Anfänger/
|
||||||
|
* Cronjobs: https://www.stetic.com/developer/cronjob-linux-tutorial-und-crontab-syntax.html
|
Loading…
Reference in New Issue