Updated SeLinux for web folder once again

This commit is contained in:
2020-12-04 17:04:53 +01:00
parent aebf9c97e4
commit 06a7814d98
7 changed files with 30 additions and 16 deletions

View File

@@ -9,4 +9,20 @@ useradd -g "$sitename" "$sitename"
systemctl reload $phpFPMService
#Creating webfolder
mkdir -p /var/www/"$domain"/html
#Ceating content
echo "<html><head></head><body>$webserv has been succsefully installed by the Wizard</body></html>" > /var/www/$domain/html/index.html
#Setting Permsissions
chown "$sitename":"$sitename" -R /var/www/"$domain"/html
if [ "$shortdist" = "cent8" ]; then
#Setting SeLiux perms for centos
semanage fcontext -a -t httpd_sys_rw_content_t /var/www/"$domain"/html > $OUTPUT 2>&1
restorecon -vr /var/www/ > $OUTPUT 2>&1
fi
fi