configure apache2 to use specified user

This commit is contained in:
Ray Elliott 2020-09-03 20:35:29 +01:00
parent 8bea5f2250
commit 021d36b131
1 changed files with 6 additions and 0 deletions

View File

@ -9,6 +9,12 @@ ssh -T $ssh << EOSSH
echo "Installing Apache2"
apt install -y apache2
ufw allow in "WWW Full"
sed -i '/export APACHE_RUN_USER=/c\export APACHE_RUN_USER='"$user" /etc/apache2/envvars
sed -i '/export APACHE_RUN_GROUP=/c\export APACHE_RUN_GROUP='"$group" /etc/apache2/envvars
chown -R "$user:$group" "/var/www/html"
echo "Nothing here ..." > /var/www/html/index.html
systemctl restart apache2
EOSSH