A simple way to create a new Tomcat virtual host and context

2,234 views
Skip to first unread message

Dr James Bayley

unread,
Jan 13, 2011, 12:03:58 PM1/13/11
to Railo
!!! Goal
You are a Railo and Tomcat newbie and you want a directory to put your
coldfusion files in.

"tomcat\myapp\ROOT" would do nicely

!!! Preconditions (for me anyway)
* 64 bit Windows 7 home premium
* UAC turned off and stays off
* Java installed and JAVA_HOME set

!!! Main Success Scenario

1. Download Windows distribution
2. Install to C:\railo
3. Go to windows services and verify that Apache Tomcat Railo is
running
4. go to http://localhost:8888/index.cfm and the welcome to Railo
should render

<Comment>
This page has a link to documentation called "creating new virtual
hosts". Note that this refers to Jetty and Resin but not Tomcat -
hence this post
</comment>

5. Use the Windows services control panel to stop Tomcat

6. In your Windows hosts file (C:\Windows\System32\drivers\etc\hosts)
create the entry:

127.0.0.1 myapp # Tomcat uses the host name to identify
the requested application.

7. create the directory c:\railo\tomcat\myapp

8. create \myapp\ROOT. (This is where you will keep your
application's .cfm files)

9. create \myapp\ROOT\index.cfm with the contents <cfdump var=
"#CGI#">

10. goto "C:\railo\tomcat\conf\Catalina\
a) create the directory \myapp
b) copy \localhost\manager.xml to \myapp and rename it to
ROOT.xml

11. Edit C:\railo\tomcat\conf\server.xml
a) Find the <Engine></Engine> node and insert

<Host name="myapp" appBase="myapp">
<Context path="keyapt" docBase="C:\railo\tomcat\myapp" />

12. Restart Tomcat. You will see /myapp/WEB-INF and /myapp/ROOT/WEB-
INF directories appear by magic.

13. Browse to http://myapp/index.cfm and you should see the cfdump

14. The goal is complete

CAVEATS
I am a complete newbie and although this is working for me I don't
know whether it is the right way to do it.

Todd Rafferty

unread,
Jan 13, 2011, 12:57:17 PM1/13/11
to ra...@googlegroups.com
In case you want another example:
http://web-rat.com/blog/post.cfm/installing-railo-on-tomcat-the-windows-edition

http://wiki.getrailo.org/wiki/Railo_Installation

Also, the default 3.2 installers now use Tomcat (instead of Resin), so you can just use that as well.

~Todd
--
~Todd Rafferty
Volunteer
Community Manager
Railo Server - Open Source
----

Jordan Michaels

unread,
Jan 13, 2011, 8:19:49 PM1/13/11
to ra...@googlegroups.com
Added this to the Wiki docs just now too:

http://wiki.getrailo.org/wiki/Installation:InstallerDocumentation:MSAddingSites

-Jordan

> ~Todd Rafferty/
> Volunteer///Community Manager


> Railo Server - Open Source
> ----
> Get Railo: http://getrailo.org/
> Write Documentation: http://wiki.getrailo.org/
> Report Bugs: https://issues.jboss.org/browse/RAILO
> Request Features: https://railo.uservoice.com/
>
>

--
Warm regards,
Jordan Michaels
Vivio Technologies
http://www.viviotech.net/
509.593.4207 x 1001

Ben

unread,
Jan 14, 2011, 12:50:09 PM1/14/11
to Railo
My Server Spec:

Provider: Godaddy
Item: VPS Windows 2008 Server 30GB 2GBMainMemory

That server is my playground and a place to test apps.

I'm a complete Tomcat+Railo newbie, though I code ColdFusion 8.0 +
Fusebox + SQL Server at work.

I was able to install Railo+Tomcat using the latest download and was
able to run the admin program.

Now, I am trying to get a virtual host up and running but I couldn't
do it...until I found your post. I think I know the missing step I
need to make and that is set up the hosts entry in C:\Windows
\System32\drivers\etc\hosts , hope that would resolve correctly.

I was also able to setup IIS to detect cfm extensions and redirect it
to the connector. I got that working by simply reading a blog entry
(can't recall at the moment) will post that article later.

On Jan 13, 9:03 am, Dr James Bayley <xjam...@googlemail.com> wrote:
> !!! Goal
> You are a Railo and Tomcat newbie and you want a directory to put your
> coldfusion files in.
>
> "tomcat\myapp\ROOT" would do nicely
>
> !!! Preconditions (for me anyway)
> * 64 bit Windows 7 home premium
> * UAC turned off and stays off
> * Java installed and JAVA_HOME set
>
> !!! Main Success Scenario
>
> 1. Download Windows distribution
> 2. Install to C:\railo
> 3. Go to windows services and verify that Apache Tomcat Railo is
> running
> 4. go tohttp://localhost:8888/index.cfmand the welcome to Railo
> 13. Browse tohttp://myapp/index.cfmand you should see the cfdump

Rodion Bykov

unread,
Jan 14, 2011, 1:06:01 PM1/14/11
to Railo
Hello,

what if I have no hostname for server, using just IP address to
access. What should be given in <Host name=""> clause (or elsewhere)
to properly serve CFMs out of required folder (Apache root for
example) and not from webapps/ROOT that is default ?

Thanks,
Rodion

On 13 Січ, 19:03, Dr James Bayley <xjam...@googlemail.com> wrote:
> !!! Goal
> You are a Railo and Tomcat newbie and you want a directory to put your
> coldfusion files in.
>
> "tomcat\myapp\ROOT" would do nicely
>
> !!! Preconditions (for me anyway)
> * 64 bit Windows 7 home premium
> * UAC turned off and stays off
> * Java installed and JAVA_HOME set
>
> !!! Main Success Scenario
>
> 1. Download Windows distribution
> 2. Install to C:\railo
> 3. Go to windows services and verify that Apache Tomcat Railo is
> running
> 4. go tohttp://localhost:8888/index.cfmand the welcome to Railo
> 13. Browse tohttp://myapp/index.cfmand you should see the cfdump

Rodion Bykov

unread,
Jan 14, 2011, 2:04:39 PM1/14/11
to Railo
My fault. Everything working fine, just need to add <Context path=""
docBase="/my/path/" /> to localhost <Host>. Remember of case
sensivity: docBase, not docbase !

-Rodion

On 14 Січ, 20:06, Rodion Bykov <rodionby...@gmail.com> wrote:
> Hello,
>
> what if I have no hostname for server, using just IP address to
> access. What should be given in <Host name=""> clause (or elsewhere)
> to properly serve CFMs out of required folder (Apache root for
> example) and not from webapps/ROOT that is default ?
>
> Thanks,
> Rodion
>
> On 13 Січ, 19:03, Dr James Bayley <xjam...@googlemail.com> wrote:
>
>
>
> > !!! Goal
> > You are a Railo and Tomcat newbie and you want a directory to put your
> > coldfusion files in.
>
> > "tomcat\myapp\ROOT" would do nicely
>
> > !!! Preconditions (for me anyway)
> > * 64 bit Windows 7 home premium
> > * UAC turned off and stays off
> > * Java installed and JAVA_HOME set
>
> > !!! Main Success Scenario
>
> > 1. Download Windows distribution
> > 2. Install to C:\railo
> > 3. Go to windows services and verify that Apache Tomcat Railo is
> > running
> > 4. go tohttp://localhost:8888/index.cfmandthe welcome to Railo
> > 13. Browse tohttp://myapp/index.cfmandyou should see the cfdump
>
> > 14. The goal is complete
>
> > CAVEATS
> > I am a complete newbie and although this is working for me I don't
> > know whether it is the right way to do it.- Сховати цитований текст -
>
> - Показати цитований текст -

Ben

unread,
Jan 15, 2011, 3:00:37 AM1/15/11
to Railo
Ok, here is the link for setting the connector for a domain host...

http://www.dougboude.com/blog/1/2009/09/Railo-31-on-Windows-Server-2008-and-IIS7--Part-3-of-3.cfm


I also got the hosts file updated by adding this entry...

127.0.0.1 mydomainname.com

BTW, the path to the file is C:\Windows\System32\drivers\etc



That's pretty much it, with the help of this thread I was able to
figure out the missing piece.

Thanks much!
> > 4. go tohttp://localhost:8888/index.cfmandthe welcome to Railo
> > 13. Browse tohttp://myapp/index.cfmandyou should see the cfdump
Reply all
Reply to author
Forward
0 new messages