Well I think raspberry pi 3 (Model B) is a very capable machine and can very well be used as a server for hosting some lightweight web application. I would certainly not want to run an expensive desktop server 24 X 7 and pay huge electric bills just for running a web application for limited users.
Here are the steps for installing tomcat7:
sudo apt-get update sudo apt-get upgrade sudo apt-get install tomcat7
Above command will install tomcat only and not the admin gui. Use following command to install admin gui.
sudo apt-get install tomcat7-admin
Now add a user for accessing admin GUI. Edit your /etc/tomcat7/tomcat-users.xml and add below code sippet in it.
sudo vi tomcat-users.xml # Add following two lines towards the end of file just before closing </tomcat-users> tag. <role rolename="manager-gui"/> <user username="tomcat" password="secret" roles="manager-gui"/>
Manager gui can be accessed on browser at below url. Application can be deployed using manager gui.
After installation you can use following command to start and stop it.
sudo /etc/init.d/tomcat7 start sudo /etc/init.d/tomcat7 stop
If you wish to install tomcat8 then replace tomcat7 with tomcat8 in all above commands.
I installed tomcat7 as i was planning to use raspberry pi’s eclipse to write a web application. It is really an old version of eclipse available on raspberry pi that just supports tomcat7 and not tocmat8. I still need to figure out how to run latest eclipse on raspberry!