Posts tagged: Turnkey

Turnkey Linux – getting my app running on Tomcat the easy way

Deploying applications is not my favorite task. I don’t do it often and every time I’m not really sure what the bloody command was. So, here I go, taking down notes on what I need to do to get my application up and running from scratch.

First off, I decided to use a Turnkey Linux Tomcat on Apache appliance as it contains all I need and provides some nifty and easy to use tools. Not to forget, it’s the minimal configuration and configured to check for updates automatically to keep security risks to a minimum. But the main point for Turnkey Linux is the ability to deploy their appliances onto Amazons Web Services. Sweet, that will allow me to familiarize with just one installation and simply follow these steps on an EC2 instance. It even gives me the ability to backup and restore from local to cloud instances.

The specific steps involved to get it working locally:

  1. Download from http://www.turnkeylinux.org/tomcat-apache. In my case it came as version 11.1
  2. Unzip and run using VMWare Player or Workstation (or use one of the other formats)
  3. Follow the initial steps to set passwords for the different accounts used
  4. Call up the manager at https://[SERVERIP]/manager
  5. Deploy a WAR file (created for example by using “mvn package”) using the “WAR file to deploy” Form. A new application will be created from that WAR and deployed automatically
  6. The one and only tricky part was the mapping configuration. Since Apache is running in front of Tomcat, it will answer all incoming requests. To have it forward these requests to your application, the Apache-Tomcat-Connector has to know about that. Edit the configuration as follows:On your console (of the VM): nano /etc/tomcat6/mod_jk.confAdd the following to lines to the configuration:

    JkMount /yourapplication ajp13_worker
    JkMount /yourapplication/* ajp13_worker

    Note: Yourapplication is the path your application is listed under in the Tomcat Manager.

    Save and close the file with CTL-X and answering YES to the question whether to save the changes

  7. Restart apache with /etc/init.d/apache2 restart
  8. Voila, that’s it, you can find your application running now under https://[SERVERIP]/yourapplication
Use a Highlighter on this page