Tomcat_configuration
Installation
|  |  | 
Configuration
follow archwiki
Run
use /usr/share/tomcat/bin/{startup.sh,shutdown.sh,..} to start and stop tomcat
Web Application
This is my web application project structure.
|  |  | 
You should move the compiled classes(with directories) in target folder to WEB-INF/class folder
Here is a sample Makefile:
|  |  | 
Run your project
Add your project to tomcat application paths, there are three measures to achieve this:
- through tomcat web interface http://localhost:8080/manager/html
In Deploy->Deploy directory or WAR file located on serversection, you should fill the blanks ofContext PathandWAR or Directory path, which are the relative path of URL and the actual project web content path respectively.
- use configuration file: follow /etc/tomcatn/Catalina/localhost/whatShouldFollowLocalhost.xml - ArchWiki
- (Recommend: suitable for refresh) copy your web application folder under the tomcat's default - webappfolder `/var/lib/tomcat10/webapps` the name under- webappfolder is the relative URL path for your application. as shown in the- Makefile:- 1 2- sudo rm -rf /var/lib/tomcat10/webapps/pokemon-gallery/ sudo cp -r ./WebContent/ /var/lib/tomcat10/webapps/pokemon-gallery/- It's even better to execute command - sudo chmod -R 777 /var/lib/tomcat10/webappsbefore, so you can remove the- sudoprefix in the above commands (not in production environment).