Entries Tagged as ' Tomcat'

Running Railo on Tomcat 7

Just wanted to rehash here what I already stated on Twitter. Railo runs fine on Tomcat 7, especially if you followed my previous blog post on installing it. I was able to download Tomcat 7 for Windows, install it (I disabled the Tomcat 6 service briefly) - edit 3 files. Start it up and go to the Railo admin. Once I confirmed everything was working properly, I uninstalled Tomcat 6.

Someone asked on Twitter if it was worth upgrading. I'm of the opinion that anytime you see mentions of clean-up, security fixes, etc. It's always worth upgrading.

Tomcat Param / Railo issue

If you come across this error in your Tomcat logs:

ServletException: static path [/WEB-INF/railo] for servlet init param [railo-web-directory] is not allowed, path must use a web-context specific placeholder.

Open up your web.xml and change:

<param-value>/WEB-INF/railo</param-value>

To:

<param-value>{web-root-directory}/WEB-INF/railo</param-value>

It should fix it.

Tomcat Tip - host specific web.xml

One of the issues I had with Tomcat is that while I'm running Mango blog on my VPS, not everyone else on my VPS is. So, how do I create 'host' specific servlet-mappings without impacting everyone else on my box? As I was digging into the issue, the answer is at the top of Tomcat's web.xml file (located in { tomcat installation dir/conf/web.xml }:

  <!-- ======================== Introduction ============================== -->
<!-- This document defines default values for *all* web applications -->
<!-- loaded into this instance of Tomcat. As each application is -->
<!-- deployed, this file is processed, followed by the -->
<!-- "/WEB-INF/web.xml" deployment descriptor from your own -->
<!-- applications. -->
<!-- -->
<!-- WARNING: Do not configure application-specific resources here! -->
<!-- They should go in the "/WEB-INF/web.xml" file in your application. -->

I hadn't paid attention to this before. Definitely a 'duh' moment. So, inside my web-rat.com's WEB-INF directory, I created a web.xml file with the following:

<?xml version="1.0" encoding="ISO-8859-1"?>
    version="2.5">
        <servlet-mapping>
       <servlet-name>RailoCFMLServlet</servlet-name>
       <url-pattern>/blog/post.cfm/*</url-pattern>
       <url-pattern>/blog/page.cfm/*</url-pattern>
       <url-pattern>/blog/archives.cfm/*</url-pattern>
       <url-pattern>/blog/feeds/rss.cfm/*</url-pattern>
    </servlet-mapping>
</web-app>

Thanks to Tom King (@Neokoenig) for mentioning the Mango specific filters on the Railo list and prompting me to investigate because I knew that my blog archive wasn't working properly. Now they are. :)

Update: Fixed / condensed XML - had some stuff that wasn't necessary. Also, please note "RailoCFMLServlet" should be whatever the <servlet-name> is that you defined in your Tomcat's web.xml.