mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -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"
|
check_result $E_NOTEXIST "domain $domain doesn't exist"
|
||||||
fi
|
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 #
|
# Verifications #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
@ -57,15 +69,14 @@ cd /home/$user/web/$domain
|
||||||
chown -R www-data:www-data public_html/
|
chown -R www-data:www-data public_html/
|
||||||
|
|
||||||
# unlock /wp-content/uploads/ for uploading
|
# 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/
|
# unlock /wp-content/cache/ for caching
|
||||||
cat <<EOF >public_html/wp-content/uploads/.htaccess
|
if [ -d "/home/$user/web/$domain/public_html/wp-content/cache" ]; then
|
||||||
RewriteEngine on
|
unlock_folder "public_html/wp-content/cache"
|
||||||
RewriteRule ^.*\.(?:php[1-6]?|pht|phtml?)$ - [NC,F]
|
fi
|
||||||
EOF
|
|
||||||
|
|
||||||
chown root:root public_html/wp-content/uploads/.htaccess
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Vesta #
|
# Vesta #
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue