serving pages from a UNC path

232 views
Skip to first unread message

Jay

unread,
Mar 20, 2011, 6:53:44 PM3/20/11
to ra...@googlegroups.com
I have a Railo 3.3.008 (it's a development box) on Tomcat 7 website that serves documents hosted on a file server in the local network: e.g. \\192.168.0.200\www\mysite

when I browse to URLs of static files (e.g. images), Tomcat serves the file properly so the UNC path seem to work fine.

when I try to visit a CF page, I get an error message of a missingInclude:  Page /index.cfm [C:\index.cfm] not found

the weird part is that the error message shows the physical path as C:\index.cfm (instead of \\192.168.0.200\www\mysite\index.cfm for example)

am I doing something wrong or is that a bug?  it works properly with ACF.


Jay

Michael Forell

unread,
Mar 21, 2011, 3:19:18 AM3/21/11
to Railo
Hi Jay,

I had a similar configuration a while ago, and it works in general.
I created a mapping in Railo to serve those files. And, as the Railo
Admin could not handle the backshlashes, I created the mapping in the
railo-web.xml.cfm manually like this:
<mapping archive="" physical=" \\192.168.0.200\www\mysite"
primary="physical" readonly="no" toplevel="yes" trusted="no" virtual="/
mysite/"/>

Hope that helps.

Regards
Michael

On 20 Mrz., 23:53, Jay <d...@21solutions.net> wrote:
> I have a Railo 3.3.008 (it's a development box) on Tomcat 7 website that
> serves documents hosted on a file server in the local network: e.g.
> \\192.168.0.200\www\mysite
>
> when I browse to URLs of static files (e.g. images), Tomcat serves the file
> properly so the UNC path seem to work fine.
>
> when I try to visit a CF page, I get an error message of a missingInclude:  Page
> /index.cfm [*C:\index.cfm*] not found

Jay

unread,
Mar 21, 2011, 1:31:13 PM3/21/11
to ra...@googlegroups.com
well, my whole site sits on the file (192.168...) server, so I'm not sure what to map - or why.

I can see how mapping can resolve this issue if you only use code libraries or virtual folders from a remove server, but here I expected it to work without any configurations to Railo as Tomcat see it properly.

any ideas?


Jay

Sean Corfield

unread,
Mar 21, 2011, 1:48:04 PM3/21/11
to ra...@googlegroups.com
Map / to your document root on the file server?

Robert Zehnder

unread,
Mar 21, 2011, 1:55:30 PM3/21/11
to ra...@googlegroups.com
Have you tried unix-like whacks (i.e., //server/share/)?

It has been a while since I have played with any Windows environment for my servers, just a thought.

Jay

unread,
Mar 21, 2011, 2:00:19 PM3/21/11
to ra...@googlegroups.com
just tried it -- it didn't work.

I would expect it to work without any special mapping.

in the Railo admin the Web Context is displayed properly with the correct UNC path.


Jay

unread,
Mar 21, 2011, 2:04:06 PM3/21/11
to ra...@googlegroups.com
I tried that in the mapping;  it didn't make any difference.  my other paths in mappings etc use the Windows separator \ and they work fine.

Jay

unread,
Mar 21, 2011, 2:14:32 PM3/21/11
to ra...@googlegroups.com
I tried changing it in Tomcat's conf server.xml as well.  no success.

I tried both the IP address (e.g. 192.168.0.200) and the server's name, both with forward-slashes, and back-slashes.  nothing seems to work :s


Peter Boughton

unread,
Mar 21, 2011, 2:20:09 PM3/21/11
to ra...@googlegroups.com
Have you considered using SUBST to create a fake local drive and using
that instead?

i.e. "SUBST S \\192.168.0.200\path\to\webroot"

Then inside Tomcat you just set "S:\" as the webroot, and all the
paths will start with that, but will be using the other server.


(The SUBST command needs to be re-run if Windows is rebooted - but you
can of course set it to run automatically on startup.)

Robert Zehnder

unread,
Mar 21, 2011, 2:23:48 PM3/21/11
to ra...@googlegroups.com
Well, I know this isn't much of a help, but looking through the groups I found this:


It recommends Sean's suggestion of creating a mapping to the file server.

Jay

unread,
Mar 21, 2011, 2:32:04 PM3/21/11
to ra...@googlegroups.com
hmm.  that actually moves us a step forward, but now I get another error:  there is no application context defined for this application

I really prefer to use the UNC path though

mapping a drive letter also means permission settings for the user account that runs tomcat etc.


Jay

unread,
Mar 21, 2011, 2:36:16 PM3/21/11
to ra...@googlegroups.com
I tried mapping -- it didn't work.

denstar

unread,
Mar 21, 2011, 2:41:44 PM3/21/11
to ra...@googlegroups.com

Doesn't using a UNC generally require that the correct user have the
correct permissions as well?

:Den

--
The degree of one's emotions varies inversely with one's knowledge of the facts.
Bertrand Russell

Jay

unread,
Mar 21, 2011, 2:47:21 PM3/21/11
to ra...@googlegroups.com
it does.  but when you map a drive you have to re-map it every time you reboot the machine and then set the permissions.

with UNC - I set the permissions once.

maybe there's an easy fix for the permissions of the mapped drive with a script but I don't know how to do it.

I've been using UNC paths with ACF for a few years now and it's been working well for me.  I'm sure that there's a way to do it with Railo.

Lyle Karstensen

unread,
Mar 21, 2011, 2:56:12 PM3/21/11
to ra...@googlegroups.com

You have to make sure that the tomcat service has permissions to the unc path. I use UNC paths with Railo/Jetty/Windows and just give the jetty service the correct login and it works perfect.

 


 

Lyle Karstensen Jr.
Chief Executive Officer  (CEO)

Description: Logo

Phone: 702.940.4200
Fax:
702.940.4201
Direct: 702.932.8200
Cell: 702.683.3666
Email: ly...@realistiq.com
Website: http://www.realistiq.com

denstar

unread,
Mar 21, 2011, 3:18:57 PM3/21/11
to ra...@googlegroups.com
On Mon, Mar 21, 2011 at 12:47 PM, Jay wrote:
> it does.  but when you map a drive you have to re-map it every time you
> reboot the machine and then set the permissions.

I'm pretty sure if you click the "run as", enter the creds, and then
check "restore on boot" (or whatever the option is called), it does
the mapping with the creds when the box boots.

There is a little bit of jiggery-pokery if you're doing the "run as
admin" + doing a mapped drive-- that's usually when you need a script
of some sort, IIRC.


There should be an authentication event log (I think it's there-- been
a while, might be in application, etc.) that logs the attempt. Is
there something showing up in there?

It could be something else, but I'm leaning towards a permissions
error at the moment.

:Den

--
The fact that an opinion has been widely held is no evidence whatever
that it is not utterly absurd.
Bertrand Russell

Jay

unread,
Mar 21, 2011, 3:46:55 PM3/21/11
to ra...@googlegroups.com, Lyle Karstensen
the UNC path works fine in Tomcat.  I am able to serve static files like images etc.

I can not serve CF templates.


Jay

unread,
Mar 21, 2011, 3:48:40 PM3/21/11
to ra...@googlegroups.com, denstar
from my experience in the past with mapped drives = this fails every now and then.  maybe it's better nowadays but it used to be a nightmare and I can not allow it to happen on a production server.


denstar

unread,
Mar 21, 2011, 4:52:05 PM3/21/11
to ra...@googlegroups.com

Maybe try that suggestion (directly editing the railo-web.xml.cfm
config file -- note, setting "/" root mappings only work in the web
context, not the server context):

<mapping archive="" physical=" \\192.168.0.200\www\mysite"

primary="physical" readonly="no" toplevel="yes" trusted="no" virtual="/"/>

You can also try a smb path: smb://192.168.0.200/www/mysite

Using the web admin UI. Might try that first as it's pretty easy.

I'm thinking this is a bug, probably with VFS, but there should be a
work around until it's fixed.

:Den

--
The good life is one inspired by love and guided by knowledge.
Bertrand Russell

denstar

unread,
Mar 21, 2011, 4:57:06 PM3/21/11
to ra...@googlegroups.com

Hrm. I'm not a big fan of windows networking in general...

I'd recommend not using the network to serve files.

Maybe use a file synchronization tool instead?

That way you remove a dependency from your app, plus things should serve faster.

That's a long-term idea, I reckon. I'm thinking we can get you going
with one of the workarounds...

:Den

--
The infliction of cruelty with a good conscience is a delight to
moralists. That is why they invented Hell.
Bertrand Russell

Jay

unread,
Mar 21, 2011, 5:23:25 PM3/21/11
to ra...@googlegroups.com, denstar
I wasn't aware that mapping the root only works in web and not in context (which makes a lot of sense, btw).  I'll give it a try.

Jay

unread,
Mar 21, 2011, 5:27:08 PM3/21/11
to ra...@googlegroups.com, denstar
the mapping worked!

thanks for explaining that it must be in the Web admin :)

I also think it's a bug, but this is a good fix for now.

thanks again

Sean Corfield

unread,
Mar 21, 2011, 6:24:14 PM3/21/11
to ra...@googlegroups.com
Well, each web context has, by definition, a different webroot so the
mapping would be different in each context (hence it must be in the
Web Admin).


--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
Railo Technologies, Inc. -- http://www.getrailo.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

Jay

unread,
Mar 21, 2011, 6:30:14 PM3/21/11
to ra...@googlegroups.com, Michael Forell
thanks Michael, 

I guess I missed the part where you wrote "railo-web.xml.cfm" and when I tried it on "railo-server.xml.cfm" it didn't work.

Jay

unread,
Mar 21, 2011, 6:31:25 PM3/21/11
to ra...@googlegroups.com, Sean Corfield
it all makes perfect sense now.  thank you :)

denstar

unread,
Mar 21, 2011, 7:54:12 PM3/21/11
to ra...@googlegroups.com

Yeah, it tripped me up once, so I figured I'd be a bit explicit, just
in case. :)

Glad you're rocking along now!

:Den

--
The only thing that will redeem mankind is cooperation.
Bertrand Russell

Reply all
Reply to author
Forward
0 new messages