mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
unlock /wp-content/cache/ for caching
This commit is contained in:
parent
7cdd65baf2
commit
cdbcf84b2c
1 changed files with 19 additions and 8 deletions
|
@ -28,6 +28,18 @@ if [ -z "$user" ]; then
|
|||
check_result $E_NOTEXIST "domain $domain doesn't exist"
|
||||
fi
|
||||
|
||||
unlock_folder() {
|
||||
chown -R $user:$user $1/
|
||||
|
||||
# block .php execution inside folder
|
||||
cat <<EOF >$1/.htaccess
|
||||
RewriteEngine on
|
||||
RewriteRule ^.*\.(?:php[1-6]?|pht|phtml?)$ - [NC,F]
|
||||
EOF
|
||||
|
||||
chown root:root $1/.htaccess
|
||||
}
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
@ -57,15 +69,14 @@ cd /home/$user/web/$domain
|
|||
chown -R www-data:www-data public_html/
|
||||
|
||||
# unlock /wp-content/uploads/ for uploading
|
||||
chown -R $user:$user public_html/wp-content/uploads/
|
||||
if [ -d "/home/$user/web/$domain/public_html/wp-content/uploads" ]; then
|
||||
unlock_folder "public_html/wp-content/uploads"
|
||||
fi
|
||||
|
||||
# block .php execution inside /wp-content/uploads/
|
||||
cat <<EOF >public_html/wp-content/uploads/.htaccess
|
||||
RewriteEngine on
|
||||
RewriteRule ^.*\.(?:php[1-6]?|pht|phtml?)$ - [NC,F]
|
||||
EOF
|
||||
|
||||
chown root:root public_html/wp-content/uploads/.htaccess
|
||||
# unlock /wp-content/cache/ for caching
|
||||
if [ -d "/home/$user/web/$domain/public_html/wp-content/cache" ]; then
|
||||
unlock_folder "public_html/wp-content/cache"
|
||||
fi
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue