Crazy's Amazing Corner on the Web
/blog/2025/My Webserver Setup/
My Webserver
Today I wanted to share my Current Setup to host my Website including my Webserver, Analytics and Rendering of my Site.
This will Consist of 3 Segements:
Web Server
I use Caddy as my Web server, as it has an integrated SSL Cert Handler to keep the SSL certs up to date and accurate. Makes the handling of it a breeze. It also has a very easy Configuration Language, which makes it also vary Nice to use. Following to that I use the robots.txt and Caddyfile Snippet from ai.robots.txt to straight Abort every Message from any of those Bots. As my Analytics have shown how often they call my Website.
All of this is hosted via Docker for easy Deployment and Movement.
compose.yml
services:
caddy:
image: caddy
restart: always
ports:
- 443:443
volumes:
- ./configs:/etc/caddy
- ./certs:/data
- ./logs:/var/log/caddy
- /src/websites:/srv
networks:
caddy:
networks:
caddy:
external: true
Caddyfile
{
log access {
output file /var/log/caddy/access.log {
mode 600
roll_site 30MiB
roll_keep 3
roll_keep_for 30d
}
format json
include http.log.access
}
}
crazyroostereye.de {
# This if for my Assets to still be loaded without Anubis
root * /srv/website/public
try_files {path}.html
file_server
encode gzip zstd
# Imports from ai Caddyfile, which is in the same folder
import ai
abort @aibots
log access
}
Rendering
Now that I have my Web server, I need the Website. And for that I built my SSG (Static Site Generator) with the help of Python and Jinja2.
But why would I need a SSG?
The reason is quite simple, actually. My Website includes a lot of content that is similar. For example the Navbar or footer. This means every time I want to alter them, I'd had to edit it on every single Page. Which with my Blog Posts Included is an ever-growing list. So this reduces the Workload by having a Template where the Footer and Navbar live.
But why then not use something like PHP?
Well PHP is a Dynamic Server, its basically replacing what I would have done in JS on the Client Side with PHP on the Server Side. Which would add additional Load on my Website, that would increase the more Visitors I have. Given that this a Personal Site, with little to non-Dynamic Content. I don't see the use of using something like that.
BTW if you want to see the source of the Webserver, here it is
Analytics
Now to the last aspect of my Web Server Setup, Analytics. I do collect everything my Web server Spits out, but I don't use any specific Analytics tools anymore. So I do pure Log Analytics. For that I use my General Monitoring Setup in Grafana. I connect to Caddy with Prometheus and scrape the Logs with Loki/Alloy. The Data I get from that is described on my Privacy Policy. But in general I look at the 404 Calls, User-Agents and the GeoIP. As I am always curious what specifically People look at, and even more what they Attampt to open that dosent exit. Motly its bots trying find voulnarbilities.