File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ source $VESTA/conf/vesta.conf
2424# Defining htpasswd file
2525htaccess=" $HOMEDIR /$user /conf/web/$WEB_SYSTEM .$domain .conf_htaccess"
2626htpasswd=" $HOMEDIR /$user /conf/web/$WEB_SYSTEM .$domain .htpasswd"
27+ shtaccess=" $HOMEDIR /$user /conf/web/s$WEB_SYSTEM .$domain .conf_htaccess"
28+ shtpasswd=" $HOMEDIR /$user /conf/web/s$WEB_SYSTEM .$domain .htpasswd"
2729docroot=" $HOMEDIR /$user /web/$domain /public_html"
2830
2931
7173auth_hash=$( $BIN /v-generate-password-hash htpasswd htpasswd $password )
7274touch $htpasswd
7375chmod 640 $htpasswd $htaccess
76+ chgrp $user $htpasswd $htaccess
7477sed -i " /^$auth_user :/d" $htpasswd
7578echo " $auth_user :$auth_hash " >> $htpasswd
7679
80+ # Symbolic link for secure web templates
81+ if [ ! -L $shtpasswd ]; then
82+ ln -s $htpasswd $shtpasswd
83+ fi
84+ if [ ! -L $shtaccess ]; then
85+ ln -s $htaccess $shtaccess
86+ fi
87+
7788# Restarting web server
7889if [ " $restart " != ' no' ] && [ " $restart_required " = ' yes' ]; then
7990 $BIN /v-restart-web
8091fi
8192
82-
8393# ----------------------------------------------------------#
8494# Vesta #
8595# ----------------------------------------------------------#
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ source $VESTA/conf/vesta.conf
2323# Defining htpasswd file
2424htaccess=" $HOMEDIR /$user /conf/web/$WEB_SYSTEM .$domain .conf_htaccess"
2525htpasswd=" $HOMEDIR /$user /conf/web/$WEB_SYSTEM .$domain .htpasswd"
26-
26+ shtaccess=" $HOMEDIR /$user /conf/web/s$WEB_SYSTEM .$domain .conf_htaccess"
27+ shtpasswd=" $HOMEDIR /$user /conf/web/s$WEB_SYSTEM .$domain .htpasswd"
2728
2829# ----------------------------------------------------------#
2930# Verifications #
@@ -54,7 +55,7 @@ sed -i "/^$auth_user:/d" $htpasswd
5455
5556# Deleting password protection
5657if [ " $( echo " $AUTH_USER " | tr : ' \n' | wc -l) " -le 1 ]; then
57- rm -f $htaccess $htpasswd
58+ rm -f $htaccess $htpasswd $shtaccess $shtpasswd
5859 restart_required=' yes'
5960fi
6061
You can’t perform that action at this time.
0 commit comments