0

I'm trying to get Tomcat 6 and Railo 3.3 running on my local development box. My experience is with Adobe ColdFusion and figured I would try something new.

I have installed Tomcat in d:\dev\tomcat6\.

I then downloaded Railo's latest war, renamed it to railoapplication1.war and copied it to d:\dev\tomcat6\webapps\ and let it do it's thing.

Tested it I can get to my Tomcat at http://localhost:8080/

and Railo at http://localhost:8080/railoapplication1

Now from what I understand copying the war file this way is the equivalent of creating a new multi-server instance (Under Adobe ColdFusion). After that's done I would usually link up a website to that said instance with a connector.

This is where I get a little confused. My main goal here would be to have multiple 'instances' accessible through the main tomcat binding

localhost:8080/railoapplication1
localhost:8080/railoapplication2
...
localhost:8080/railoapplicationN

But would like to keep my application files seperate from this without using an Apache frontend.

e.g. I want my application at railoapplication1:8080 to look like this:

application files at d:\dev\www\railoapplication1 using the war deployed under d:\dev\tomcat6\webapps\railoapplication1

I've tried editing Tomcat's servers.xml to no avail.

<Host name="railoapplication1" appBase="webapps\railoapplication1"
  unpackWARS="true" autoDeploy="true"
  xmlValidation="false" xmlNamespaceAware="false">
    <Context path="" docBase="d:/dev/www/railoapplication1" />
</Host>

If I do that I can then browse to

http://railoapplication1:8080/index.cfm (a test page)

but it's not getting picked up by Railo at all and I get plain-text instead of seeing my CFML executed

<cfoutput>#now()#</cfoutput>

I must be doing something wrong obviously as it looks like a pretty standard setup.

quanta
  • 50,327
  • 19
  • 152
  • 213
jfrobishow
  • 71
  • 10

1 Answers1

1

You are mixing up appBase with docBase. If you put all the Railo instances in d:\dev\tomcat6\webapps\, you can configure virtual host in Tomcat as belows:

<Host name="railoapplication1" appBase="webapps"
  unpackWARS="true" autoDeploy="true"
  xmlValidation="false" xmlNamespaceAware="false">
    <Context path="" docBase="railoapplication1" />
</Host>

<Host name="railoapplication2" appBase="webapps"
  unpackWARS="true" autoDeploy="true"
  xmlValidation="false" xmlNamespaceAware="false">
    <Context path="" docBase="railoapplication2" />
</Host>
quanta
  • 50,327
  • 19
  • 152
  • 213
  • Right. Ok so I changed it and this work ok. But now I'm getting as if my railoapplication1 webroot is in D:\dev\tomcat6\webapps\railo\ which has its own stuff for management etc. My goal was to leave railo available as is under localhost:8080 and just have my application files reside in their own webroot d:\dev\www\railapplication1\. I suppose this isn't 'required' it's just how I am used to organizing my files. – jfrobishow Oct 13 '11 at 13:33
  • I'm not familiar with Railo, so, please explain more details: what are the _"application files"_? If you still want to leave railo available under `localhost:8080`, just create a virtual host for `localhost` and comment out the `Context` element. – quanta Oct 13 '11 at 14:01
  • by application file I mean the actual code used by a web-app developed by me while leaving the Railo stuff on it's own. Basically a way to tell Tomcat there's a site at railoapplication1:8080, the files are at d:\dev\www\railoapplication1. When you get a file that is a CFML page transfer that to the application server railoapplication1 that is at d:\dev\tomcat6\webapps\railoapplication1 for parsing. Basically seperate the application code form the application server. – jfrobishow Oct 13 '11 at 15:06
  • Actually I think I got this wrong from so many year using Adobe CF's product. My mindset was into Railo magically creating a new Tomcat instance which is how it works in CF (new JRun instance for each CF instance). This is obviously not what's happening with Railo and Tomcat, many Railo can and do talk to one Tomcat if I want seperation of heap and settings, etc I need multiple Tomcat instance, make sense? – jfrobishow Oct 14 '11 at 13:38