A simple project to install Tomcat binaries on a target

Project overview.

Here is a summary of what this project wil achieve.

  • This project will deploy Tomcat 7 binaries onto a target server.
  • It will copy a tomcat-users.xml onto the target and then start the Tomcat server.
  • Please note in addition to the Tomcat7 plugin there are also plugins to install Tomcat 8 and 9 versions.
  • This project is configured for use on Linux/Mac only.

What is preconfigured and demonstrated.

The project demonstrates the following configurations:
  • Target servers for Linux/Mac using localhost
  • Use of the Remote agent plugin
  • Use of external resources to download Tomcat binaries from the internet
  • Use of a product environment
  • Copy task
  • StartTomcatTask
  • TomcatBinaryInstallTask
  • Use of built in variables such as ${ARCHIVE_ROOT}

 

How to use this project.

  1. Download the project to your desktop by clicking on one of the links. The file will be saved as Tomcat-7-Install-41.zip
  2. Log into your RapidDeploy instance as mvadmin.
  3. Navigate to Resources-> Projects.
  4. In the top right hand corner click on the Upload Project button.
  5. Select the zip file you downloaded in step 1.
  6. You are guided through a project import wizard. The important thing to check and change (if necessary) here is the path to the project storage directory. Ideally this should be under the projects directory in your RapidDeploy installation. E.g.
    1. /usr/midvision/projects/Tomcat-7-Install-41
  7. Once the project has been imported, we need to amend the deployable installer. Apache regularly update their releases. For this reason you will need to check and amend the release URL.
    • Navigate to Resources -> Libraries .
    • Click on the Tomcat-7-Binary-Install-Package  resource and then click the Open  button.
    • Check the HTTP File URL  is correct and amend for your version of Tomcat. You can get the latest version 7 links from here, and version 9 download links from here.
    • Once updated, click on the Check Resource  button in the bottom right corner to check connectivity to the resource.
    • Save the library.
  8. Once the project is imported and required resource selected, you’ll need to create a package to deploy.
    • Firstly, navigate to Resources-> Projects and edit the project (pencil icon on the tool menu).
    • Navigate to the Packages tab and click the Create Package  button. A new package is created with a version number. This is the package you’ll deploy later, containing all the environment definitions, actions and payload (scripts) to allow the jobs to be run on all defined servers. It might take a while to see the package in this panel as package creation triggers the download of external resources into the package and, depending on your internet speed, this could take a couple of minutes. Hit the refresh button if you want to wait for it. Alternatively, you can follow the package creation on the executing jobs panel.
    • Over time, as you update the configuration or payload (War file), you’ll create more packages, which are a versioned snapshot of the configuration and payload at the time they are created. You can also use external plugins, such as our Jenkins package plugin, to create packages from Jenkins as soon as the War file has been created from your build process.
  9. Now you can run a new job to the environment of your choice.
    • Navigate to Jobs-> New Job.
    • Double click on the ‘Empty’ project job box, and select the project you created earlier from the droplist.
    • Select the Target  you want to deploy from the droplist.
    • Select the  Version (package version) you want to deploy from the droplist.
    • Since there is only one package, it is preselected. The latest package will always be preselected by default.
    • Click on the  Run button in the bottom right corner, enter a comment for this run and click and click Yes .
    • The deployment is started. Click on the Running Jobs icon in the top right corner and you see the tasks executed and job log in real time.
  10. Once the job completes, you can check the installation by accessing the Tomcat management app at http://localhost:8080/ (Username: tomcat, Password: tomcat)
  11. You can browse the Tomcat installation under /usr/local/tomcat7.

Further Reading

The following links will help you gain a deeper understanding of the tasks used in this project:

Reviews

There are no reviews yet.

Be the first to review “Apache Tomcat Install Blueprint”