Skip to content

Instantly share code, notes, and snippets.

@ViniFKroth
Last active September 26, 2018 15:25
Show Gist options
  • Select an option

  • Save ViniFKroth/e3f90607d124f3062b7841c7f639e196 to your computer and use it in GitHub Desktop.

Select an option

Save ViniFKroth/e3f90607d124f3062b7841c7f639e196 to your computer and use it in GitHub Desktop.
First, to install and configure Tomcat, i followed the steps below:
//Download tomcat tar.gz file
curl -O http://apache.mirrors.ionfish.org/tomcat/tomcat-8/v8.5.5/bin/apache-tomcat-8.5.5.tar.gz
sudo mkdir /opt/tomcat
sudo tar xzvf apache-tomcat-8*tar.gz -C /opt/tomcat --strip-components=1
cd /opt/tomcat
sudo chgrp -R tomcat /opt/tomcat
sudo chmod -R g+r conf
sudo chmod g+x conf
sudo chown -R tomcat webapps/ work/ temp/ logs/
sudo update-java-alternatives -l
sudo systemctl daemon-reload
sudo systemctl status tomcat
sudo systemctl enable tomcat
With those commands, I had now my Tomcat configured and running, but still need to create and user so I can acess and manage the
webapps and configure them. To do so, i needed to go to /opt/tomcat/conf/tomcat-user.xml and insert:
<user username="admin" password="password" roles="manager-gui,manager-status,manager-script,manager-jmx,admin-gui"/>
,between <user> tags.
Then, after creating a gradle api web project, all i had to do, was to run the following commands on the project folder:
./gradlew clean war
sudo cp build/libs/CalculatorAPI.war /opt/tomcat/webapps
, an them my application was up and running.
to shutdown the program i need to find out the process id with the command :
ps -ef | grep tomcat
and then:
sudo kill -9 <process-ID>
or
sudo service tomcat stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment