Skip to content

Commit

Permalink
build(Server Install): Run tomcat service as tomcat user
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffreykwan committed Apr 8, 2022
1 parent 4170de4 commit db20551
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions scripts/beforeInstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ apt-get install tomcat9 -y
echo "Removing Tomcat ROOT folder"
rm -rf $CATALINA_HOME/webapps/ROOT

echo 'Setting Tomcat to run as ubuntu user'
sed 's/User=tomcat/User=ubuntu/' -i /lib/systemd/system/tomcat9.service
systemctl daemon-reload

echo "Add https to Tomcat server.xml"
sed 's/<Connector port="8080"/<Connector port="8080" scheme="https"/' -i $CATALINA_HOME/conf/server.xml

Expand All @@ -63,8 +59,8 @@ echo "Restarting Tomcat"
service tomcat9 restart

echo "Creating Tomcat curriculum and studentuploads folders"
sudo -u ubuntu -g tomcat mkdir $CATALINA_HOME/webapps/curriculum
sudo -u ubuntu -g tomcat mkdir $CATALINA_HOME/webapps/studentuploads
sudo -u tomcat -g tomcat mkdir $CATALINA_HOME/webapps/curriculum
sudo -u tomcat -g tomcat mkdir $CATALINA_HOME/webapps/studentuploads

echo "Installing Nginx"
apt-get install nginx -y
Expand Down

0 comments on commit db20551

Please sign in to comment.