Last active
September 26, 2018 15:25
-
-
Save ViniFKroth/e3f90607d124f3062b7841c7f639e196 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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