You need to install the OpenSSO (now OpenAM) server first. This includes an installation of Tomcat, if you have not installed it yet. Here is a good guide to install OpenAM on Ubuntu. The installation is quite simple, just download the right openam.war
File and copy it to the Tomcat webapps directory. The GUI Configurator will guide you through the rest of the basic configuration process.
Then you need a J2EE Policy Agent for a J2EE application, or a Web Policy Agent for a normal web server or a web app in a different language (Web agents protect resources on web and proxy servers while J2EE agents protect resources on application and portal servers, see here). ForgeRock offers a guide to install a Web Policy Agent for Apache. You will need one Web Policy Agent for each Apache instance, because they are implemented as an Apache module.