Serving straight HTML pages

This may seem stupid, but I am having trouble serving straight HTML (non CFM) docs on my server.
I am set up pretty classic: Ubuntu / Apache / Tomcat / Lucee / MySQL

However I setup directoryindex, it will error out on anything but a .cfm page. any idea?

Is this an Apache, Tomcat or Lucee error?

You should probably set Apache to not send html pages to Tomcat/Lucee for processing, but let Apache serve them as they are.

I think is a Lucee error getting thrown. How would I stop apache from forwarding certain file types to tomcat?

It depends how you connect apache and lucee. If you use mod_jk, you have something like

    JkMount /*.cfm ajp13_worker
    JkMount /*.cfc ajp13_worker
    JkMount /flex2gateway/* ajp13_worker

If you use mod_proxy, you have something like

     ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://localhost:8009/$1$2

Only files matching the extension or the regex are forwared to lucee, the other files are processed directly by the webserver.

Thanks so much. I think I am getting close, but missing something important. I am using mod_cfml / mod_proxy.

I edited
/etc/apache2/mods_available/proxy.conf
Everything in the file between and was commented out.

In between the two, I added the line as you suggested:

ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://localhost:8009/$1$2

then saved and rebooted.

The result was a 500 error when I tried to serve a cfm page:

Log Output:
173.171.135.108 - - [02/Jun/2017:05:50:18 -0400] "GET /index.cfm HTTP/1.1" 500 814 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"

Anything obvious I am missing?

Again - an Apache or Tomcat error page?

One way to troubleshoot would be to disable mod_proxy all together and test that you can serve static content ok using apache. Possibly the Documentroot is not correct.

Been a long time since I have run into this, but here I am again:

The error is a Lucee error.

Lucee 5.2.4.37 Error (missinginclude)
Message	Page /index.cfm [/var/www/html/index.cfm] not found

This is in the root of the server. What I want to achieve is if there is no CFM in there, but .htm or .html, then it serve the static pages.

Any help?

How about in your Application.cfc file, you include an onMissingTemplate function?

<cffunction name="onMissingTemplate">
<cfif fileexists("index.htm")>
  <cflocation url="index.htm">
<cfelse>
  Page not found
</cfif>
</cffunction>
1 Like

Its more than likely a permissions issue, not a lucee issue

What is your host running, I would guess from your above posts some Ubuntu or Debian spin?

Lucee and apache need to either be running as the same user, or have the same permissions to access the data in what ever directory you are trying to run your .html and cf files

You could run something like
sudo chmod u=rwX,g=srX,o=rX -R /var/www

Enable mod proxy for Apache
sudo a2enmod proxy.

Next in your site configuration file, you need to add something like the following

<Proxy >
Allow from 127.0.0.1

ProxyPreserveHost On
ProxyPassMatch ^/(.+.cf[cm])(/.
)?$ ajp://localhost:8009/$1$2

LoadModule modcfml_module modules/mod_cfml.so
CFMLHandlers “.cfm .cfc .cfml”
ModCFML_SharedKey “MYSHAREDKEY”

Restart Apache and now you can serve static content.