我正在尝试将我的服务器公共IP地址映射到Websphere LP server.xml文件中,但是当我尝试从外部访问它时,我收到连接错误。我尝试给host =“localhost”并尝试从服务器本身访问,它工作正常。
我是否需要在Websphere LP中配置以从外部访问它。
Server.xml文件
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>jsp-2.2</feature>
<feature>localConnector-1.0</feature>
</featureManager>
<httpEndpoint host="*" httpPort="8007" httpsPort="9443" id="defaultHttpEndpoint"/>
<applicationMonitor updateTrigger="mbean"/>
<library id="worklight-6.0.0">
<fileset dir="C:\IBM\Liberty\usr\shared\resources" includes="worklight-jee-library-6.0.0.jar"/>
</library>
<library id="apps-common">
<fileset dir="C:\IBM\Liberty\usr\shared\resources" includes="org.hsqldb.hsqldb_2.2.5.jar"/>
</library>
<application context-root="/DemoApp" id="DemoApplication" location="DemoApplication.war" name="DemoApplication" type="war">
<classloader commonLibraryRef="worklight-6.0.0,apps-common"/>
</application>
</server>
感谢任何帮助。
答案 0 :(得分:5)
根据httpEndpoint配置元素的InfoCenter文档,此处为:http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.wlp.doc/autodita/rwlp_metatype_4ic.html?resultof=%22%68%74%74%70%65%6e%64%70%6f%69%6e%74%22%20#mtFile121
*的主机名将绑定到所有可用的网络接口 - 您不需要在Liberty端执行任何额外操作,我相信这会回答您的问题。
将主机名设置为“localhost”意味着只能从您的计算机访问http端点。
使用提供的配置(hostName of *),这应该可以远程工作 - 因此可能是防火墙问题。
您可以检查/servers/yourServer/logs/messages.log文件以验证端点绑定到哪些接口 - 查找表单的消息
WWKO0219I:TCP Channel defaultHttpEndpoint已启动,现在正在侦听主机localhost(IPv4:127.0.0.1)端口9080上的请求。