开发者

Can GlassFish 2 be configured to make a webservice accessible **only** from some specific port?

开发者 https://www.devze.com 2023-01-27 20:45 出处:网络
Currently we serve some web applications in a domain on port 80. This port is accessible from the internet.

Currently we serve some web applications in a domain on port 80. This port is accessible from the internet.

Now there should be deployed some EJB wich expose some of their methods as webservices using the @WebMethod annotation. These should not be accessibe from the (public) port 80, but only from port 8000, which can be accessed only from the internal network.

I set up a new virtual server named "internal" which uses a http-listener that listens on port 8000:

<virtual-server hosts="${com.sun.aas.hostName}" http-listeners="http-listener-3" id="internal" log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
          <property name="sso-enabled" value="false"/>
          <property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
          <property name="accesslog" value="${com.sun.aas.instanceRoot}/logs/access"/>
</virtual-server>

<http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="false" default-virtual-server="internal" enabled="true" family="inet" id="http-listener-3" port="8000" security-enabled="false" server-name="" xpowered-by="false">
          <property name="proxiedProtocols" value="ws/tcp"/>
</http-listener>

Then I assigned this virtual server to the enterprise application that hosts the service by setting the virtual-servers attribute.

<application-ref disable-timeout-in-minutes="30" enabled="true" lb-enabled="false" ref="myapp" virtual-servers="internal"/>

The webservices are available now both on port 80 and 8000, but what is needed is that they are available on port 8000 only, not from 80. Is there a way to achieve thi开发者_Python百科s in GlassFish 2 using a single domain? Or must a second domain be used?


You need to pull your webMethods out and place them into their own app. Then when you deploy the app you can manage (the target tab) which server / virtual servers they end up on.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号