Initial Setup

sudo zypper in apache2 apache2-module_dnssd
sudo zypper in python3-certbot python3-certbot-apache
sudo systemctl start apache2
sudo systemctl enable apache2

If it does not work with systemctl start apache2, follow through the next steps

Create directories

mkdir -p /srv/www/vhosts/

Setting Virtual Hosts

cd /etc/apache2/vhosts.d
cp -n vhost.template

Run this to install module ReWrite

sudo a2enmod rewrite && sudo service apache2 restart

Pushing to website

I just use just for this. Here is a sample justfile designed for zola

    git submodule update --recursive --remote --init
    git add themes/jera
    git commit -s -m "update theme" || true
    zola check
    mkdir -p templates/
    zola build
publish: update-theme build
    #!/usr/bin/env bash
    set -euxo pipefail
    sudo chown $USER1:$USER1 -R public/
    cp LICENSE public/LICENSE
    ssh ${USER2}@${IP_ADDRESS} 'rm -rfv "${OUTPATH}/*"'
    rsync -a public/* "${USER2}@${IP_ADDRESS}:${OUTPATH}"

Apache uses this path scheme: /srv/www/**/

So my OUTPATH is obviously /srv/www/vhosts/


An example of pain with TMUX

Other issues not mentioned

The systemd service file for Apache2 is broken. Trying to run

systemctl restart apache2

will not really kill the other child processes and their names are httpd-prefork. I don’t know why it’s named like that.