1

I have a dev machine running Lucee with Tomcat on Mac OS X El Capitan. Lucee is running fine, but when I bring up my dev site, mapped to admin.local, I have to type in "admin.local:8080/index.cfm". For some reason entering the URL as "admin.local:8080" just brings up a 404. Is there something I need to do to get Lucee/Tomcat to serve index.cfm by default?

UPDATE: The web.xml for Tomcat does include the following:

<servlet-mapping>
  <servlet-name>CFMLServlet</servlet-name>
  <url-pattern>*.cfc</url-pattern>
  <url-pattern>*.cfm</url-pattern>
  <url-pattern>*.cfml</url-pattern>
  <url-pattern>/index.cfc/*</url-pattern>
  <url-pattern>/index.cfm/*</url-pattern>
  <url-pattern>/index.cfml/*</url-pattern>

  <!-- url-pattern>*.cfm/*</url-pattern !-->
  <!-- url-pattern>*.cfml/*</url-pattern !-->
  <!-- url-pattern>*.cfc/*</url-pattern !-->
  <!-- url-pattern>*.htm</url-pattern !-->
  <!-- url-pattern>*.jsp</url-pattern !-->
</servlet-mapping>
Carl
  • 1,246
  • 3
  • 21
  • 39
  • Under your web server did you add index.cfm to the default document types? – Miguel-F Jun 22 '17 at 15:01
  • Please see the update above – Carl Jun 22 '17 at 15:53
  • That is the configuration for Tomcat, which is good, but you also need to define the default document for your web server - Apache. Assuming you are requesting the page from your web server and not directly from Tomcat. – Miguel-F Jun 22 '17 at 15:56
  • Yes, that was it. If you put it in the form of an answer, I will mark it as correct – Carl Jun 22 '17 at 17:08

2 Answers2

2

In order for your web server to handle the index.cfm files without specifying it in the URL you will need to add that as a default document for your web server. You mentioned you are using Apache, one approach for that web server is to add index.cfm to the DirectoryIndex within the httpd.conf file.

Here is an example of how to do that - https://stackoverflow.com/a/7977774/1636917

Miguel-F
  • 13,450
  • 6
  • 38
  • 63
1

I just added index.cfm to welcome file list in web.xml, it helps

   <web-app ...
     
       <welcome-file-list>
            <welcome-file>index.html</welcome-file>
            <welcome-file>index.htm</welcome-file>
            <welcome-file>index.jsp</welcome-file>
            <welcome-file>index.cfm</welcome-file>
        </welcome-file-list>
    
    </web-app>
msyu
  • 11
  • 1