Why?
I’ve been using Apache as my web server ever since I had my first blog. It’s powerful and it’s more than enough for me. So why bother to change? Because Caddy looks so cool:
- Configuration is simple. Install and setup Apache is not that complicate but Caddy is just way too simple.
- Automatic HTTPS. Caddy automatically obtains and renews SSL/TLS certs using Let’s Encrypt vs. Apache you have to set it up.
- Other features that not a big of deal for my personal website: built-in HTTP/2, automatic gzip compression and etc.
Migration
First, install Caddy on my Ubuntu server
|
|
Then config Caddyfile /etc/caddy/Caddyfile
for my website
example.com {
# dir as root of the website
root * /var/www/example.com
# enable serving static files from root dir
file_server
# enable automatic gzip compression
enable gzip
log {
output file /var/log/caddy/example.com.log {
# rotate log at specified size
roll_size 100MB
# keep at most 5 rotated logs
roll_keep 5
}
}
}
Validate Caddyfile before start Caddy service
|
|
Now it’s time to stop Apache web server
|
|
And start Caddy
|
|
That’s it.