gpt4 book ai didi

java - OSX El Cap、Apache2、Tomcat 8、Lucee 5

转载 作者:行者123 更新时间:2023-11-30 10:41:49 25 4
gpt4 key购买 nike

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

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

http://localhost 上,我得到 Apache“It Works!”页面。

http://localhost:8080 上,我得到了默认的 Lucee 页面,服务于

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

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

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

我在我的 HOSTS 文件中设置了 www-test-app

我在 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 中。 Apache testconfig 产生“syntax 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)

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

最佳答案

已解决{叹息}

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

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

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

无论如何,解决方案非常简单……下载 Lucee Express。然后像往常一样在 apache 中配置虚拟主机,因为 Apache 需要被告知将任何 coldfusion 请求代理到 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 有 root 权限来监听端口 80,它会这样做……并将 CF 请求传递到端口 8009。

奖励:仍然可以通过 Tomcat Web 服务器进行测试......

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

如果想绕过/避免使用 Apache 并使用完全独立的 Tomcat Web 服务器,但不必在所有网址中添加“:8888”,mac 版自制软件可以安装“haproxy”,运行时作为 root 并使用简单的配置文件进行配置,可以在端口 80 上接收请求并将它们转发到端口 8888。

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

关于java - OSX El Cap、Apache2、Tomcat 8、Lucee 5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38378412/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com