Railo: Configuring New Webs

Railo offers something thats called a Web. A Railo Web is a webroot that has it's own WEB-INF directory that allows you to manage the settings separately.

So what does that mean exactly? Well when I administer my Railo web using the Railo Web Administrator I can manage my web completely separate from all other Webs including Datasources, debugging settings, Locale/Time zone and just about all other settings but they only affect my Web. In Adobe CF all these settings are global to all sites on the same server, Railo separates all of this into Railo Webs.

Creating a Railo Web

The process of creating a Railo Web is pretty easy though it is a manual process. The first thing you need to do is edit the resin.conf file located in /conf/resin.conf. Then you just need to add your new Railo Web. I added my railo web under the default host with the empty ID.

You do have to restart the Railo server after creating a new web but that takes all of 2 seconds.


<host id="myrailo" root-directory="c:\projects">
    <web-app id="/" root-directory="myrailo"/>
</host>

On restart Railo creates your new Web and adds a bunch of files and directories in the WEB-INF directory.

Configuring the Hosts file

We aren't quite done yet since we created the web with the host ID of myRailo we need to add an entry in our hosts file to correspond to our host id. In windows thats under \system32\drivers\etc\hosts. I added 127.0.0.1 myrailo and saved the file. Once thats done you are done.

Open your browser to http://myrailo:8600/railo-context/admin/index.cfm to get to the Web Administrator panel. You will have to create a new password and then you can start administering your Web.

Whats the Benefit?

Well the biggest benefit is complete isolation of resources. A Railo web can be completely and separately managed from all other Webs without affecting any of the other webs. Each Railo web can have it's very own Time Zone! I struggle with this on my own Blog. My blog is hosted in Virginia with the EST timezone but I am in Munich which is GMT +1. All my posts reflect the EST time zone because it's sever wide. If my host was using Railo he could create a Railo Web for me and I could manage my own site, create my own DSN's, Mappings and everything without worrying that I mess anything up outside of my own web.

Naturally of course the Server administrator can turn on and off what can be done in the Web administrator. You can define how many DSN can be created, limit file access to within the webroot or restrict it etc.

The biggest benefit I see to this is a very easy way to set up a Railo Hosting service. Now if only I had my own server!

15 Comments to "Railo: Configuring New Webs"- Add Yours
Markus Skrabal's Gravatar Hi Gary, good tutorial.
Do you also know how to do this with JBoss?

thx Markus
# Posted By Markus Skrabal | 9/11/08 9:22 PM
Dan Vega's Gravatar Do you know what the default username / password is for the admin?
# Posted By Dan Vega | 9/11/08 11:12 PM
Gary Gilbert's Gravatar @Dan,

There isn't a default username/password for the admin, at least not what I have experienced. When you install Railo for the first time and go to the admin panel you are prompted to enter a password, that becomes the password for the admin and root context.

@Markus,

Nope haven't done it yet with JBoss but will post about that once I've tried it out :) Unless someone beats me to it.
# Posted By Gary Gilbert | 9/11/08 12:43 AM
ziggy's Gravatar I wish they had instructions. None that I can see.

1) Everything just gave an error like:

[C:\Program Files\Railo\webapps\ROOT\mysite\index.cfm] not found.

Except my localhost is on F.

I found a blog post about configuring "resin.conf" so I fiddled with that and the host location and worked.

2) Now I just get an error about no SMPT configured. When I try to add one in the server admin ('update', I suppose), it just disappears. I tried 'verify' instead and get a message saying:

Element at position [1] doesn't exist in array.

So, I'm still stuck.

Anyone know what to do? Ideas???
# Posted By ziggy | 9/12/08 9:26 AM
Gary's Gravatar @ziggy

Not sure what you mean that your localhost is on F drive, do you mean through IIS? The default install of Railo has it's own web-server.

So when you install Railo it drops it in the location that you specific so with default install on windows it puts it in: C:\Program Files\Railo\

or localhost:8600/

The default host in the resin.conf file looks like:

<host id="" root-directory=".">
<!--
- configures an explicit root web-app matching the
- webapp's ROOT
-->
<web-app id="/" root-directory="webapps/ROOT"/>
<web-app id="/resin-admin" root-directory="${resin.home}/php/admin">
<!--
- Administration application /resin-admin
-
- password is the md5 hash of the password.
- localhost is true to limit access to the localhost
-->
<prologue>
<resin:set var="resin_admin_password" value=""/>
<resin:set var="resin_admin_localhost" value="true"/>
</prologue>
</web-app>
</host>

To add a new one oustide of the C:\Program Files\Railo\ directory just do the following:

<host id="testweb" root-directory="c:\projects">
<web-app id="/" root-directory="testweb"/>
</host>

then in your hosts file add an entry for your localhost like so:
"127.0.0.1 testweb" (without the quotes)

then once you have an index page in the folder go to http://testweb:8600/index.cfm

Thats all I did and it worked just fine just like I wrote in my blog entry
# Posted By Gary | 9/12/08 2:38 PM
Gary's Gravatar @Ziggy the mail server issue is a known problem with the Railo Administrator and a fix is currently under way.

As a temporary work around you can add a mail server manually (manual entry solution provided by
Christoph Smitz on railo_talk).

Open railo-web.xml.cfm and look for the &lt;mail&gt; tag.
Between opening and closing tag add your server:
<server password="yourpass" port="25" smtp="yourserver"
username="yourusername"/>
# Posted By Gary | 9/12/08 2:57 PM
ziggy's Gravatar Thanks for your help.

Yes, my sites are sitting on F:. What I did was change the line between host tags in resin.conf:

<web-app id="/" root-directory="webapps/ROOT"/>

to:

<web-app id="/" root-directory="f:"/>

and those errors stopped. I have no idea if that's right or not.

I searched for the file you mention; there are 3. I added the line to all of them one by one after another mail related tag and still get the same error after restarts:

Railo 3.0.0.005 Error (Railo.runtime.net.mail.mailexception)
Message    no SMTP Server defined

I then removed the cfmail tag from the errorhandler the error was referencing and now get only debugging output, no output at all on my main index.cfm page. Everything else seems to come up fine.

So:

1) Any other ideas on the mailserver? Is it only on windows or something this bug?

2) I turned off debugging, so now zero output on my main index page for some reason (ideas???), but how do you know where to set things in the admin? I turned off debugging in the server admin first, thinking everything there is server wide, and that did nothing. Then did it in the web admin and that turned it off.

3) where is the error log? I can't find it, it's not in the "logs" folder.

They really need to add a help/install file so we can get going with what sounds like a great product! A help button in the admin would be good.

Thanks again for any help.
# Posted By ziggy | 9/12/08 7:21 AM
ziggy's Gravatar >>I added the line to all of them one by one after another mail related tag and still get the same error after restarts

Correction, I added them inside the mail tag as supposed to.

Gert replied to me - how does he find the time? - and noted the yahoo group where I saw your post, thanks. I'll post there.
# Posted By ziggy | 9/12/08 8:34 AM
Manuel's Gravatar Excuse the newb question, but couldn't you achieve the same thing by just deploying another railo instance to the application server?
That would most likely use more resources but would make the configuration a little bit easier I guess.

Has anyone managed to create webs with railo in jboss?
# Posted By Manuel | 9/17/08 6:23 PM
Gary Gilbert's Gravatar When installing Railo with Resin the configuration of new webs is pretty simple, installing another railo server in my opinion doesn't make sense, further you would need to configure it on another port, whereas creating another web runs all on the same port.

As to webs on JBoss I haven't tried it yet.
# Posted By Gary Gilbert | 9/17/08 6:43 PM
Manuel's Gravatar Maybe I need to clarifiy. I meant just deploying the railo "engine" as web app several times as you do it when you deploy it to jboss or any other j2ee app server.
# Posted By Manuel | 9/17/08 8:25 PM
Gary Gilbert's Gravatar @Manuel,

it may be a little easier upfront but I wouldn't think it to be the best approach, I would rather be able to create my web contexts and have only one engine running and save the server resources.

As soon as I figure out how, or someone tells me how, to configure the webs for railo on jboss I will definitely post it.
# Posted By Gary Gilbert | 9/25/08 3:24 PM
Markus Skrabal's Gravatar Hi Gary, i solved the problem with jboss. now my railo is running
on jboss wit multiple web-contexts. In post a tutorial on my blog.

markus
# Posted By Markus Skrabal | 10/28/08 9:26 PM
Craig Arnett's Gravatar can anyone confirm how to redirect the port for railo from 8600 to 80?
# Posted By Craig Arnett | 11/18/08 11:07 PM
# Posted By Gary | 11/19/08 1:12 PM

Powered By Railo

Subscribe

Subscribe via RSS
Follow garyrgilbert on Twitter Follow me on Twitter
Or, Receive daily updates via email.

Tags

adobe air ajax apple cf community cfml coldfusion examples ext flash flex google javascript max2007 max2008 misc open source programming railo software technology ui

Recent Entries

Converting structkeys to lowercase

Blogroll

An Architect's View
CFSilence
Rey Bango
TalkingTree

Wish List

My Amazon.com Wish List