我有一个与CommandBox设置相关的问题。我使用的是最新版本的ColdFusion,我的文件夹结构如下所示:
D:/CommandBox/wwwroot
我在wwwroot文件夹中创建了index.cfm文件。该文件只包含一行代码:
<cfoutput>#now()#</cfoutput>
一旦我在我的浏览器中运行它,这就是我使用的url:
http://127.0.0.1:8080/
结果输出是我在浏览器中看到的错误消息:
Forbidden
如果我使用这个url代码将产生正确的输出:
http://127.0.0.1:8080/index.cfm
我想知道为什么index.cfm必须包含在url中?有没有办法将index.cfm设置为默认登录页面?此外,我在根文件夹中找到了包含以下代码的C:\Users\myusername\.CommandBox\server\D9F80673BC7799BE959B513656FE8F55-CommandBox\lucee-5.3.6.61\WEB-INF文件web.xml:
<!-- default file to execute if directory is called with no file name, e.g. http://yourip.com/ !-->
<welcome-file-list>
<welcome-file>index.cfm</welcome-file>
<welcome-file>index.lucee</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>正如你看到的每条评论以上的代码,这应该是默认的登录页面。如果有人知道这个问题的原因和解决方案,请让我知道。谢谢。
发布于 2021-02-13 07:24:36
我为上面的问题找到的解决方案是下一步。
1. First step in this process is to create index.cfm file inside your
root folder (CommandBox/wwwroot)
2. Stop the CommandBox
3. Start CommandBox again
4. Entered this url in your browser: 127.0.0.1:8080 (you can replace 8080 with your port number)发布于 2021-11-23 12:04:01
根文件夹中必须有index.html或index.cfm文件,请确保没有丢失这两个文件。
https://stackoverflow.com/questions/66162575
复制相似问题