how to run caddy with selinux of fedora
how can you run caddy with a Caddyfile with systemd with enabled selinux on fedora?
I can manually start caddy with caddy start or
/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile which is also in /usr/lib/systemd/system/caddy.service.
Caddy works just fine but I can't start it with systemd without disabling selinux with sudo setenforce 0.
edit:
I found a tutorial on how to start caddy on centos that disables selinux, starts caddy with systemctl and then enabales selinux again. That does not sound right to me.
4 replies
An error would be awesome.
I agree! Thx for asking. I don't get a proper one.
https://docs.fedoraproject.org/en-US/quick-docs/selinux-troubleshooting/#_selinux_denials_in_the_audit_log
It looks like you have an incorrect selinux context on your /etc/caddy directory.
https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-working_with_selinux-selinux_contexts_labeling_files