Sep 19 2009

Custom ColdFusion Virtual Mappings

Posted by Steve Onnis at 12:53 PM
1 comments
- Categories: Coldfusion | Coldfusion Server

I recently has a requirement to create a shared resource across all of my coldfusion hosting customers for an undelivered cfmail spool processing application.  What i didnt want to have to do is create a webserver based virtual directory for each customer because that meant when new customers came on board i would then have to create the virtual directory for them also.

Pre Colsfusion MX, Coldfusion Mappings used to be able to be accessed via the URL but now that is not possible so another means of doing this sort of thing is needed.  Then i got to thinking...there must be a way to do it because thats how the CFCHART url is done as well as the flex/flash gateways as well as the WEB-INF path.

After hunting around in the xml server config files i came across a configuration file located at "[cf-root]\wwwroot\WEB-INF\jrun-web.xml".  This file holds virtual mapping configurations for the Coldfusion server.

To add your own virtal mapping all you need to do is add your own <virtal-mapping> entry.

  <virtual-mapping>
    <resource-path>/{name-of-path}</resource-path>
    <system-path>{absolute-path-to-directory}</system-path>
  </virtual-mapping>

 With the system-path entry, you need to use "/" in the path rather than "\", so if your path is "C:\inetpub\wwwroot\my-folder" you would enter "c:/intput/wwwroot/my-folder".

Comments

rapid4me

rapid4me wrote on 01/27/10 12:55 AM

I am really glad to have come across your site. Yous posts give food for though and make us think about really important things.

Write your comment



(it will not be displayed)



Leave this field empty: