24 lines
398 B
Bash
24 lines
398 B
Bash
#!/bin/bash
|
|
|
|
chmod +x /usr/bin/caddy
|
|
|
|
groupadd --system caddy
|
|
|
|
useradd --system \
|
|
--gid caddy \
|
|
--create-home \
|
|
--home-dir /var/lib/caddy \
|
|
--shell /usr/sbin/nologin \
|
|
--comment "Caddy web server" \
|
|
caddy
|
|
|
|
cp caddy.service /etc/systemd/system/
|
|
|
|
mkdir /etc/caddy
|
|
|
|
cp Caddyfile /etc/caddy/
|
|
|
|
systemctl daemon-reload
|
|
systemctl enable caddy
|
|
systemctl start caddy
|
|
systemctl status caddy |