diff --git a/install.sh b/install.sh index bfa7228..a2094a0 100644 --- a/install.sh +++ b/install.sh @@ -138,7 +138,7 @@ echo "Done." echo "Starting Django project..." if [ ! -d "/home/$user" ] ; then mkdir /home/$user - chown $user:$user /home/$user + chown -R $user:$user /home/$user fi mkdir /home/$user/$projectname if [ $? -ne 0 ] ; then @@ -199,7 +199,7 @@ deactivate if [ $? -ne 0 ] ; then echo "Failed to deactivate virtual environment, (this may not be an issue). $djamsg" fi -chown -R centos:centos $projectname +chown -R $user:$user $projectname if [ $? -ne 0 ] ; then echo "Failed to change permissions of $projectname. $djamsg" exit 1 @@ -252,8 +252,11 @@ server { proxy_pass http://unix:/home/$user/$projectname/$projectname.sock; } }" > /etc/nginx/conf.d/mysite.conf -sed -i "s/user nginx/user $user nginx/" /etc/nginx/nginx.conf +# set the nginx user +if [ ! $user = "nginx" ] ; then + sed -i "s/user nginx/user $user nginx/" /etc/nginx/nginx.conf +fi systemctl restart nginx -systemctl status nginxsetup +systemctl status nginx echo "Done. Logs can be found in /root/logs/"