This is a suppliment to the guide provided on the namelessMC tutorials page.
From wikipedia: "Caddy is an extensible, cross-platform, open-source web server written in Go."
Caddy is a highly preformant and highly extensible webserver, spouting automated HTTPS & certificate deployment, automated HTTP/3 deployment, and an extremely simply configuration syntax.
Run these commands, depending on your distro.
Debian / Ubuntu / Derrivities:
Debian / Ubuntu / Derrivities:sudo apt update
sudo apt install caddy
Fedora / Red Hat / CentOS / Rocky Linux / AlmaLinux:
Fedora / Red Hat / CentOS / Rocky Linux / AlmaLinux:sudo dnf install caddy
Arch (NOT RECOMMENDED)
I cannot in good faith recommend Arch Linux for NamelessMC due to the amount of config needed. I may make a guide on this at a later date.
Arch (NOT RECOMMENDED)sudo pacman -S caddyWe need to add caddy to the http group, since Arch doesn't do this by default. Without this, permissions later in the guide will not work.
sudo usermod -aG http caddyIf you are unsure, please follow your distributions guide to installing caddy.
In short, run the following two commands;
sudo chown -R www-data:www-data /var/www/html
sudo find /var/www/html -type d -exec chmod 2770 {} +
sudo find /var/www/html -type f -exec chmod 0660 {} +
On Arch, replace www-data with http.
In short, run the following commands;
sudo mkdir -p /etc/caddy/conf.d
sudo chown -R caddy:caddy /etc/caddyModify the base Caddyfile as following;
nano /etc/caddy/CaddyfilePaste the following within;
import /etc/caddy/conf.d/*
Important
You may want to remove all previous info in this file to prevent conflicts later- though caddy is good at avoiding it.
Then,
nano /etc/caddy/conf.d/example.comModify and paste this config within.
Important
If you run into permission issues, make sure caddy is apart of either the www-data or http group!
All that is left to run is to run caddy run. If you want caddy to run on startup, view https://caddyserver.com/docs/running