Skip to content

Commit ea03be3

Browse files
authored
fix permissions error, create secure config
fix group permission error by assigning to user. copy config files to s config template.
1 parent f1623c9 commit ea03be3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bin/v-add-web-domain-httpauth

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,13 @@ fi
7171
auth_hash=$($BIN/v-generate-password-hash htpasswd htpasswd $password)
7272
touch $htpasswd
7373
chmod 640 $htpasswd $htaccess
74+
chgrp $user $htpasswd $htaccess
7475
sed -i "/^$auth_user:/d" $htpasswd
7576
echo "$auth_user:$auth_hash" >> $htpasswd
7677

78+
cp -p "$HOMEDIR/$user/conf/web/$WEB_SYSTEM.$domain.conf_htaccess" "$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.$domain.conf_htaccess"
79+
cp -p "$HOMEDIR/$user/conf/web/$WEB_SYSTEM.$domain.htpasswd" "$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.$domain.htpasswd"
80+
7781
# Restarting web server
7882
if [ "$restart" != 'no' ] && [ "$restart_required" = 'yes' ]; then
7983
$BIN/v-restart-web

0 commit comments

Comments
 (0)