See "SOLVED - Apache/Tomcat/AJP and Subdirectories" please delete this thread

OK. I think I am going crazy. I know I’m a bit rusty, but this is nuts.

I have an instance of Lucee set up on a virtual site. This is the second virtual site - third if you count the initial tomcat instance.

So just to recap I have:

/opt/tomcat/lucee ( which is actually /opt/tomat/webapps/ROOT.war)
/web-Directory-For-All-Sites/siteA/web/ a cfm app with files and includes, etc
/web-Directory-For-All-Sites/siteB/web/ a cfm app with files and includes, etc AND an “admin” folder

The main/initiall Lucee install in /opt/tomcat works fine, no problem

Site A works perfectly. No problem

Site B works perfectly, can submit data through cfm app, etc - EXCEPT the “admin” directory which is where some admin files for the application are served. So I can use everything outside of ADMIN. And I have correct credentials, permissions etc. so it’s not a permission or auth issue.

So, when I try to access www.mysiteB.com/admin/index.cfm, the actual index.cfm file downloads and the logs show a 200 error. The actual CFM file downloads.

This same code, directory, etc, was working fine in Railo 3.x. In fact, nothing has changed, all I did was swap out the Railo 3.x WEB-INF for the new Lucee 5.x WEB-INF. Correct the WEB-INF permissions, (tomcat:tomcat). Like I said above, the cfm app is working, just not the admin (nor any other subdirectories with an index.cfm file).

I feel like I’ve encountered this before but I don’t recall. It’s driving me mad.

What have I missed?

AFAIK this should work out of the box. Are all folder permission set correctly? Is the admin folder a physical folder or a virtual folder? What happens if you create a second folder (example web-Directory-For-All-Sites/ siteB /web/testfolder/) and you copy all the files of the admin folder into the new folder, and call http://siteB:8888/testfolder/somefile.cfm ? Does it still download the files? What happens if you copy this folder somewhere else and you add it as a virtual folder in the mapping section of the lucee web administration of your siteB on
http://siteB-URL:8888/lucee/admin/web.cfm
?

Good questions - I’ll run through each and perform on server as I do to make sure I didn’t miss anything…

All folders/directories are real, not virtual, not symlinked.
Structure of /web is (this is an older app):

Application.cfm
/admin
/app-settings (has cfm files called from /web/index.cfm)
/app-track (has cfm files called from /web/index.cfm)
/images
index.cfm
/includes (has cfm files called from /web/index.cfm)
/lib
/pages (has cfm files called from /web/index.cfm)
/style
/tools (has cfm files called from /web/index.cfm)
/WEB-INF

All work fine EXCEPT admin

Admin is protected with Auth basic, but the credentials are correct and I have also tried it WITHOUT the Auth basic (turned it off/commented it out) and so removed that altogether and still get the same results.

Permissions/ownership on /web folder are:

www-data:www-data
755

Permissions/ownership on files (.cfm and other) inside /web folder are:

www-data:www-data
755

Permissions/ownership on /web/admin folder are:

www-data:www-data
755

Permissions/ownership on files (.cfm and other) inside /web/admin folder are:

www-data:www-data
755

Permissions/ownership on WEB-INF at root of /web are:

tomcat:tomcat
750

Permissions/ownership on files inside WEB-INF at root of /web are:

644

I can create a new directory called “test” copy all the “admin” files into it, try it in browser and still, the index.cfm file is downloaded and logs show a 200 error.

I have not tried adding a virtual mapping. I thought about it, but that seems crazy that I should have to virtual map actual directories that exist. Also, there are sub directories in the /web root such as “incldues” where common CF files are called from the /web/index.cfm template and those are working just fine.