web-applications - 如何设置 IBM Websphere 8 在不同端口上为 Web 应用程序提供服务?

标签 web-applications websphere port

我需要在 Websphere 上将两个应用程序部署为 WAR 文件。 它们都只需要 HTTPS 访问。

是否可以在同一 Websphere 实例上的不同端口上运行这两个 Web 应用程序?

例如,是否可以像这样访问两个应用程序:

https://192.101.1.101:7070/WebApplication1/ 

https://192.101.1.101:7080/WebApplication2/ 

(相同IP,相同协议(protocol)(https),不同端口)

最佳答案

是的,(在 WebSphere Application Server V8.5.5 上),下面是如何执行此操作的示例:

<httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="9080" />
<httpEndpoint id="localHostOnly" host="localhost" httpPort="9081" />

<virtualHost id="alice">
     <hostAlias>your_host_name:9080</hostAlias>
</virtualHost>

<virtualHost id="bob">
     <hostAlias>localhost:9081</hostAlias>
</virtualHost>

<application id="App1" location="myApp.ear" name="App1"
type="ear"/>
<application id="App2" location="myApp2.war" name="App2"
type="war"/>

来自 IBM:

The defaultHttpEndpoint exposes all interfaces on port 9080, the http endpoint with id="localHostOnly" specifies host="localhost", meaning that port 9081 is only exposed on the localhost interface.

If App1 has a WAR file with an ibm-web.bnd.xml file specifying <virtual-host name="alice"/> then this application can only be accessed at your_host_name:9080/app1_context_root.

If App2 (which is a WAR) has an ibm-web-bnd.xml file specifying <virtual-host name="bob"/> then this application can only be accessed at localhost:9081/app2_context_root.

If a third application were deployed which specified no specific virtual host, that application in this configuration would be available on all interfaces of the defaultHttpEndpoint on port 9080, excluding your_host_name:9080 - for example it could be accessed on localhost:9080/app3_context_root.

有关更多信息,请参阅此 APAR 的结束文本: http://www-01.ibm.com/support/docview.wss?uid=swg1PM97514

关于web-applications - 如何设置 IBM Websphere 8 在不同端口上为 Web 应用程序提供服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26143263/

相关文章:

linux - 列出centos下打开的端口、关闭端口和打开端口

ios - NSRunLoop 是做什么的?

java - 如何捆绑 Web 应用程序进行分发

Delphi 网络应用程序

java - Websphere Application Server 中所需的 Websphere MQ 类

java - 启动 websphere 服务器时出现问题?

tomcat - 不同部署环境的默认 servlet 映射

google-apps-script - 如何将页面(模式对话框)与其同级页面(侧边栏)进行通信?

web-services - 用于 jax-ws 2 web 服务部署的 websphere 与 tomcat

Python Telnetlib read_until '#' or '>' 多字符串判断?