Last Updated: October 20, 2022
How to run Web App with apache tomcat on Linux.
- 1.Open Maven project.
- 2.Run project as build. as shown in Figure 2.
Right-click → Run As → Maven Build.
Wait until the build finishes.
- 3.Navigate to project location then go to the target file. as shown in Figure 3.
- 4.Copy the war file. as shown in Figure 4.
- 5.Paste it in webApps file. as shown in Figure 5.
go to /var/libtomcat9/webapps
After pasting the war file, a file will automatically be created with the same name of the war file. as shown in Figure 6.
- 6.Run tomcat with the terminal. as shown in Figure 7.
To start tomcat use the following command :
sudo service tomcat9 start
- 7.Go to URL localhost:8080:/app. as shown in Figure 8.
|8080 is the default port for tomcat.|
Now your WebApp is running on tomcat Enjoy.