Setting up Tomcat7 on Ubuntu.
Setting up Tomcat 7 on ubuntu.
sudo apt-get install tomcat7 tomcat7-admin tomcat7-docs tomcat7-user tomcat7-examples
sudo service tomcat7 restart
Setting up tomcat users with access to the admin and managers.
<!-- Located: /etc/tomcat7/tomcat-users.xml -->
Setup the webapps virtual host directories in /var/lib/tomcat/webapps* or some other location of your choosing and change the permissions on the directory for owner and group to tomcat7.
This is an example of my directory.
Add virtual hosts by changing the name and appbase and then copying the Catalina included apps like host manager to the directory which is show below in Virtual Host Manager.
<!-- Located: /etc/tomcat7/server.xml -->
Setting up the virtual host manager, docs and admin for your virtual hosts. Copying the manager.xml, examples.xml, host-manager.xml and docs.xml to each virtual host will allow you to use the apps with your virtual host.
When installing and setting up Tomcat7 and you get a port permissions error goto /etc/default/tomcat7 and set AUTHBIND=yes.
Then configure authbind.
sudo touch /etc/authbind/byport/80
The error that appears in the tomcat7 logs.
EVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-80"]
When using the manager to deploy large war files bigger than 50MB. The max size has to be adjusted.
<!-- Located: /usr/share/tomcat7-admin/manager/WEB-INF/web.xml -->
When uploading a war and getting permission denied tells you the directories that hold the webapps do not have owner and group set to 'tomcat7' and need to be changed.
Fix the error by changing the owner and group with something like this:
The error that occurs in /var/log/tomcat/catalina[date] log.
SEVERE: HTMLManager: FAIL - Deploy Upload Failed, Exception: java.io.FileNotFoundException: /var/lib/tomcat7/webapps_teamcity/ROOT.war (Permission denied)
Setting up more memory for Tomcat
# Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved
Lower left of the screen shot shows the memory usage. domain.tld/manager/status