Carl
Carl

Reputation: 1276

Lucee Not Serving index.cfm By Default

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>

Upvotes: 1

Views: 1460

Answers (2)

msyu
msyu

Reputation: 11

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>

Upvotes: 1

Miguel-F
Miguel-F

Reputation: 13548

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

Upvotes: 2

Related Questions