我有一个关于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:Usersmyusername.CommandBoxserverD9F80673BC7799BE959B513656FE8F55-CommandBoxlucee-5.3.6.61WEB-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>
正如你在上面的代码注释中看到的,这应该是默认的登陆页面。如果有人知道这个问题的原因和解决方法,请告诉我。谢谢。
我找到的解决上述问题的方法如下:
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)
必须有index.html
或index.cfm
文件在根文件夹,确保你没有错过。