Activities

November 2016
M T W T F S S
« Aug   Jan »
 123456
78910111213
14151617181920
21222324252627
282930  

How to delete the PU protocol from Glassfish 3

I have created PU protocol on Glassfish server in order to serving SSL pages forcefully. The main issue is this is the only way to redirect all the non-http requests to https. I did not find any other option for ‘SSL forcing’ in Glassfish 3 version. But here I want to get the same domain.xml file without having the PU ( port unification) protocal enabled. Becasue we enabled many other customer variables on domain.xml and wanted to move all the ssl parts under the loadbalencer (ssl offloading)

1. How to create PU protocol to use force https

[root@web03 ~]# cd /var/glassfish/domains/domain1/config
[root@web03 ~]#/home/glassfish/bin/asadmin create-protocol --securityenabled=false http-redirect
[root@web03 ~]#/home/glassfish/bin/asadmin create-protocol-filter --protocol http-redirect --classname com.sun.grizzly.config.HttpRedirectFilter redirect-filter
[root@web03 ~]#/home/glassfish/bin/asadmin create-protocol --securityenabled=false pu-protocol
[root@web03 ~]#/home/glassfish/bin/asadmin create-protocol-finder --protocol pu-protocol --targetprotocol http-listener-2 --classname com.sun.grizzly.config.HttpProtocolFinder http-finder
[root@web03 ~]#/home/glassfish/bin/asadmin create-protocol-finder --protocol pu-protocol --targetprotocol http-redirect --classname com.sun.grizzly.config.HttpProtocolFinder http-redirect
[root@web03 ~]#/home/glassfish/bin/asadmin set configs.config.server-config.network-config.network-listeners.network-listener.http-listener-1.protocol=pu-protocol​

Here is the reverse process of the activities remove PU protocol

1. Assuming that Glassfish is installed on (/home/glassfish/bin) folder and execute the below commands.

#/var/glassfish/bin/asadmin set  configs.config.server-config.network-config.network-listeners.network-listener.http-listener-1.protocol=http-listener-1
#/var/glassfish/bin/asadmin delete-protocol-finder  --protocol pu-protocol    http-redirect
#/var/glassfish/bin/asadmin delete-protocol-filter --protocol http-redirect redirect-filter
#/var/glassfish/bin/asadmin delete-protocol  pu-protocol
#/var/glassfish/bin/asadmin delete-protocol http-redirect

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>