Enter the following commands into the VMWare visible console.
- Ubuntu server doesn't include add-apt-repository so first install that
sudo apt-get install software-properties-common
Enter "Y" if prompted.
- Add the repository that contains Oracle information
sudo add-apt-repository ppa:webupd8team/java
Press "Enter" to continue.
- Update the list of available packages
sudo apt-get update
- Install Oracle 7
sudo apt-get install oracle-java7-installer
Enter "Y" and click on "<OK>" to accept the license
- Verify Java is installed by running
You can set the JAVA_HOME for all processes by adding a adding a JAVA_HOME entry in /etc/environment. You have do this with escalated privileges/sudo. I added this:
Tomcat requires java so you must have some version installed as shown above.
- Install the Tomcat app server using apt-get
sudo apt-get install tomcat7 tomcat7-admin ufw libtcnative-1
- Install the Apache web server using apt-get This is optional for just hacking around in tomcat but is recommended for real production systems.
sudo apt-get install apache2 libapache2-mod-jk
- And now install the MS SQL Server, MySql and Postgresql java drivers if you are going to want them for your app-server installation
sudo apt-get install libjtds-java libmysql-java libpg-java
- Groovy is cool so install just because
sudo apt-get install groovy
- Edit /etc/default/tomcat7 and set the JAVA_HOME to /usr/lib/jvm/java-7-oracle
Reconfigure the Apache mod-jk plugin that talks to Tomcat if you installed Apache2 in the previous section.
- Edit /etc/libapache2-mod-jk/workers.properties
- Change workers.tomcat_home to be point to tomcat7 instead of tomcat6
- Change the default java version to point to the oracle JDK
Restart the servers to pick up the changes
- Restart tomcat7 to pickup the changes
sudo service tomcat7 restart
- Verify the services running by hitting the tomcat server on port 8080 with your browser http://<ip>:8080/
- Restart apache2 if installed
sudo service apache2 restart
- Verify the web server is running through the browser by requesting on port 80 http://<ip>
- Verify they web server and tomcat are wired together using the link below
I was able to glean useful information on this topic from the following web sites.