Created
January 7, 2025 20:21
-
-
Save gingerbeardman/23e0da9949a8d41ebd190d60b0bd033b to your computer and use it in GitHub Desktop.
Access control and permissions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Create the directory if it doesn't exist | |
sudo mkdir -p /var/log/caddy | |
# Set ownership to caddy user and group | |
sudo chown caddy:caddy /var/log/caddy | |
# Set appropriate permissions (755 for directory) | |
sudo chmod 755 /var/log/caddy | |
# Set correct SELinux context for logs | |
sudo semanage fcontext -a -t httpd_log_t "/var/log/caddy(/.*)?" | |
sudo restorecon -Rv /var/log/caddy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment