Using Railo and Resin with domain aliases

There are many guides out there to help you in setting up Railo with IIS. But none of the ones that I found helped you to configure domain aliases.

So I am going to give you a quick example of the way that I have used to configure my domain aliases. I'm sure there are some easier ways of doing it but this is how I did it.

There is a file called resin.conf under the conf folder in you Railo install folder. At the bottom of this file you will find a "</cluster>" tag.

Just before this you will need to add in this piece of code. The host id is the aliases, in this example allmead.com. You will then need to enter the root directory of the actual site. Then you will need to enter where the web site is.

<host id="allmead.com">
<root-directory>C:/Inetpub/vhosts/allmead.co.uk</root-directory>
<web-app id="/" document-directory="C:/Inetpub/vhosts/allmead.co.uk/httpdocs"/>
</host>
<host id="www.allmead.com">
<root-directory>C:/Inetpub/vhosts/allmead.co.uk</root-directory>
<web-app id="/" document-directory="C:/Inetpub/vhosts/allmead.co.uk/httpdocs"/>
</host>

This is very simple to do.
Just remember you will need to restart the Railo server service after you save the file.

Related Blog Entries

Comments
Gert Franz's Gravatar Hi Jonny,

it's even easier if you do it this way:

<host id="allmead.com" root-directory="C:/Inetpub/vhosts/allmead.co.uk">
   <host-alias>www.allmead.com</host-alias>;
   <web-app id="/" document-directory="httpdocs"/>
</host>

You do not need to define it twice. You can even define your hosts implicitly by using regular expressions:
<host regexp="(.+)">
   <host-name>${host.regexp[1]}</host-name>
   <root-directory>C:/Inetpub/vhosts/${host.regexp[1]}/webroot</root-directory>
   <web-app id="/" document-directory="."/>
</host>

Hope that helps...

Greetings from Sydney (ATM)
Gert Franz

Railo Technologies
gert@getrailo.com
www.getrailo.com
# Posted By Gert Franz | 23/05/09 23:58
Jonny Shaw's Gravatar Thanks for that.
I am already using
<host regexp="(.+)">
<host-name>${host.regexp[1]}</host-name>
<root-directory>C:/Inetpub/vhosts/${host.regexp[1]}/webroot</root-directory>
<web-app id="/" document-directory="."/>
</host>
to define my hosts.

But that way of defining the host alias does look easier.
# Posted By Jonny Shaw | 24/05/09 11:01
mike's Gravatar How do I do a regex entry that allows for both the www.domain.com and domain.com addresses to point to the same folder -- in other words, modifying the regex above to remove the www.
# Posted By mike | 22/08/09 20:29

Archives By Subject

Advertising (4) [RSS]
Blog Design (1) [RSS]
CFProject Scripts (2) [RSS]
Coldfusion Charts (3) [RSS]
Coldfusion Functions (5) [RSS]
Coldfusion Overview (1) [RSS]
Coldfusion Tutorials (16) [RSS]
For Sale (2) [RSS]
Image Manipulation (1) [RSS]
Java (1) [RSS]
JavaScript (4) [RSS]
PHP (1) [RSS]
Railo (4) [RSS]
SQL (1) [RSS]
Useful Tools (3) [RSS]

Recent Comments

Coldfusion 8 Functions
Mark said: Can Cold Fusion do math functions similar to say Excel? I need to make several calculations, and if ... [More]

BlogCFC on Railo
iphone clone said: Thanks for sharing [More]

Coldfusion Protx VSP Form Integration Kit
confinedspace said: @Dom: Cheers for that - helped me out. Just one thing to note, I would add "all" as a thir... [More]

Coldfusion to PHP?
Jonny Shaw said: PHP is very similar to most other OOP languages, which i am quite familiar with, so it wasn't really... [More]

Coldfusion to PHP?
Rob said: @duncan - thank you for that link. I am having to start learning PHP and having a guide locally will... [More]

Recent Entries

No recent entries.
ColdFusion Blog | ColdFusion Hosting | ColdFusion Q & A