Getting started with Apache Tomcat Deployment

I always feel insecure about projects that involve multiple new fields. The most general field I could post over the next one is DevOps. I’ve done relatively little programming the last few years, instead cracked my head over customer requirements, business strategies and organization. I’ve never created my own web server in an intranet network, because the only software I ever got to roll out myself was a desktop app on windows: Locate .exe, Copy & Paste.

The Circumstances

I’m mostly restricted to a workplace with remote administrative support. I have no admin access myself, so whatever I want to get installed or configured onto my local machine has to go through a communication process that is slow and unwieldy. Reason: Security.

I will soon inherit the application server of a colleague who got promoted to a new team somewhere else. The usual scenario: Someone wanted an app, someone else tinkered around with an old pc that was available, some generations of trainees and students without expertise build something that “runs” over some 15 years. There is apache on that server, so that’s good, I guess.

I have access to a virtual machine with full admin access for me, so building a prototype there to get in touch with the tech-stack seems a good way to start. Obviously, I still don’t know what to do in there.

The Idea

There is the legacy system build on php, provided by xampp and apache. I injected source control and a scm-system behind it to prepare for the future maintenance of those applications, approaching some minimum of efficiency. (So far, every kind of development was done directly on the productive system. No back-up strategy.)

If php was okay, I’d just run with that, and all would be fine. But php is at odds with some other specifications from our vague enterprise architecture, so I have to switch to Java EE.

That hatched the idea of just plugging in the tomcat behind the apache and roll with it.

The Problem

I have no (real) experience with:

  • Apache

  • Tomcat

  • JavaEE

  • MS Servers

  • Configuration and Implementation in a network

Because of all those unknowns, I would lose a lot of time just figuring out how much complexity actually hides behind each topic. What are the dependencies? What’s the minimum to get going and learn on the job and what is really necessary to avoid future disaster?

The Request

Could someone please give me some guidelines to approaching this? What should I start with? What are good resources? What can I safely avoid? I think something like a rough step-by-step guide would be neat, but for all I know the advice could be: “Just install apache tomcat and put your code in folder X; it really is that simple”.

You don’t need to worry about The Circumstances, but these complications are part of my every day work life, and often break tutorials or common approaches. (For instance: I can’t use maven like most resources suggest, because all it’s repositories are black-listed by my company). So the circumstances might really be irrelevant to your response, but were kind of important to explain my problem comprehensively.

If it helps at all, I worked a bit with apache and Tomcat a few years ago, and this summary is pretty accurate:

Just install apache tomcat and put your code in folder X

I ended up using Jetty for the server tutorials because it requires a bit less setup, but Tomcat isn’t bad once you get used to it.

Your best bet is to google stuff like “java tomcat getting started” or “java tomcat hello world”. But in general the way I remember it working is:

  1. Install Tomcat.
  2. Create a directory. Tomcat calls this the “catalina home” directory.
  3. Put your webapp(s) inside that directory.
  4. Run Tomcat.

Tomcat will read from the catalina home directory and serve your webapps. Everything else from that point on should be compatible with any other Java server tutorials you find, including these!

1 Like

Thanks a lot @Kevin!

That sounds like a decent approach, I’ll go with it.

The legacy system I mentioned uses xampp. I must have had a bad day, because I did google and had not found that xampp has a tomcat plug-in. Together with your information, I’m confident the whole set-up will be straight forward and not throw any (more) bad surprises at me.

I did your server tutorials (well, half of them), so I’m familiar with jetty and can now be confident tomcat will run pretty much like it. :smiley:

~Cheers!