@Steve, I would second Charlie's comment regarding troubleshooting
your particular environment -- the more information you can supply
regarding your specific setup and what you attempted to do, the more
likely that someone can help you to get it working.
That said, if you want an example of how you can set up an MG site
with as little as possible in the webroot, give this a shot:
1. Create a new MG site from the application template, placing it
within the default webroot of your web server so you can browse to it
at http://{server name}/{site name}/ -- for example, I named my test
site "MG3Test", and can hit it at
http://localhost/MG3Test/
2. Create a "webroot" directory directly under the site directory.
3. Move the "css" directory and the following files into the "webroot"
directory:
Application.cfc
index.cfm
RemotingService.cfc
4. Delete the remaining "loose" files at the root level of the site.
At this point, your top-level directory structure should look like
this:
config
controller
helpers
model
views
webroot
5. In webroot/index.cfm, uncomment the following line (line 17 in my
copy of the app template):
<cfset ModelGlue_LOCAL_COLDSPRING_PATH = expandPath(".") &
"/config/ColdSpring.xml" />
and change it to:
<cfset ModelGlue_LOCAL_COLDSPRING_PATH = expandPath("..") &
"/config/ColdSpring.xml" />
(The argument to the expandPath function changes from "." to "..")
6. In config/ColdSpring.xml, make the following two alterations:
Change this (line 24):
<property name="configurationPath"><value>config/ModelGlue.xml</value></property>
to this:
<property name="configurationPath"><value>../config/ModelGlue.xml</value></property>
and this (line 41):
<property name="scaffoldPath"><value>config/scaffolds/Scaffolds.xml</value></property>
to this:
<property name="scaffoldPath"><value>../config/scaffolds/Scaffolds.xml</value></property>
7. If you're going to be using remoting, change the following line in
webroot/RemotingService.cfc (line 6) from this:
<cfset template = "/{site name}/index.cfm" />
to this:
<cfset template = "/{site name}/webroot/index.cfm" />
(For my site, this would be: <cfset template = "/MG3Test/webroot/index.cfm" />)
At this point, you should be able to browse the site at http://{server
name}/{site name}/webroot/ -- for example, my URL is now
http://localhost/MG3Test/webroot/ -- and the config files,
controllers, views, etc. are all above the webroot directory.
You can then define a virtual host/site on your web server that points
to the {site name}/webroot directory. In order to avoid the need to
make any further changes to the CS config and file paths, you will
need a mapping for the site's root directory.
If you're on CF 8+ you can set up an application-specific mapping by
adding a line like this to the pseudo-constructor area of your
Application.cfc (in other words, outside of any functions):
<cfset this.mappings["/MG3Test"] = expandPath("..") />
And as a final note, when deploying something like this in production
make sure that you *do not* place the site under your web server's
default webroot (if enabled), or the config files will still be web
accessible at a URL like: http://{server IP}/{site
name}/config/ColdSpring.xml
Please let me know if you have any further questions about this technique.
--
Ezra Parker