开发者

Java web service deployed in Glassfish accessible over http and https

开发者 https://www.devze.com 2023-01-29 11:44 出处:网络
I\'m trying to create a Web Service using JAX-WS and Glassfish 2.1 that is listening to 2 enpoints, one over http and the other over https. First I have created the web service with the default settin

I'm trying to create a Web Service using JAX-WS and Glassfish 2.1 that is listening to 2 enpoints, one over http and the other over https. First I have created the web service with the default settings (this means over http) and it worked fine. After that I have modified it to accept connections over https and this is working also but the initial case stopped working. Can anybody please tell me how to solve this issue? I know it is possible, but I couldn't find the way to do it.

Thank开发者_JAVA技巧s.


The only way I've been able to do this is via Apache's proxy pass. I found this relatively easy to set up too.

Using CentOS, I yum installed apache (which comes with mod_proxy) and mod_ssl.

In the http.conf file, I had the following configuration:

Listen 8080
ProxyRequests On
SSLProxyEngine on

AllowCONNECT 8181

<Proxy *>
    Order deny,allow
    Allow from all
    Deny from all
</Proxy>
ProxyPass / https://radish:8181/
ProxyPassReverse / https://radish:8181/

Using this configuration you obviously have to disable the 8080 listener in glassfish.

In the end, I used ProxyPass to forward both ports 80 and 443 from Apache to glassfish port 8181.

0

精彩评论

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