更改 Axis Web 服务正在侦听的端口

发布于 2024-07-11 19:45:59 字数 256 浏览 8 评论 0原文

我有一个在端口 :80 上运行的 Web 应用程序,并且我有一个属于该 Web 应用程序一部分的 Axis Web 服务。 因此,该服务也在端口 :80 上运行。

但是,出于安全原因,我们的客户要求我们将 Web 服务端口更改为 8080,以便他们只能允许 Web 服务的远程使用者访问该端口。 因此,他们无法访问常规 Web 应用程序,但可以访问该服务。

是否可以在不重构应用程序并在单独的 Web 应用程序中取出 Web 服务的情况下完成此操作?

I have a web application running on port :80, and I have an Axis web service that is part of that web application. As such, the service is running on port :80 as well.

However, for security reasons our client has asked us to change the web service port to 8080 so that they can allow access only to that port for remote consumers of the web service. Therefore they won't have access to the regular web application, but have access to the service.

Is this possible to do without refactoring the app and taking out the web service in a separate web app?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一身骄傲 2024-07-18 19:45:59

正如我在评论中所说,我们的 Web 应用程序托管在 Oracle AS 10g 上,前面有一个 Oracle Web Cache 服务器。 Oracle Web Cache 基于 Apache httpd,因此它具有虚拟主机支持和 URL 重写(尽管这些术语中不存在)。

我设法通过以下方法解决了该问题:

它就像一个魅力。

至于 Axis 本身,我没有找到一种方法将其配置为自行侦听另一个端口。 我想期望 Axis 提供此功能是不合理的,因为它只是托管在 servlet 容器中的 servlet,而提供连接器/传输层是容器的工作。

不管怎样...感谢所有提供帮助的人,我很感激。

As I've said in my comment, our web application is hosted on Oracle AS 10g with an Oracle Web Cache server sitting in front of it. Oracle Web Cache is based on Apache httpd, so it has virtual host support and URL rewriting (although it is not present under these terms).

I've managed to solve the problem by:

It works like a charm.

As for Axis itself, I didn't find a way to configure it to listen on another port by itself. I guess it was unreasonable to expect from Axis to provide this functionality as it is only a servlet hosted in a servlet container, and it's container's job to provide the connector/transport layer.

Anyway... thanks for all who offered their help, I appreciate it.

音栖息无 2024-07-18 19:45:59

简短的回答可能是——是的,这是可能的。

Axis Web 服务大多与主应用程序足够解耦,因此应该很容易让它们在不同的 Java Web 服务器实例上运行,该实例仅在端口 8080 上运行,以防无法配置您正在运行的任何 Web 服务器来运行也在端口 8080 上,并且仅在该端口上提供 Web 服务。

The short answer probably is - yes it is possible.

Axis webservices mostly are enough decoupled from the main application that it should be easy to get them running on a different Java web server instance that would run only at the port 8080 in the case if it's not possible to configure whatever webserver are you running to run also at the port 8080 and to serve the web service only at that port.

对不⑦ 2024-07-18 19:45:59

您应该能够使用端口 8080 连接器设置单独的服务。

实际上,您将在实例内运行 2 个“迷你”Tomcat。

基本上,

<Service> <!-- normal service -->
  <Connector port="80" />
</Service>
<Service> <!-- custom service -->
  <Connector port="8080" />
  <Engine>
     <Host />
  </Engine>
</Service>

如果这个解决方案不能正常工作,它确实会带来一些调试噩梦,因此运行第二个服务器(可能是 Jetty)可能会更容易。

What you should be able set up a separate Service using a port 8080 Connector.

Effectively, you'd be running 2 "mini"-Tomcats inside your instance.

Basically,

<Service> <!-- normal service -->
  <Connector port="80" />
</Service>
<Service> <!-- custom service -->
  <Connector port="8080" />
  <Engine>
     <Host />
  </Engine>
</Service>

It does feel like this solution could present some debugging nightmares if it does not work just right and so it could just be easier to run a second server (perhaps Jetty).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文