Skip to main content
Participating Frequently
March 16, 2023
Question

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

  • March 16, 2023
  • 4 replies
  • 1026 views

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 has been closed for replies.

    4 replies

    Participating Frequently
    March 17, 2023

    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>
    BKBK
    Community Expert
    Community Expert
    March 17, 2023

    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?

    Participating Frequently
    March 17, 2023

    it's ok with index.html

    BKBK
    Community Expert
    Community Expert
    March 17, 2023
    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?"

     

    Community Expert
    March 16, 2023

    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

    Dave Watts, Eidolon LLC
    Participating Frequently
    March 16, 2023
    I dont think so because the error say file not found not file permission
    403.
    Community Expert
    March 16, 2023

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

     

    Dave Watts, Eidolon LLC

    Dave Watts, Eidolon LLC
    BKBK
    Community Expert
    Community Expert
    March 16, 2023

    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