ExpandPath with mod_cfml and mappings

81 views
Skip to first unread message

Zac Spitzer

unread,
Jan 13, 2016, 2:48:15 AM1/13/16
to Lucee
I have an moduleglue app I'm trying to port over to Lucee from CF8 and I'm having
some problems with ExpandPath and the current 4.5.2 build.

I have an Apache 2.4 virtual server setup which points to the wwwroot directory,
as I don't want to expose any files which don't need to be web accessible

It all works fine if I set the apache documentRoot to the app root directory (c:\inetpub\appdir)
and then access the http://localhost/wwwroot/index.cfm directory, which is obviously sub optimal

but when I set the document root to c:\inetpub\appdir\wwwroot, it falls over because
the expandPath for the moduleglue file then resolves to

C:\inetpub\appdir\wwwroot\appdir\config\ModelGlue.xml
instead of
C:\inetpub\appdir\config\ModelGlue.xml

any ideas?

Mark Drew

unread,
Jan 13, 2016, 2:53:04 AM1/13/16
to lu...@googlegroups.com
Set up a mapping. Lucee (unlike Cf) probably has no idea what your Apache paths are. 



Mark Drew
- Sent by typing with my thumbs. 
--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
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/96fd2935-a9af-4e4d-bc0d-3f47edf4aa98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nando Breiter

unread,
Jan 13, 2016, 4:53:46 AM1/13/16
to lu...@googlegroups.com
Zac,

I have an old MG app, getting the paths set up correctly is always a pain when shifting it to a new server. I really dislike the spaghetti nature of the configuration settings. Trips me up every time.

In index.cfm, I set both ModelGlue_LOCAL_COLDSPRING_PATH to point to the location of ColdSpring.xml, and ModelGlue_CORE_COLDSPRING_PATH to point to the location of ModelGlue/unity/config/Configuration.xml (within which the relative path to ModelGlue.xml is configured). 

Hard coded paths work just fine for those MG _PATH variables. No need to depend on ExpandPath(). That said, this code fragment is one I've used to back down out of the webroot from index.cfm and into the application directory:

<cfset ModelGlue_LOCAL_COLDSPRING_PATH = expandPath( '../' ) & 'appdir/config/ColdSpring.xml' />

... and this works for me in my Lucee dev environment. I just tested it to make sure.





Aria Media Sagl
Via Rompada 40
6987 Caslano
Switzerland

+41 (0)91 600 9601
+41 (0)76 303 4477 cell
skype: ariamedia

Zac Spitzer

unread,
Jan 13, 2016, 5:40:02 AM1/13/16
to Lucee
@nando looking into the MG framework code, hard coded paths look like an option

@mark I do have mappings in place, but that didn't help

it's still quite a frustrating clusterf*ck with lucee compared to ACF which just works,
I'm aware that ACF uses some custom AJP extensions to make this seamless,
has there been any motion to update AJP to standardise them?

Nando Breiter

unread,
Jan 13, 2016, 5:56:21 AM1/13/16
to lu...@googlegroups.com
ACF didn't, and still does not, "just work for me" in terms of MG's relatively complex configuration / path setup. There are 3 or 4 points in the app with make or break path settings, they are all interdependent, and tucked away in hard to find locations. I can't see how anything would make that "just work" in all environments.


Aria Media Sagl
Via Rompada 40
6987 Caslano
Switzerland

+41 (0)91 600 9601
+41 (0)76 303 4477 cell
skype: ariamedia

Zac Spitzer

unread,
Jan 13, 2016, 10:16:33 PM1/13/16
to Lucee
yeah, that's true, but I the problem here is that the mapping isn't being picked up by expandpath

Paul Klinkenberg

unread,
Jan 15, 2016, 7:40:02 AM1/15/16
to lu...@googlegroups.com
Hi Zac,

Re. the differences between the ACF connector and mod_cfml:
The mod_cfml team has been working to automatically add front-end webserver mappings (Apache aliases / IIS virtual directories) to Lucee, by providing these mappings and their repective paths in a custom http header, x-vdirs.
The upcoming mod_cfml 1.1.08 can also add these mappings to a Tomcat 7+ web context. Unfortunately, Lucee does not check these mappings yet :-( 
See enhancement request https://luceeserver.atlassian.net/browse/LDEV-694 for this issue, which I created yesterday.

Kind regards,

Paul Klinkenberg



Zac Spitzer

unread,
Jan 15, 2016, 6:11:03 PM1/15/16
to lu...@googlegroups.com
thanks Paul, that sounds great, thanks for all your work on this


For more options, visit https://groups.google.com/d/optout.



--
Zac Spitzer
+61 405 847 168

Reply all
Reply to author
Forward
0 new messages