Professional Web Applications Themes

CFCs outside the web root - Coldfusion - Advanced Techniques

Is there really no way to access a CFC outside the web root without a mapping in the administrator? Here's my directory structure: /app /app/component.cfc /public /public/index.cfm So if /public is my web root, I really can't get to /app/component.cfc without a mapping? This seems to be *extremely* limiting ... what if every site on my server has this same directory structure? That would mean I can only have a single /app mapping! This is a problem. How do hosting companies deal with this issue? If they have multiple sites on a single box and more than one site requires ...

  1. #1

    Default CFCs outside the web root

    Is there really no way to access a CFC outside the web root without a mapping
    in the administrator? Here's my directory structure:

    /app
    /app/component.cfc
    /public
    /public/index.cfm

    So if /public is my web root, I really can't get to /app/component.cfc without
    a mapping? This seems to be *extremely* limiting ... what if every site on my
    server has this same directory structure? That would mean I can only have a
    single /app mapping! This is a problem.

    How do hosting companies deal with this issue? If they have multiple sites on
    a single box and more than one site requires the same mapping, is it first-come
    first-served? Or is there some kind of sandbox that lets each site have it's
    own unique mappings?

    Cannikinn Guest

  2. #2

    Default Re: CFCs outside the web root

    So you want to access the CFC of the other websites on the machine just by punching in ../../theothersite/gotcha.cfc

    THAT would be a security issue.

    Use mapping or stay in your root.
    ScottyMTL Guest

  3. #3

    Default Re: CFCs outside the web root

    Well, found that if I create an /app alias in Apache then I can kinda cheat ...
    just don't allow access to that Alias from anyone other than 127.0.0.1:

    Alias /app "c:/inetpub/wwwroot/myapp/app"
    <Directory "c:/inetpub/wwwroot/myapp/app">
    Order allow,deny
    Allow from 127.0.0.1
    Deny from all
    </Directory>

    Cannikinn Guest

  4. #4

    Default Re: CFCs outside the web root

    No no, I don't want them to be publically accessible, just be able to get to
    them without creating a CF mapping. Let's say I have a dozen sites on my
    server, all of them have a /app directory that's outside of the web root. I
    can only create a single /app mapping in CF so all of the other sites are
    ed. I want to be able to create mappings on a per-site basis. (I may
    have found a solution, see the post above.)

    Cannikinn Guest

  5. #5

    Default Re: CFCs outside the web root

    You can have as many mappings as you want...

    You can have :
    myDevMapping = /www/dev/ (assuming "www" is your base directory for your
    sites)
    myLiveMapping = /www/live

    But, you can also :
    myCFCMapping = /www

    ...then :
    cfinvoke
    component="myCFCMapping.#request.environment#.repo rtbuilder"
    ...assuming request.environment is setup in Application.cfm. That way you can
    seamlessly call the good CFC no matter your environment.

    ScottyMTL Guest

Similar Threads

  1. ExpandPath evaluates to ColdFusion root instead ofvirtual web server root
    By _Tian_ in forum Coldfusion Server Administration
    Replies: 0
    Last Post: April 7th, 11:54 PM
  2. CFCs and MX7
    By ldonner in forum Coldfusion - Getting Started
    Replies: 0
    Last Post: June 22nd, 04:27 PM
  3. Web content root ?= CF application root?
    By cjeris in forum Coldfusion Server Administration
    Replies: 0
    Last Post: May 9th, 07:46 PM
  4. Doent root not website root
    By jpb in forum PHP Development
    Replies: 2
    Last Post: October 27th, 05:26 PM
  5. Replies: 7
    Last Post: September 6th, 11:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139