Mac OS X Sierra with mod_cfml

Hi,

Try to get mod_cmfl working under XAMPP with lucee-express-5.0.0.235-RC.

  1. I downloaded the mod_cfml.so and put it in /XAMPP/xamppfiles/modules/ (where all the .so files are located).

  2. I downloaded the mod_cfml-valve.jar and put it in the /lucee-express-5.0.0.235-RC/lib/ folder.

  3. Then I put in the XAMPP httpd.conf the lines:

# XAMPP
Include etc/extra/httpd-xampp.conf
<Proxy *>
Allow from 127.0.0.1
</Proxy>
ProxyPreserveHost On
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ http://localhost:8888/$1$2

Timeout 5400
ProxyTimeout 5400
SetEnv proxy-nokeepalive 1
SetEnv force-proxy-request-1.0

LoadModule modcfml_module modules/mod_cfml.so
CFMLHandlers ".cfm .cfc .cfml"
ModCFML_SharedKey "asecretkey"
# Optional, all for logging and debugging:
LogHeaders true
LogHandlers true
LogAliases true
VDirHeader false
  1. In the /lucee-express-5.0.0.235-RC/conf/server.xml I put in:
<Host name="localhost" appBase="webapps"
            unpackWARs="true" autoDeploy="true">
  <Valve
                className="mod_cfml.core"
                loggingEnabled="false"
                maxContexts="100"
                timeBetweenContexts="0"
                scanClassPaths="false"
                sharedKey="asecretkey" /> 

      </Host>

And it does not work. Any tips?

Regards,

Can you expand on “it does not work”?

there are error log files for apache, tomcat and lucee to investigate

Hi,

Thanks for the reply.

I have got this from the XAMPP error_log:

[Tue Dec 19 11:40:43.577231 2017] [modcfml:notice] [pid 37393] Handler Pattern Found => .cfm
[Tue Dec 19 11:40:43.577315 2017] [modcfml:notice] [pid 37393] Pattern Match TRUE: extension [.cfm] matches handler [.cfm]
[Tue Dec 19 11:40:43.577319 2017] [modcfml:notice] [pid 37393] Handler Pattern Found => .cfc
[Tue Dec 19 11:40:43.577323 2017] [modcfml:notice] [pid 37393] Handler Pattern Found => .cfml
[Tue Dec 19 11:40:43.577358 2017] [modcfml:notice] [pid 37393] URI => /index.cfm, filename => proxy:http://localhost:8888/index.cfm
[Tue Dec 19 11:40:43.577364 2017] [modcfml:notice] [pid 37393] Incoming header [Host] => local.spanishestate.com
[Tue Dec 19 11:40:43.577368 2017] [modcfml:notice] [pid 37393] Incoming header [Connection] => keep-alive
[Tue Dec 19 11:40:43.577371 2017] [modcfml:notice] [pid 37393] Incoming header [User-Agent] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36
[Tue Dec 19 11:40:43.577375 2017] [modcfml:notice] [pid 37393] Incoming header [Upgrade-Insecure-Requests] => 1
[Tue Dec 19 11:40:43.577379 2017] [modcfml:notice] [pid 37393] Incoming header [Accept] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
[Tue Dec 19 11:40:43.577382 2017] [modcfml:notice] [pid 37393] Incoming header [Accept-Encoding] => gzip, deflate
[Tue Dec 19 11:40:43.577395 2017] [modcfml:notice] [pid 37393] Incoming header [Accept-Language] => en-US,en;q=0.9,de;q=0.8,es;q=0.7,fr;q=0.6,it;q=0.5,nl;q=0.4,ru;q=0.3,zh-CN;q=0.2,zh;q=0.1
[Tue Dec 19 11:40:43.577409 2017] [modcfml:notice] [pid 37393] Incoming header [Cookie] => _ga=GA1.2.284255075.1508491480; cftoken=0; cfid=67733314-2511-45ff-892b-6616e89436c2; PHPSESSID=3hu4o2pvqm64f377r0baffi9p6; __utma=103498781.284255075.1508491480.1513676672.1513676672.1; __utmc=103498781; __utmz=103498781.1513676672.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
[Tue Dec 19 11:40:43.577413 2017] [modcfml:notice] [pid 37393] Incoming header [X-Tomcat-DocRoot] => /www/repository/spanishestate_new
[Tue Dec 19 11:40:43.577417 2017] [modcfml:notice] [pid 37393] Incoming header [X-Webserver-Context] => local-spanishestate-com-httpd-vhosts-confl72
[Tue Dec 19 11:40:43.577420 2017] [modcfml:notice] [pid 37393] Incoming header [X-ModCFML-SharedKey] => asecretkey

And in the Mac Terminal I got:

19-Dec-2017 11:43:28.856 INFO [local.spanishestate.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor /Applications/lucee-express-5.0.0.235-RC/conf/Catalina/local.spanishestate.com/ROOT.xml has finished in 27 ms

Regards,

those logs look fine, did you see anything in the lucee logs (tomcat/logs or {webroot}WEB-INF\lucee\logs) ?

any reason your have timeBetweenContexts=“0” ?

. In that case, you could change the setting to 0 (zero), which will prevent any errors going to end-users.
http://www.modcfml.org/index.cfm/documentation/modcfml-tomcat-valve/config-options/

I’m wondering if that’s why you’re not seeing any errors?

Hi Dick,

Firs of all, I see you posted the same question in the mod_cfml forum. i gave an answer there already, asking for log files which you already posted here. Please don’t double-post questions again.

You say the tomcat log says “/Applications/lucee-express-5.0.0.235-RC/conf/Catalina/local.spanishestate.com/ROOT.xml http://local.spanishestate.com/ROOT.xml has finished in 27 ms”
But that line is not related to mod_cfml: it is your manual config. If it was from mod_cfml, it would have said “local-spanishestate-com-httpd-vhosts-confl72”

So, please remove the directory /Catalina/local.spanishestate.com http://local.spanishestate.com/ROOT.xml , and also remove any entries you might have added to tomcat’s server.xml.

Then, stop and start Tomcat, and do the http request again (http://local.spanishestate.com http://local.spanishestate.com/ROOT.xml/index.cfm probably).
Now check the Terminal output: is there anything going on in Tomcat? If not, then the ProxyPassMatch directive is not triggered in Apache.
The simplest solution for that would be, to add “ProxyRequests on” right before the ProxyPassMatch.
Then restart Apache off course.

If that does not help, then temporarily disable other backend connectors in apache (probably the one going to php). It might have a preference higher then the proxy statement. Just to check if, after a restart, mod_cml does work.

Kind regards,

Paul Klinkenberg

Hi,

Just got the time to work on this, in the terminal I got:

	07-Feb-2018 10:18:09.808 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /Applications/lucee-express-5.0.0.235-RC/webapps/ROOT has finished in 4,909 ms
07-Feb-2018 10:18:09.810 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8888"]
07-Feb-2018 10:18:09.814 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
07-Feb-2018 10:18:09.814 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 4944 ms
07-Feb-2018 10:18:22.876 INFO [local.spanishestate.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor /Applications/lucee-express-5.0.0.235-RC/conf/Catalina/local.spanishestate.com/ROOT.xml
07-Feb-2018 10:18:22.898 SEVERE [local.spanishestate.com-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[local.spanishestate.com].StandardContext[]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:581)
	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1683)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	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)
Caused by: java.lang.IllegalArgumentException: URI scheme is not "file"
	at java.io.File.<init>(File.java:421)
	at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:318)
	at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:244)
	at org.apache.catalina.startup.ContextConfig.processJarsForWebFragments(ContextConfig.java:1855)
	at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1119)
	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5095)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	... 10 more

07-Feb-2018 10:18:22.899 SEVERE [local.spanishestate.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Error deploying configuration descriptor /Applications/lucee-express-5.0.0.235-RC/conf/Catalina/local.spanishestate.com/ROOT.xml
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[local.spanishestate.com].StandardContext[]]
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:728)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:581)
	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1683)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	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)

07-Feb-2018 10:18:22.900 INFO [local.spanishestate.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor /Applications/lucee-express-5.0.0.235-RC/conf/Catalina/local.spanishestate.com/ROOT.xml has finished in 23 ms


So if I type in the browser local.spanishestate.com it gives:

“This local.spanishestate.com page can’t be found”

and in conf/Catalina a local.spanishestate.com folder with a ROOT.xml file is created.

Regards,