2

我已在 Lucee 谷歌小组中发帖,但四天后,我只是没有得到我需要的支持。我有一种 Tomcat 专家能够很快为我指出正确方向的感觉,所以我在这里发帖。

OSX El Cap、Apache2、Tomcat 8、Lucee 5。

http://localhost,我得到了 Apache “它有效!” 页。

on http://localhost:8080,我得到默认的 Lucee 页面,从

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

http://localhost:8080/manager/html和上http://localhost:8080/host-manager/html,我得到了 Tomcat 管理页面。

我有一个目录,/Volumes/Storage/{companyname}/sites/www-test-app/www其中包含 index.cfm 和 index.htm

我已经www-test-app在我的 HOSTS 文件中进行了设置。

我有一个主机httpd-vhosts.conf条目www-test-app

我在 tomcat 的 server.xml 文件中有一个条目:

<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>

当我打电话时http://www-test-app/index.htm,我得到了我的静态测试页面。

当我打电话时,http://www-test-app/index.cfm我得到这个错误:

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

我已停止并重新启动 apache 和 tomcat 以确保读取配置文件。

最大的线索:我没有看到 WEB-INF 正在创建 /Volumes/Storage/{companyname}/sites/www-test-app/www

我的目录权限是 777 这个目录和所有子目录:

/Volumes/Storage/{companyname}/sites

不过,我不确定是否需要更改所有权。

Apache2 包含在 El Cap 中。Apachetestconfig产生“语法 OK”。

Tomcat 是通过 Homebrew 安装的。

Lucee 是通过此页面的 WAR 文件安装的:http: //brianflove.com/2015/03/05/lucee-on-mac-os-x-yosemite-quick-start/

我从这里被困住了......但是哦,如此接近,因为默认的 Lucee 页面看起来很棒,包括任何 cfoutput/变量。

这是来自 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)

找不到断开连接...我从这里去哪里?

4

1 回答 1

1

解决{叹气}

好吧,我完全准备好踢自己的$$了。解决方案比我想象的要简单得多。

我的(错误)理解是,将 Lucee EXPRESS 配置为在 mac 上使用本地 Apache 安装是行不通的——我必须使用 tomcat 内置的 Web 服务器。tomcat web 服务器,因为它基于 Java,实际上在 URL 中的文件名时是区分大小写的——“Foo.jpg”与“cat.jpg”不同。这就是我放弃 Lucee Express 的原因。

我确实记得曾尝试让本地 Apache 与 Lucee Express 一起工作,但自从那次尝试以来已经过去了很长时间,我无法开始告诉你我做错了什么。我只知道我无法让它工作——可能是在处理我实际上不需要的配置文件。

无论如何,解决方案很简单……下载 Lucee Express。然后像往常一样在 apache 中配置虚拟主机,因为需要告诉 Apache 将任何冷融合请求代理到 tomcat/lucee ......就像这样:

<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>

然后在另一边,为 Tomcat server.xml 文件添加一个类似的条目:

<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>

然后(该死的!!!)只需启动 Apache 并启动 Tomcat/Lucee。而已。Tomcat 将在每个指定的虚拟主机中创建 WEB-INF 文件。tomcat web 服务器仍在 8888 端口上运行,ajp 连接器仍在 8009 上运行。

http://www-test-app通过 Apache 给出结果(不区分大小写的 url)。

由于 Apache 具有侦听端口 80 的 root 权限,因此它会这样做……并将 CF 请求传递到端口 8009。

奖励:仍然可以通过 Tomcat Web 服务器进行测试……</p>

http://www-test-app:8888通过 Tomcat Web 服务器给出结果。

如果有人想绕过/避免使用 Apache 并使用完全独立的 Tomcat Web 服务器,但不必在其所有 url 中添加“:8888”,homebrew for mac 可以安装“haproxy”,当以 root 身份运行时使用简单的配置文件进行配置,可以在端口 80 上接收请求并将其转发到端口 8888。

对于任何希望确保在代码中正确指定文件名(区分大小写)的新站点,这将是我的最终解决方案。对于最初在不区分大小写的堆栈上运行的遗留应用程序,使用本地 Apache Web 服务器是可行的方法。

于 2016-07-15T19:36:00.433 回答