For security reasons, I want to put Tomcat under apparmor. The Ubuntu server(12.04 LTS) guide has a good explanation about apparmor, but I am not sure what is the correct way of creating a profile for Tomcat and how to put it under apparmor.
After setting a profile you will be asked to start the program you are profiling and use it like you normally would. genprof will monitor the logs for rule violations and allow you to tweak the profile based on what happens. It will then reload all relevant profiles.