apache tomcat development configuration

I’ve been an Apache Tomcat user since 2001 when it was selected by one of my colleagues for an internal work project in a closed lab. We were looking for a way to provide centralized access for project and lab information, especially test instructions. We also wanted to provide a nascent dashboard showing how certain systems were operating, and to control those systems. Over time we managed to do all of that via Tomcat.

Tomcat provided an opportunity for me to learn how to write web-based applications using the then-new Servlet and Java Server Pages (JSP) specification implementation. I also learned how to wire MySQL into the back end of Tomcat, and used that to hold quite a bit of the data our lab was generating at the time. Another opportunity it provided was hosting on various operating systems. The first implmentation of our Tomcat lab site was on a small Windows 2000 system sitting in a corner and unused by the lab staff. It was quickly moved over to a Sun box running Solaris, where it stayed for about a year. The following year we took that old Windows 2000 box and installed Red Hat Linux 7 (not RHEL!) on it, and moved the lab site over to it and brought it all up. It stayed there for the rest of the time I worked in the lab (I left in 2004). It was still running when I returned to the lab in 2013, although by that time that stand-alone system had been imaged and moved to a VMware virtual machine.

I’m running an instance of Tomcat version 10.0.23. I wanted to brush up my very rusty skills and knowledge, and see what has changed across the years (nearly two decades, in point of fact) since I last worked with Tomcat. Since this is a development-only deployment it’s installed in my local development folder. To make things as easy as possible for me, here is how I have my Tomcat configuration file set up.

<tomcat-users xmlns="http://tomcat.apache.org/xml"
              xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
  <role rolename="admin"/>
  <role rolename="admin-gui"/>
  <role rolename="admin=script"/>
  <role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <role rolename="manager-jmx"/>
  <role rolename="manager-status"/>
  <user username="admin" password="admin" roles="manager-gui, manager-script, manager-jmx, manager-status, admin-gui, admin-script"/>

I’ve defined all the role names and assigned all the roles to one username, admin. See lines 5-12. Remember this is a development deployment local to my machine, not something in production. This allows me to work with every page provided by the stock Tomcat web pages.

updating the java jdk path in intellij idea on macos

I have a very short fuse when it comes to wading through bad advice found on the web, especially old technical advice. Case in point, how to update a current release of IntelliJ IDEA’s Java/JDK path to an external JDK already installed on your machine.

I’m currently trying to do some work with:

  • Java/OpenJDK 11.0.5 LTS release distributed by AdoptOpenJDK using
  • IntelliJ IDEA Community Edition 2019.2 on
  • macOS Mojave 10.14.6.

When I started to try and use that Java release, IntelliJ couldn’t seem to find it, and I couldn’t seem to configure IntelliJ where to look. After looking at six-year-old directions via the web that were mostly right I finally figured it out. Here’s what to do with the latest release of IntelliJ.

Open the File menu and select Project Structure. This used to be buried in Other Settings, which is where all those older directions tell you to go. Now it’s out in the open, probably because of the shift from Java8 to Java9 and beyond that’s been occurring every six months since Java9 was released Setember 2018.

A dialog will show up as shown below.

In my example I’ve already set up to use Java 11.0.5. To add a new location, click the red folder on the far right, where you see the help balloon in the screen capture above. Clicking that will open a regular folder/file dialog allowing you to pick he location where your specific Java release is located on your Mac. Once you’ve set up the correct location click OK and go back to editing in the IntelliJ IDE.

I hate searching for technical information on the web, because it is without exception for older (many times far older) software than what you’re currently working with. The majority of it is old crap from Stack Overflow. And as far as I can tell, none of the search engines are capable of bubbling up current information, let alone correct information. I mean, you should have seen what I also got looking for the answer to this question.

You’re welcome.