This is how I manage my Website. I do not works as a sysadmin and I am not an IT-guy. So this is my cheat-sheet I made public. When you find a better or easier way to do things, feel free to let me know.

Domains to Webserver

Set up an A-DNS to the Server.

Apache on vServer

I have a virtual machine running debian.

Create a new VirtualHost with this snipet:

#!/bin/bash

# Domain als Variable anlegen
export DOMAIN=marloth.de
 	
# Schritt 1 - Verzeichnis erstellen und Rechte anpassen
sudo mkdir /var/www/$DOMAIN
sudo chown -R www-data:www-data /var/www/$DOMAIN
 
# Schritt 2 - Apache Config-Datei für neue-url.de erstellen
printf "
<VirtualHost *:80>
	ServerAdmin admin@$DOMAIN
	ServerName $DOMAIN
	ServerAlias www.$DOMAIN
	DocumentRoot /var/www/$DOMAIN
	ErrorLog \${APACHE_LOG_DIR}/error.log
	CustomLog \${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<Directory /var/www/$DOMAIN/>
 AllowOverride All
</Directory>" | sudo tee /etc/apache2/sites-available/$DOMAIN.conf

# Schritt 3 - VirtualHost Konfiguration für Domain aktivieren
sudo a2ensite $DOMAIN.conf
sudo systemctl reload apache2	

Run Certbot and select the new Domain for a SSL-Certificate and install it with the tool.

# Schritt 4 - SSL-Zertifikat anlegen
certbot

Hugo Framework

This is my little shell-script to ‘deploy’ a new build.

#!/bin/bash

echo delete curent public folder
rm -r public/

echo create new build
hugo

echo delete current content in webroot
sudo rm -r /var/www/marloth.de/*

echo push current build to webroot
sudo mv /home/JanMrlth/hugosites/marloth/public/* /var/www/marloth.de/