VPS Setup: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(5 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 98: | Zeile 98: | ||
| | | | ||
|} | |} | ||
+ | |||
+ | |||
+ | |||
+ | =neuromancer (aka Contabo Server 2)= | ||
+ | |||
+ | * IP: 213.136.84.38 | ||
+ | * IPv6: 2a02:c207:3004:7659::1 | ||
+ | * VNC: 5.189.158.206:63083 | ||
+ | * Host system: 3306 | ||
+ | * OS: Ubuntu 19.10 (64 Bit) | ||
+ | |||
+ | |||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Container<br/>Name || Image|| Sub<br/>Container || Web<br/>Adresse || Networks|| Externe<br/>Ports<br />|| Besonderheiten|| Erläuterung | ||
+ | |- | ||
+ | |[[Projekt:Minecraft-Server|minecraft]] | ||
+ | |[https://hub.docker.com/r/itzg/minecraft-server/ itzg/minecraft-server] | ||
+ | | | ||
+ | |[http://mc.unhb.de:8123 http://mc.unhb.de:8123] | ||
+ | | | ||
+ | | | ||
+ | * 8123 (dynmap) | ||
+ | * 9225 (Prometheus) | ||
+ | * 25565 (Minecraft) | ||
+ | | | ||
+ | |Admin: ryze | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | === neuromancer install === | ||
+ | as root: | ||
+ | |||
+ | enable_ipv6 | ||
+ | reboot | ||
+ | adduser smash | ||
+ | usermod -aG sudo,admin smash | ||
+ | echo neuromancer.unhb.de > /etc/hostname | ||
+ | |||
+ | |||
+ | as smash: | ||
+ | |||
+ | ## install docker.ce | ||
+ | |||
+ | sudo apt-get update | ||
+ | sudo apt-get install \ | ||
+ | apt-transport-https \ | ||
+ | ca-certificates \ | ||
+ | curl \ | ||
+ | gnupg-agent \ | ||
+ | software-properties-common | ||
+ | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | ||
+ | sudo apt-key fingerprint 0EBFCD88 | ||
+ | sudo add-apt-repository \ | ||
+ | "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | ||
+ | $(lsb_release -cs) \ | ||
+ | stable test" ## appended test as a workaround - currently no containerd.io version available in stable for ubuntu eoan! | ||
+ | sudo apt-get update | ||
+ | sudo apt-get install docker-ce docker-ce-cli containerd.io | ||
+ | |||
+ | ## install docker-compose | ||
+ | sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | ||
+ | sudo chmod +x /usr/local/bin/docker-compose | ||
+ | |||
+ | ## create mc docker container | ||
+ | sudo mkdir -p /srv/docker-volumes/ | ||
+ | |||
+ | ## install additional tools | ||
+ | sudo apt install htop dstat net-tools | ||
+ | |||
+ | ## initial docker-compose.yml for minecraft | ||
+ | version: '3.7' | ||
+ | |||
+ | services: | ||
+ | mc: | ||
+ | image: itzg/minecraft-server | ||
+ | container_name: minecraft | ||
+ | restart: always | ||
+ | environment: | ||
+ | EULA: "true" | ||
+ | TYPE: SPIGOT | ||
+ | MAX_MEMORY: 4G | ||
+ | command: --noconsole | ||
+ | ports: | ||
+ | - 25565:25565 | ||
+ | - 8123:8123 | ||
+ | - 9225:9225 | ||
+ | volumes: | ||
+ | - /srv/docker-volumes/minecraft:/data | ||
+ | |||
+ | ## altered /etc/sudoers for ssh pubkey access (NOPASS Option) | ||
+ | |||
+ | # | ||
+ | # This file MUST be edited with the 'visudo' command as root. | ||
+ | # | ||
+ | # Please consider adding local content in /etc/sudoers.d/ instead of | ||
+ | # directly modifying this file. | ||
+ | # | ||
+ | # See the man page for details on how to write a sudoers file. | ||
+ | # | ||
+ | Defaults env_reset | ||
+ | Defaults mail_badpass | ||
+ | Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin" | ||
+ | |||
+ | # Host alias specification | ||
+ | |||
+ | # User alias specification | ||
+ | |||
+ | # Cmnd alias specification | ||
+ | |||
+ | # User privilege specification | ||
+ | root ALL=(ALL:ALL) ALL | ||
+ | |||
+ | # Members of the admin group may gain root privileges | ||
+ | %admin ALL=(ALL) ALL | ||
+ | |||
+ | # Allow members of group sudo to execute any command | ||
+ | %sudo ALL=(ALL:ALL)NOPASSWD: ALL | ||
+ | |||
+ | # See sudoers(5) for more information on "#include" directives: | ||
+ | |||
+ | #includedir /etc/sudoers.d |
Version vom 25. Februar 2020, 14:15 Uhr
Docker Setup
Config-Files:
Es ist zu jedem Docker-Container ein Setup im Ordner /srv/docker-config/<container> abgelegt. Die Container werden auf zwei verschiedene Arten definiert:
- (bevorzugt)docker-compose.yml
- Starten des Containers: docker-compose -d up (-d für detatched, damit die Container auch weiterlaufen, wenn die Shell geschlossen wird)
- Stoppen des Containers: docker-compose down
- Inspizieren des Containers: docker-compose ps
- (legacy) Drei Files: ./create.sh, ./replace.sh und env_file. Diese Files definieren die Container und können zum neustarten / ersetzen / verändern verwendet werden
Volumes:
Gemountete Volumes sollen unter /srv/docker-volumes/<container>/<volume-wie-im-container> abgelegt werden.
Contabo Server 1
Container-Name | Image | Sub-Container | Web-Adresse |
Networks | Externe Ports | Besonderheiten | Erläuterung |
nginx | jwilder/nginx-proxy:alpine | (-) | (-) | nginx_net | 80, 443 | Reverse Proxy. Schleift Anfragen zum richtigen Container durch. | |
nginx-proxy-letsencrypt | jrcs/letsencrypt-nginx-proxy-companion:stable | (-) | (-) | nginx_net | (-) | Holt letsencrypt Zertifikate für alle Container ab. | |
watchtower | containrrr/watchtower | (-) | (-) | (-) | (-) | Überwacht laufende Container. Wenn es eine neue Version gibt, wird der Container gestoppt, die neue Version gepullt, der Container gelöscht und neu gestartet. | |
gitea | gitea/gitea:latest | (-) | git.un-hack-bar.de, git.unhb.de, git.unhackbar.de | nginx_net | 22 | Git Server | |
wiki | mediawiki:stable | wiki_sql (mariadb) | wiki.un-hack-bar.de, wiki.unhb.de, wiki.unhackbar.de | nginx_net wiki_net | (-) | Mediawiki Server | |
spaceapi | sebp/lighttpd:latest | (-) | status.un-hack-bar.de
status.unhb.de status.unhackbar.de keinanschluss.un-hack-bar.de keinanschluss.unhb.de keinanschluss.unhackbar.de |
nginx_net | (-) | Hier wird ein gesonderter Benutzer "keinanschluss" verwendet. Ein Raspi im Space verbindet sich mit SSH. Deswegen ist das /home von "keinanschluss" auf das Volume glelegt und das Volume beherbergt einen SSH-Key für den Raspi. | Macht irgendwas für die Spaceapi. (Bitte gern ergänzen, wenn wer weiß was genau) |
portainer | portainer/portainer:latest | (-) | TO BE MIGRATED |
neuromancer (aka Contabo Server 2)
- IP: 213.136.84.38
- IPv6: 2a02:c207:3004:7659::1
- VNC: 5.189.158.206:63083
- Host system: 3306
- OS: Ubuntu 19.10 (64 Bit)
Container Name |
Image | Sub Container |
Web Adresse |
Networks | Externe Ports |
Besonderheiten | Erläuterung |
---|---|---|---|---|---|---|---|
minecraft | itzg/minecraft-server | http://mc.unhb.de:8123 |
|
Admin: ryze |
neuromancer install
as root:
enable_ipv6 reboot adduser smash usermod -aG sudo,admin smash echo neuromancer.unhb.de > /etc/hostname
as smash:
## install docker.ce sudo apt-get update sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo apt-key fingerprint 0EBFCD88 sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable test" ## appended test as a workaround - currently no containerd.io version available in stable for ubuntu eoan! sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io ## install docker-compose sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose ## create mc docker container sudo mkdir -p /srv/docker-volumes/ ## install additional tools sudo apt install htop dstat net-tools
## initial docker-compose.yml for minecraft version: '3.7' services: mc: image: itzg/minecraft-server container_name: minecraft restart: always environment: EULA: "true" TYPE: SPIGOT MAX_MEMORY: 4G command: --noconsole ports: - 25565:25565 - 8123:8123 - 9225:9225 volumes: - /srv/docker-volumes/minecraft:/data
## altered /etc/sudoers for ssh pubkey access (NOPASS Option) # # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults env_reset Defaults mail_badpass Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin" # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL:ALL) ALL # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL)NOPASSWD: ALL # See sudoers(5) for more information on "#include" directives: #includedir /etc/sudoers.d