2
votes

I have posted in the Lucee google group, but after four days, i'm just not getting the support I need. I have a feeling a Tomcat expert will be able to point me in the right direction fairly quickly, so I'm posting here.

OSX El Cap, Apache2, Tomcat 8, Lucee 5.

On http://localhost, i get the Apache "It Works!" page.

on http://localhost:8080, i get the default Lucee page, served from

/usr/local/Cellar/tomcat/8.5.3/libexec/apps/lucee

On http://localhost:8080/manager/html and http://localhost:8080/host-manager/html, I get the Tomcat admin pages.

I have a directory, /Volumes/Storage/{companyname}/sites/www-test-app/www that contains index.cfm and index.htm

I have www-test-app set up in my HOSTS file.

I have a host entry in httpd-vhosts.conf for www-test-app

I have an entry in tomcat's server.xml file:

<Host name="www-test-app" appBase="webapps" unpackWARs="true" autoDeploy="true">
  <Context path="" docBase="/Volumes/Storage/{companyname}/sites/_test-app/www/">
  <JarScanner scanClassPath="false"/>
  </Context>                      
</Host>

When i call up http://www-test-app/index.htm, I get my static test page.

When I call up http://www-test-app/index.cfm I get this error:

HTTP Status 404 -
type Status report
message
description The requested resource is not available.
Apache Tomcat/8.5.3

I have stopped and restarted apache and tomcat to make sure config files are read.

THE BIGGEST CLUE: I do not see WEB-INF being created under /Volumes/Storage/{companyname}/sites/www-test-app/www

My directory permissions are 777 for this directory and all subdirectories:

/Volumes/Storage/{companyname}/sites

I'm not sure if I need to make ownership changes though.

Apache2 was included with El Cap. Apache testconfig yields "syntax OK".

Tomcat was installed via Homebrew.

Lucee was installed via WAR file per this page: http://brianflove.com/2015/03/05/lucee-on-mac-os-x-yosemite-quick-start/

I am stuck from here... but oh so close, since the default Lucee page looks great, including any cfoutput/variables.

Here's is a sample from catalina.{date}.log:

13-Jul-2016 12:06:02.381 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.3
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Jun 9 2016 11:16:29 UTC
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.3.0
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Mac OS X
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            10.11.5
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          x86_64
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_65-b17
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/Cellar/tomcat/8.5.3/libexec
13-Jul-2016 12:06:02.383 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/Cellar/tomcat/8.5.3/libexec
13-Jul-2016 12:06:02.384 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/Cellar/tomcat/8.5.3/libexec/conf/logging.properties
13-Jul-2016 12:06:02.384 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
13-Jul-2016 12:06:02.384 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
13-Jul-2016 12:06:02.384 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/Cellar/tomcat/8.5.3/libexec
13-Jul-2016 12:06:02.385 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/Cellar/tomcat/8.5.3/libexec
13-Jul-2016 12:06:02.385 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/Cellar/tomcat/8.5.3/libexec/temp
13-Jul-2016 12:06:02.385 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/marc/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
13-Jul-2016 12:06:02.578 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
13-Jul-2016 12:06:02.619 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
13-Jul-2016 12:06:02.623 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
13-Jul-2016 12:06:02.624 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
13-Jul-2016 12:06:02.625 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 702 ms
13-Jul-2016 12:06:02.654 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
13-Jul-2016 12:06:02.655 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.3
13-Jul-2016 12:06:02.665 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor /usr/local/Cellar/tomcat/8.5.3/libexec/conf/Catalina/localhost/ROOT.xml
13-Jul-2016 12:06:03.183 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
13-Jul-2016 12:06:08.815 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor /usr/local/Cellar/tomcat/8.5.3/libexec/conf/Catalina/localhost/ROOT.xml has finished in 6,149 ms
13-Jul-2016 12:06:08.816 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/docs
13-Jul-2016 12:06:08.837 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/docs has finished in 21 ms
13-Jul-2016 12:06:08.837 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/examples
13-Jul-2016 12:06:09.079 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/examples has finished in 241 ms
13-Jul-2016 12:06:09.079 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/host-manager
13-Jul-2016 12:06:09.104 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/host-manager has finished in 25 ms
13-Jul-2016 12:06:09.104 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/manager
13-Jul-2016 12:06:09.123 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/Cellar/tomcat/8.5.3/libexec/webapps/manager has finished in 19 ms
13-Jul-2016 12:06:09.157 INFO [www-test-app-startStop-1] org.apache.catalina.core.ApplicationContext.log Marking servlet CFMLServlet as unavailable
13-Jul-2016 12:06:09.157 SEVERE [www-test-app-startStop-1] org.apache.catalina.core.StandardContext.loadOnStartup Servlet [CFMLServlet] in web application [] threw load() exception
 java.lang.ClassNotFoundException: lucee.loader.servlet.CFMLServlet
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1282)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1116)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:520)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:501)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1061)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1000)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4902)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5212)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1405)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1395)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Can't find the disconnect... where do i go from here?

1

1 Answers

1
votes

RESOLVED {sigh}

Well, I’m totally ready to kick my own a$$. The solution was way more simple than I thought.

My (mis)understanding was that configuring the Lucee EXPRESS to use the local Apache install on the mac just wasn’t going to work – that I had to use the tomcat built-in web server. The tomcat web server, because it’s based on Java, is in fact case-sensitive when it comes to filenames in the URL – “Foo.jpg” is NOT the same as “foo.jpg” in the eyes of the ‘cat. This is why I had given up on Lucee Express.

I do recall trying to get local Apache to work with Lucee Express, but since so much time has passed since that attempt, I couldn’t begin to tell you what I was doing wrong. I just know I couldn’t get it to work – probably mucking with config files that I actually didn’t need to.

Anyway, the solution is simple as all heck… download Lucee Express. Then just configure virtual hosts in apache as one normally would, as Apache needs to be told to proxy any coldfusion requests to tomcat/lucee… like so:

<Directory "/Volumes/Storage/company/sites/_test-app/www">
    Allow From All
    AllowOverride All
    Options +Indexes
    Require all granted
    DirectoryIndex index.cfm
</Directory>

<VirtualHost *:80>
    ServerName "www-test-app"
    ServerAlias "www-test-app.*.*.*.*.xip.io"
    DocumentRoot "/Volumes/Storage/company/sites/_test-app/www"
    <Proxy *>
        Allow from 127.0.0.1
    </Proxy>
    ProxyPreserveHost On
    ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://localhost:8009/$1$2
</VirtualHost>

Then on the other side, add a similar entry for the Tomcat server.xml file:

<Host name="www-test-app" appBase="webapps" autoDeploy="true" unpackWARs="true">
            <Context path="" docBase="/Volumes/Storage/company/sites/_test-app/www">           
                <JarScanner scanClassPath="false"/>
            </Context>                      
        </Host>

Then (damn it!!!) just start Apache and start Tomcat/Lucee. That’s it. Tomcat will create the WEB-INF files in each virtual host specified. The tomcat web server is still running on port 8888, and the ajp connector is still running on 8009.

http://www-test-app gives the result via Apache (case-insensitive urls).

Since Apache has root permission to listen on port 80, it does so… and passes CF requests on to port 8009.

BONUS: One can still test via the Tomcat web server…

http://www-test-app:8888 gives the result via Tomcat web server.

If one wanted to bypass/refrain from Apache and use the Tomcat web server, completely self-contained, BUT not have to add “:8888” to all their urls, homebrew for mac can install “haproxy” which, when run as root and configured using a simple config file, can receive requests on port 80 and forward them to port 8888.

For any NEW sites where the desire is to make sure file names are properly specified in code (case sensitivity-wise), this would be my ultimate solution. For legacy apps that were originally run on a case-insensitive stack, the use of the local Apache web server is the way to go.