Wikipedia defines Tomcat as a servlet container developed by the Apache Software Foundation which implements the Java Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, and provides a “pure Java” HTTP web server environment for Java code to run. What does this all mean, and why is it important?
Well for starters, the built in web server on Windows Home Server is not capable of serving up JSP. This means you have to use a different server to do this. Why would you want to? Well, VMWare Server for one uses this method, and HP uses it with the EX485 and EX487 machines and a different server to do the same on the EX470 and EX475 for the webshares and photo gallery stuff. But the main goal of this tutorial is going to be getting SubSonic Media Streamer installed. But we will get to that much later.
Originally, I wanted to get Subsonic installed, because it is a nice package (check it out, it’s worth at least looking). There is a Windows installer, or you could just install Tomcat. Both require you opening up another port. Which is something that I don’t like doing if I can avoid it. Looking into solutions to my problem, I ran across “Jakarta”. For those with MediaSmart Servers, you may recognize this. I know I did. Jakarta is a connection software that allows “IIS” (the built in web server for WHS) to redirect to Tomcat and serve up those JSP pages.
What does this mean to most people? It means using “https://myserver.homeserver.com/subsonic/” instead of “http://myserver.homeserver.com:8080/” and some more control about what’s available over the internet.
However, this tutorial is only for people who don’t have MediaSmart Servers, because the EX48x series already has Tomcat installed, and the EX47x series has some special considerations for installing, that I will not cover here but will definitely cover later.
What you will need:
- Java – Get the most updated one. I recommend the Offline as it won’t have to go and download stuff also.
- Apache Tomcat – Grab the “Windows Service Installer” from the bottom part of the page
- Jakarta binary for Win32 – it should be named “isapi_redirect-1.2.28-chunking.dll”, and if this causes issues, grab the one without the “chunking” in the name.
What to do
First, download all three of these files to a place you access them. Preferably the Home Server desktop, or copy them to it. Once you do that, run the Java installer. It’s default location should be absolutely fine, but just keep a note of where you install it to. (Should be “C:\Program Files\Java\jre6″ by default).
Once Java is installed, start the Tomcat installer. Agree (and read) the license agreement, and then proceed to the options. You’ll want to enable the “Service” and “Examples” options, and if you want, the “Native” option also. After that, you should be able to just use all the defaults and it should pick up the location that Java is installed.
You’ll probably have to start the Tomcat service now. Either just reboot the server, or open up Services console (located in Administrative Tools, or by running “services.msc”). It should be near the top and named “Apache Tomcat 6″, or similar. Start the service, and leave this console open, you’ll need it later.
After it’s started, try opening “http://localhost:8080/examples/servlets/servlet/HelloWorldExample” on your server, if you installed the examples that greets you with “Hello World”.
After that’s done and you’ve verified that it’s working, we need to configure it and IIS to work with each other. in the Tomcat directory (should be “C:\Program Files\Apache Software Foundation\Tomcat 6.0\” by default), and create a folder called “ISAPI”. Copy the Jakarta dll file (isapi_redirect….) to this folder and rename it to just “isapi_redirect.dll”. Right click it and select properties. If the “unblock” button is there, click it and then click Okay. If it isn’t, don’t worry. Now, right click on the ISAPI folder and select properties. Open the Security tab and add “NETWORK SERVICE” to the list of users.
Now create a text file in that same directory named “isapi_redirect.properties”. Open this file up in notepad and add the following to the contents of the file:
extension_uri=/jakarta/isapi_redirect.dll log_file=C:\Program Files\Apache Software Foundation\Tomcat 6.0\logs\isapi_redirect.log log_level=info worker_file=C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\workers.properties worker_mount_file=C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\uriworkermap.properties
Save the file and close it. Now go to “C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\” and create “workers.properties”. Set the file to the following:
worker.list=wlb,jkstatus worker.ajp13w.type=ajp13 worker.ajp13w.host=localhost worker.ajp13w.port=8009 worker.wlb.type=lb worker.wlb.balance_workers=ajp13w worker.jkstatus.type=status
Save the file, close it and now create “uriworkermap.properties” in the same folder and set it to the following:
This last file configures what directories will be passed on from tomcat to IIS. Right now, this enables the “examples” directory to be passed on and accessible from the remote access website. If you need to add more, like subsonic, add “/subsonic/*=wlb”.
Once that is done, you’ll need to open up “Internet Informational Services (IIS) Manager. Navigate down to “Web Services Extensions” and right click on it, and select “Add a new web service extension…”. Name the Extension “Jakarta” and then click the “Add” button. If everything is in the default location, use “C:\Program Files\Apache Software Foundation\Tomcat 6.0\ISAPI\isapi_redirect.dll” for the path to the file. Click okay, and then check “Set extension status to Allowed” and then click Okay.
Open up “Web Sites” and right click on “Default Web Site” and select properties. Open up the “ISAPI Filter” tab. Click “Add”, set the filter name to “Jakarta” and the executable to “C:\Program Files\Apache Software Foundation\Tomcat 6.0\ISAPI\isapi_redirect.dll”. Click okay twice and then right click on “Default Web Site” select “New >” and “Virtual Directory”. Use the “alias” of “jakarta” and use “C:\Program Files\Apache Software Foundation\Tomcat 6.0\ISAPI” for the folder. Set the options for read, script and execute. Click Okay, and open up the Services console again and restart the “World Wide Web Publishing Service” .
Once that is done, open up “https://mydomain.homeserver.com/examples/servlets/servlet/HelloWorldExample” on any computer and you should be greeted with a familiar “Hello World” page.
Now you have a fully working Java server installed, configured and serving pages to the outside world.
Next, I’ll be going over how to install and configure Apache Tomcat on your HP MediaSmart Server Ex470/EX475.