#!/bin/bash #################################################################################################### #### author: SlickStack ############################################################################ #### link: https://slickstack.io ################################################################### #### mirror: http://mirrors.slickstack.io/bash/ss-perms-nginx.txt ################################## #### path: /var/www/ss-perms-nginx ################################################################# #### destination: n/a (not a boilerplate) ########################################################## #### purpose: Resets all file and user permissions across the entire Nginx module ################## #### module version: Nginx 1.18.x ################################################################## #### sourced by: ss-perms, ss-install-nginx ######################################################## #### bash aliases: ss perms nginx ################################################################## #################################################################################################### ## include SlickStack configuration ## source /var/www/ss-config ## include SlickStack functions ## source /var/www/ss-functions #################################################################################################### #### SS-Perms-Nginx-Config: Message (Begin Script) ################################################# #################################################################################################### ## this is a simple message that announces to the shell the purpose of this bash script ## ## it will only be noticed by sudo users who manually call ss core bash scripts ## ## echo message ## echo -e "${PURPLE}Running ss-perms-nginx: Resets all file and user permissions across the entire Nginx module... ${NOCOLOR}" sleep "$SLEEP_MESSAGE_BEGIN" #################################################################################################### #### SS-Perms-Nginx: Reset Permissions (Nginx) ##################################################### #################################################################################################### ## although most permissions for Nginx files are okay by default we also reset them here ## ## in general everything should be owned by root and chmod should be set to 0700 ## ## ensure directories exists (will not overwrite) ## mkdir /var/www/cache ## logs ## if [ ! -f "/var/www/logs/nginx.log" ]; then touch "/var/www/logs/nginx.log"; fi chown www-data:www-data /var/www/logs/nginx*.log* chmod 0644 /var/www/logs/nginx*.log ## 6755 should also work ## fcgi cache ## chown www-data:www-data /var/www/cache source /var/www/ss-perms-nginx-config source /var/www/ss-perms-nginx-core source /var/www/ss-perms-nginx-ssl #################################################################################################### #### SS-Perms-Nginx: Touch Timestamp File (End Script) ############################################# #################################################################################################### ## this is a dummy timestamp file that will remember the last time this script was run ## ## it can be useful for developer reference and is sometimes used by SlickStack ## ## script timestamp ## touch /var/www/meta/.timestamp-ss-perms-nginx #################################################################################################### #### SlickStack: External References Used To Improve This Script (Thanks, Interwebz) ############### #################################################################################################### ## Ref: ## SS_EOF