Skip to main content
Participating Frequently
Mar 16, 2023 4:37 AM UTC
Question

Why static file in wwwroot can not be access in url?

I installed successful ColdFusion 2021 developer in Ubuntu 20, I can access admin panel with http://127.0.0.1:8500/CFIDE/administrator/index.cfm but when I try create a file in wwwroot is index.cfm and then I hit http://127.0.0.1:8500/index.cfm, it says

File not found: /index.cfm

How do I fix it? And may I create routing or do something like this.

    This topic is closed to new replies. Start a new post to keep the conversation going.

    15 replies

    Participating Frequently
    Mar 17, 2023 8:33 AM UTC

    Sorry to all, I forgot to say I'm using Apache2 to connect with so as @Dave Watts said I change virtual host with:

    And I can access in url

    <Directory "/home/may/Downloads/ColdFusion_2021_WWEJ_linux64/ColdFusion2021/ColdFusion/cfusion/wwwroot/touch">
    	Order allow,deny
    	Allow from all
    	Require all granted
        </Directory>
    Translate
    BKBK
    Community Expert
    Community Expert
    Mar 17, 2023 8:23 AM UTC

    By the way, your title says index.cfm is a static file. It is not. Were you perhaps confusing it with http://127.0.0.1:8500/index.html?

    Translate
    Participating Frequently
    Mar 17, 2023 8:34 AM UTC

    it's ok with index.html

    Translate
    BKBK
    Community Expert
    Community Expert
    Mar 17, 2023 8:55 AM UTC
    quote

    it's ok with index.html


    By @Nam28890948vceg

    Your answer is crytic. I don't understand what you mean by "ok with index.html".

     

    Is your question about http://127.0.0.1:8500/index.cfm or is about http://127.0.0.1:8500/index.html?

     

    An unanswered question, once again:

    "Have you done the test I suggested? If so, what were the results?"

     

    Translate
    Community Expert
    Mar 16, 2023 2:24 PM UTC

    This is just a guess, but it seems possible that the permissions on your index.cfm might not allow it to be read by Tomcat (and therefore CF). Look at what you have in /CFIDE/administrator/ and see what user and group permissions are on the file, then apply those same permissions via sudo to the index.cfm file. Use chmod and chown to do this. If that's the problem, you can make everything in the directory conform to those permissions by using that account to write files to the directory, or by running chmod and chown after you make any changes.

     

    Dave Watts, Eidolon LLC

    Translate
    Dave Watts, Eidolon LLC
    Participating Frequently
    Mar 16, 2023 2:33 PM UTC
    I dont think so because the error say file not found not file permission
    403.
    Translate
    Community Expert
    Mar 16, 2023 2:50 PM UTC

    Maybe, maybe not. I'd still look at the permissions. It's easy to do.

     

    Dave Watts, Eidolon LLC

    Translate
    Dave Watts, Eidolon LLC
    BKBK
    Community Expert
    Community Expert
    Mar 16, 2023 9:35 AM UTC

    Do the following test:

    1.  Verify that the file index.cfm has been saved in the same (wwwroot) directory as CFIDE. Within the same wwwroot directory, save the following code as the file testpage.cfm
      The current directory is: <cfoutput>#getDirectoryFromPath(getCurrentTemplatePath())#</cfoutput>
    2.  Launch the following in a browser:
      http://127.0.0.1:8500/index.cfm
      http://127.0.0.1:8500/testpage.cfm
    Translate