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 server
section, you should fill the blanks ofContext Path
andWAR 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
webapp
folder `/var/lib/tomcat10/webapps` the name underwebapp
folder is the relative URL path for your application. as shown in theMakefile
: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/webapps
before, so you can remove thesudo
prefix in the above commands (not in production environment).