JBoss.orgCommunity Documentation

Chapter 13. Orphans chapters: TODO: move and integrate those

13.1. Setup a Gadget Server
13.1.1. Setup virtual servers for the gadget rendering
13.1.2. Config
13.1.3. Security key
13.1.4. Gadget proxy and concat configuration
13.1.5. Proxy

GateIn recommend you to setup 2 different virtual hosts because it's the basis of the security model of gadgets. Having the gadget running on a different domain than the container (the website that 'contains' the app), the gadget can't read / modify / do anything nasty to GateIn Portal (like adding spam messages, stealing your cookies, whatever).

For example you can server the portal from http://www.sample.com and the gadgets from http://www.samplemodules.com

It's possible to have multiple rendering servers. That would help to balance the load across multiple servers.

If you still want to deploy it on the same server, make sure that it starts before anything that use the gadgets (for example the webapp GateInGadgets that use org.exoplatform.application.gadget.GadgetRegister)

dd if=/dev/random bs=32 count=1 | openssl base64 > /tmp/key.txt

These servers have to be on the same domain as the gadget server. you can configure it in {code}"link", "script", "embed", "img", "style"{, "expires": "86400", "proxy-url": "http://localhost:8080/GateInGadgetServer/gadgets/proxy?url=", "concat-url": "http://localhost:8080/GateInGadgetServer/gadgets/concat?" }{code}

if your server is behind a proxy and you want to allow external gadgets, you should configure the proxy of your JVM adding this code at the begining. {code}-Dhttp.proxyHost=proxyhostURL -Dhttp.proxyPort=proxyPortNumber -Dhttp.proxyUser=someUserName -Dhttp.proxyPassword=somePassword {code}