Академический Документы
Профессиональный Документы
Культура Документы
U n i f i c a t i o n
i n
G l a s s F i s h
Pa r t
In what should be the last entry in this series, we'll cover a late addition to port unification. As I mentioned earlier, GlassFish 3.1 isn't adding support
for port unification, we're simply introducing commands to make it accessible to people beside GlassFish hackers. As often happens, though, once
these commands were revealed to the wider community, one of the first questions was "How can I redirect to a different port?" The short answer used
to be "you can't." But thanks to Ryan Lubke, now you can and we'll see how below. The steps are pretty similar to what we've seen so far. There are 4
different use cases covered here. HTTP->HTTPS (and vice versa), and redirecting on the same or a different port. In the steps listed below, I've tried
to reuse existing elements of the config as much as possible to avoid polluting the configuration file with too much cruft. However, in some cases it
was simpler to just create new structures because of some validation checks asadmin performs to try to prevent invalid configurations from cratering
your instance.
###
### HttpToHttpsRedirectOnSamePort
###
asadmin create-protocol --securityenabled=false http-redirect
asadmin create-http-redirect --secure-redirect true http-redirect
asadmin create-protocol --securityenabled=false pu-protocol
asadmin create-protocol-finder --protocol pu-protocol --targetprotocol http-listener-2 --classname
com.sun.grizzly.config.HttpProtocolFinder http-finder
asadmin create-protocol-finder --protocol pu-protocol --targetprotocol http-redirect --classname
com.sun.grizzly.config.HttpProtocolFinder http-redirect
asadmin set configs.config.server-config.network-config.network-listeners.network-listener.http-listener1.protocol=pu-protocol
###
### HttpToHttpsRedirectOnDifferentPort
###
asadmin create-protocol --securityenabled=false http-redirect
asadmin create-http-redirect --redirect-port 8181 --secure-redirect true http-redirect
asadmin create-protocol --securityenabled=false pu-protocol
asadmin create-protocol-finder --protocol pu-protocol --target-protocol http-listener-2 --classname
com.sun.grizzly.config.HttpProtocolFinder http-finder
asadmin create-protocol-finder --protocol pu-protocol --target-protocol http-redirect --classname
com.sun.grizzly.config.HttpProtocolFinder http-redirect
asadmin set configs.config.server-config.network-config.network-listeners.network-listener.http-listener1.protocol=pu-protocol
###
### HttpsToHttpRedirectOnSamePort
###
asadmin create-protocol --securityenabled=true http-redirect
asadmin create-http-redirect --secure-redirect false http-redirect
asadmin create-ssl --certname s1as --type network-listener --ssl2enabled=false --ssl3enabled=false --tlsenabled=true
--tlsrollbackenabled=true --clientauthenabled=false http-redirect
asadmin create-protocol --securityenabled=false pu-protocol
asadmin create-protocol-finder --protocol pu-protocol --targetprotocol http-listener-1 --classname
com.sun.grizzly.config.HttpProtocolFinder http-finder
asadmin create-protocol-finder --protocol pu-protocol --targetprotocol http-redirect --classname
com.sun.grizzly.config.HttpProtocolFinder http-redirect
asadmin set configs.config.server-config.network-config.network-listeners.network-listener.http-listener2.protocol=pu-protocol
asadmin set configs.config.server-config.network-config.network-listeners.network-listener.http-listener2.enabled=true
###
### HttpsToHttpRedirectOnDifferentPort
###
converted by W eb2PDFConvert.com
Blog
Newer
Older
Menu
a n t w e r k z
converted by W eb2PDFConvert.com