Virtual Dir in Railo/Lucee and IIS7

265 views
Skip to first unread message

pat forbes

unread,
Jun 20, 2015, 6:06:56 PM6/20/15
to lu...@googlegroups.com
I am really sorry, but I've about goggled myself to death, my eyes are swollen, and my fingers are bleeding.

I have tried this with Lucee and now Railo 4.2.1.008 (windows 2008 and IIS7)

To add a "virtual directory" in IIS7, all that's needed is to:
1. Right click the "Default Web site",
2. Select the "Add Virtual Directory",
3. Put the name in the Alias field (ie, "my_site")
4. Add the Physical Path (C:\inetpub\wwwroot\websites\my_site)

and bada bing, it's done... ready to be used.

I can go to http://localhost/my_site/index.htm and it displays fine

But if I put a cfm file in that folder and go to http://localhost/my_site/index.cfm, using .cfm instead of .htm) I get an error:
Railo 4.2.1.008 Error (missinginclude)
Message Page /my_site/index.cfm (c:\inetpub\wwwroot\my_site\index.cfm) not found.

That is is NOT where the file is... it should have been:
C:\inetpub\wwwroot\websites\my_site\index.cfm
It should have said: c:\inetpub\wwwroot\my_site\index.cfm

It appears that Railo/Lucee is not using the same virtual dir that was setup in IIS7.

Railo/Lucee thinks the vittual dir is c:\inetpub\wwwroot\my_site
and IIS7 thinks it is C:\inetpub\wwwroot\websites\my_site (where it actually is)

If I put ANY htm file in C:\inetpub\wwwroot\websites\my_site, it will display with localhost/my_site/filename.htm

But if I put ANY cfm file in C:\inetpub\wwwroot\websites\my_site, and try to use localhost/my_site/filename.cfm I'll get the error.

btw: If I move the folder to C:\inetpub\wwwroot\my_site and set the Physical Path (C:\inetpub\wwwroot\my_site) everything works.

I just don't understand why a cfm file will not display if it's in a sub directory (ie c:\inetpub\wwwroot\websites)

It's like IIS7 handles the alias ok, but Railo/Lucee needs another setting so that it maps to the correct folder.

What am missing?

btw: I've been coding CFML since it was version .9  (yep, point 9)

-pat-





Igal @ Lucee.org

unread,
Jun 20, 2015, 6:14:26 PM6/20/15
to lu...@googlegroups.com
you managed to type quite a bit with bleeding fingers and swollen eyes, so TBH I didn't read it all in detail, but...

looks to me like what you're missing is a Context/path entry in Tomcat/conf/server.xml, so for the Host element of that site, you want to add something like:

    <Context path="/my_site" docBase="C:/inetpub/wwwroot/websites/my_site" />

and restart Tomcat for the changes to take effect.

Igal Sapir
Lucee Core Developer
Lucee.org

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/cbc06aca-7ad9-44bb-8d2e-428e682fdd2b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pat forbes

unread,
Jun 20, 2015, 7:14:49 PM6/20/15
to lu...@googlegroups.com
Thank you for your reply.
Yep... I did type a lot.  I wanted to make sure I explained it.  Probably too wordy :)

I added  the context path to the existing entry in server.xml like this:

      <Host name="localhost" appBase="webapps">
        <Context path="" docBase="C:\inetpub\wwwroot\" />

        <Context path="/my_site" docBase="C:/inetpub/wwwroot/websites/my_site" />
      </Host>

and then restarted Tomcat
but I get the exact same error:

It still shows
Railo 4.2.1.008 Error (missinginclude)
Message Page /my_site/index.cfm (c:\inetpub\wwwroot\my_site\index.cfm) not found.

It stll thinks my_site is a sub folder of c:\inetpub\wwwroot\"
when its actually c:\inetpub\wwwroot\websites

-pat-

pat forbes

unread,
Jun 20, 2015, 7:19:36 PM6/20/15
to lu...@googlegroups.com
btw: if i create a dummy.htm, a dummy.txt, and a dummy.cfm (all three the exact same with one line<h2>you are in dummy</h2>
If I use http://localhost/my_site/dummy.htm --> it works
If I use http://localhost/my_site/dummy.txt --> it works
If I use http://localhost/my_site/dummy.cfm --> it fails with:
Message Page /my_site/dummy.cfm (c:\inetpub\wwwroot\my_site\dummy.cfm) not found.

Jon Clausen

unread,
Jun 20, 2015, 7:29:02 PM6/20/15
to lu...@googlegroups.com
I think you need the "allowLinking" attribute in your Tomcat context config:

allowLinking="true"
HTH,
Jon

[Note: Typo assistance courtesy of iPhone]

p...@westhold.com

unread,
Jun 20, 2015, 7:35:35 PM6/20/15
to lu...@googlegroups.com

I’m not seeing where this goes in context.xml

<Context useHttpOnly="true">

    <!-- Default set of monitored resources -->

    <WatchedResource>WEB-INF/web.xml</WatchedResource>

 

    <!-- Uncomment this to disable session persistence across Tomcat restarts -->

    <!--

    <Manager pathname="" />

    -->

 

    <!-- Uncomment this to enable Comet connection tacking (provides events

         on session expiration as well as webapp lifecycle) -->

    <!--

    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />

    -->

</Context>

I’m really sorry for being able to get this.

 

-pat-

--
You received this message because you are subscribed to a topic in the Google Groups "Lucee" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lucee/0bQpWRQLiFY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lucee+un...@googlegroups.com.


To post to this group, send email to lu...@googlegroups.com.

Jon Clausen

unread,
Jun 20, 2015, 7:38:29 PM6/20/15
to lu...@googlegroups.com


[Note: Typo assistance courtesy of iPhone]

Igal @ Lucee.org

unread,
Jun 20, 2015, 7:42:51 PM6/20/15
to lu...@googlegroups.com
@Jon, this is from the Tomcat 7 docs:

https://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Common_Attributes

"NOTE: This flag MUST NOT be set to true on the Windows platform (or any other OS which does not have a case sensitive filesystem), as it will disable case sensitivity checks, allowing JSP source code disclosure, among other security problems."

Igal Sapir
Lucee Core Developer
Lucee.org

p...@westhold.com

unread,
Jun 20, 2015, 7:46:51 PM6/20/15
to lu...@googlegroups.com

So I add this line right under “<Context useHttpOnly="true">

allowLinking="true"
 
??

Also FYI: From https://tomcat.apache.org/tomcat-5.5-doc/config/context.html:

 

NOTE: This flag MUST NOT be set to true on the Windows platform (or any other OS which does not have a case sensitive filesystem), as it will disable case sensitivity checks, allowing JSP source code disclosure, among other security problems.”

Jon Clausen

unread,
Jun 20, 2015, 8:00:53 PM6/20/15
to lu...@googlegroups.com
Oh, crud. You're right Igal.  Disregard, Pat, since you're on Windows.   I know there's an alternate setting for this as a workaround for Windows, but I'm away from a computer at the moment.  Let me check in a bit and get back to you, Pat.


[Note: Typo assistance courtesy of iPhone]

Igal @ Lucee.org

unread,
Jun 20, 2015, 8:08:17 PM6/20/15
to lu...@googlegroups.com
@Pat --

I'm pretty sure that it will work if you put your physical path outside the root path of the context.  the nesting of these "sites" seem to mess it up.


Igal Sapir
Lucee Core Developer
Lucee.org

p...@westhold.com

unread,
Jun 20, 2015, 8:08:37 PM6/20/15
to lu...@googlegroups.com

Thank you.

Re-iterating

 

Folder is “c:\inetpub\wwwroot\websites\my_site”

IIs7 Alias is “my_site”

 

localhost/my_site/index.htm WORKS

localhost/my_site/index.cfm FAILS

 

Any htm, txt, etc in my_site works,

any cfm fails

 

There has to be a setting somewhere that I am missing.

Igal @ Lucee.org

unread,
Jun 20, 2015, 8:15:56 PM6/20/15
to lu...@googlegroups.com
what happens when you go to localhost/websites/my_site/index.cfm ?  does it work then or do you get the same issue?


Igal Sapir
Lucee Core Developer
Lucee.org

p...@westhold.com

unread,
Jun 20, 2015, 8:33:16 PM6/20/15
to lu...@googlegroups.com

If I put in c:\inetpub\my_site  - DOESN’T WORK

If I put in c:\railo\tomcat\webapps\ROOT\websites\my_site – DOESN’T WORK

 

If I put in c:\inetpub\wwwroot\my_site  it DOES work

 

But I already knew that c:\inetpub\wwwroot\my_site  would work – I just didn’t understand why c:\inetpub\wwwroot\websites\my_site would not work

p...@westhold.com

unread,
Jun 20, 2015, 8:35:04 PM6/20/15
to lu...@googlegroups.com

> localhost/websites/my_site/index.cfm

 

Exact same issue

 

But if I go to localhost/websites/my_site/index.htm  it works

It’s just the cfm files that don’t seem to get mapped correctly

p...@westhold.com

unread,
Jun 20, 2015, 8:51:46 PM6/20/15
to lu...@googlegroups.com

I take that back…

 

localhost/websites/my_site/index.htm

localhost/websites/my_site/index.cfm

 

both generate 500.23 internal server errors

p...@westhold.com

unread,
Jun 20, 2015, 9:03:52 PM6/20/15
to lu...@googlegroups.com

I take that back…

 

localhost/websites/my_site/index.htm

localhost/websites/my_site/index.cfm

 

both generate 500.23 internal server errors

 

email resent to clean up the posts

 

ADK

unread,
Jun 20, 2015, 10:50:05 PM6/20/15
to lu...@googlegroups.com
Your application server is not going to recognize/pick-up IIS virtual directories. Your HTTP requests are going to IIS and then sending off all cfm/cfc to Lucee/Tomcat to interpret. So, your Virtual Directories are respected by all non-cf requests, but the cf requests will look for those files in whatever folder you told Tomcat to look for them.

I don't ever use IIS, so I don't know how things get wired up, but I would try adding an entry to your hosts file, e.g.:

127.0.0.1 dev.my_site.com

and then add a separate entry to the Tomcat server.xml like so:

<Host name="dev.my_site.com" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
   
<Context path="" docBase="c:/inetpub/wwwroot/websites/my_site" />
</Host>

Setup the same hostname in IIS and then restart Tomcat and you should be good to go when you hit dev.my_site.com

p...@westhold.com

unread,
Jun 21, 2015, 6:33:23 AM6/21/15
to lu...@googlegroups.com

Unfortunately, I cannot use that method.  I have dozens of sites but none are using domain names.  All are referenced by the ip address. 

Ie. 50.249.93.76/site1

Ie. 50.249.93.76/site2

Ie. 50.249.93.76/site3

etc

 

I can make it work if I move each of the sites from the websites dir to c:\inetpub\wwwroot for example:

c:\inetpub\wwwroot\site1

c:\inetpub\wwwroot\site2

c:\inetpub\wwwroot\site3

 

Then, IIS works as it should and, so does Railo/Lucee

I just didn’t want to have to move everything because they all share common files.

 

Thanks to everyone for their advice and help.

 

 

 

 

 

From: lu...@googlegroups.com [mailto:lu...@googlegroups.com] On Behalf Of ADK
Sent: Saturday, June 20, 2015 9:50 PM
To: lu...@googlegroups.com
Subject: Re: [Lucee] Virtual Dir in Railo/Lucee and IIS7

 

Your application server is not going to recognize/pick-up IIS virtual directories. Your HTTP requests are going to IIS and then sending off all cfm/cfc to Lucee/Tomcat to interpret. So, your Virtual Directories are respected by all non-cf requests, but the cf requests will look for those files in whatever folder you told Tomcat to look for them.



I don't ever use IIS, so I don't know how things get wired up, but I would try adding an entry to your hosts file, e.g.:

Bilal

unread,
Jun 21, 2015, 4:32:17 PM6/21/15
to lu...@googlegroups.com
The easiest way to represent virtual directories is to do railo / lucee application mapping.
Please google this group or the previous railo one.
There should be quite a few examples.

p...@westhold.com

unread,
Jun 21, 2015, 7:26:34 PM6/21/15
to lu...@googlegroups.com
I didn't find any references to what I am trying to do. I am googled out...

I went ahead and moved all of the sub directories into the c:\inetpub\wwroot directory and everything worked.

Bilal

unread,
Jun 23, 2015, 8:55:58 AM6/23/15
to lu...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages