运行现有的 Glassfish 或 Payara Server 时,会部署一个名为“ejb-timer-service-app”的默认应用程序,其中包含一个位于 http://localhost:8080/ejb-timer-service-app/timer 的 Web 前端。
更多信息请点击:https://docs.oracle.com/cd/E18930_01/html/821-2418/beahw.html
遗憾的是,前端无法通过 protected 管理控制台(端口 4848)访问,但可以通过主主机(端口 8080 和 8181)访问。这样每个知道我的服务器 URL 的人都可以访问此页面。
有没有办法在没有一些奇特的防火墙或负载均衡器配置的情况下停用应用程序(而不是 ejb-timer-service 本身)或至少使前端页面不再可访问(隐藏它)?
最佳答案
显然目前还没有办法立即禁用该应用程序。我在 github 上请求了 payara 的新功能:https://github.com/payara/Payara/issues/1803
由于应用程序服务器需要 ejb-timer-service-app.war 才能提供 EJB 计时器服务,因此无法删除它。
但是我创建了一个解决方法来至少禁用前端部分:
I did some quick tests locally on how to remove the frontend without damaging the EJB timer-service. Here is what I've changed inside the
${PAYARA_HOME}/glassfish/lib/install/applications/ejb-timer-service-app.war
:Delete file
WEB-INF\sun-web.xml
Delete fileWEB-INF\web.xml
Delete folderWEB-INF\classes\com
Shell commands:
zip -d ejb-timer-service-app.war "WEB-INF/sun-web.xml" zip -d ejb-timer-service-app.war "WEB-INF/web.xml" zip -d ejb-timer-service-app.war "WEB-INF/classes/com/*"
If the domain has been started before you also have to delete the folder
glassfish\domains\domain1\applications\ejb-timer-service-app
to clean up the already deployed frontend.After a domain restart the servlet at http://localhost:8080/ejb-timer-service-app/timer is no longer available (HTTP 404) nevertheless the EJB timers are working properly
关于java - 在 Glassfish/Payara 上禁用或隐藏 "ejb-timer-service-app",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45326963/