Http-bind configuration for SparkWeb and JWchat with only 80 or 443 from outside access

This document pretends to help the openfire admins out there that are fighting to get httpd-bind working. I’ve went thorugh that path and it was really painful, besides i’ve posted the solution in the forums but it seemed to went undercover because a lot of people keep asking the same. So i’ve recopilated the config needed and i’m publishing it here:

NOTE: This was done with enterprise version but it should work with Opensource version too, just adjust the paths.

  1. Copying sparkweb to an apache subdir.

cp -r /opt/openfire/plugins/enterprise/web/sparkweb /var/www/html/

2.Obtain an index.html file

Go to http://youropenfireserver:9090/webchat

Select the option that brings you the source code from the page in your browser

Copy this code and paste it in a file called index.html at your /var/www/html/sparkweb

  1. Modify your getConfig function within your index.html file

function jive_sparkweb_getConfig()

{

return {

server: “yourpublichostnamesite”,

location: window.location.href,

connectionType : “http”,

port: “80”,

bindPath: “/http-bind/”,

autologin: “false”,

policyFileURL: “http://yourpublichostnamesite/crossdomain.xml

};

The trick is the port number. If you use anything else than 80 or 443 (both publicy accesible from outside and rarely blocked by firewalls or proxies) you’d have trouble with outside clients without complete internet access.

As apache is configured to make the proxypass or rewrite magic the bindPath line should make work sparkweb from outside.

  1. Crossdomain file

Note that the crossdomain file is accessible at the same site, this is needed by sparkweb

crossdomain.xml

<cross-domain-policy>

<allow-access-from domain="*" to-ports=“5222”/>

</cross-domain-policy>

  1. configure your apache virtual host

<VirtualHost yourlocalip:80>

ServerAdmin webmaster@yourdomain

DocumentRoot /var/www/html/sparkweb/

ServerName yourpublichostnamesite

ErrorLog logs/ourpublichostnamesite-error_log

CustomLog logs/ourpublichostnamesite-access_log common

<Directory /var/www/html/sparkweb/>

Options +Multiviews

</Directory>

AddDefaultCharset UTF-8

ProxyPass /http-bind/ http://127.0.0.1:7070/http-bind/

ProxyPassReverse /http-bind/ http://127.0.0.1:7070/http-bind/

ProxyRequests Off

<Proxy *>

Order deny,allow

Allow from all

</Proxy>

</VirtualHost>

  1. Openfire console configuration

Enable http binding and bosch scripting and add the client requests properties to the server properties menu

xmpp.httpbind.client.requests.polling

0

xmpp.httpbind.client.requests.wait

10

xmpp.httpbind.scriptSyntax.enabled

true

httpbind.enabled

true

  1. Https configuration

If you’re using 443 you should redirect to the https binding port instead. the getConfig file, also be sure that your ssl host is working ok.

  1. JWChat configuration

Download jwchat from sourceforge. and unpacking it in /var/www/html/jwchat

10.config.js

The config.js file should have this:

var SITENAME = “mychatserver”;

var BACKENDS =

[

,

  1. jsjacs.js

The jsjacs.jsshould look like this

var JSJACHBC_USE_BOSH_VER = false;

  1. UTF-8

NOTE: Not truly sure about if this is needed, but i’m putting it anyway. If you can verify if this is not really need it please say so or better yet edti the document to reflect the change.

Remove all the charset='utf-8´ instances for the jsjacs.js file.

  1. Remove the language files not needed by your install, at the jwchat root directory.

  2. jwchat.html

Look in jwchat.html file the line with

con.connect(oArg);

and add just the oArg.authtype line just before the con.connect string. Like this:

oArg.authtype = ‘nonsasl’;

con.connect(oArg);

  1. Do further testing and it should -theoretically- work just fine

hope this helps

Andres Mauricio Mujica

RHCE

http://www.seaq.com.co

This document was generated from the following thread: Openfire 3.4.5 with JWChat

This document was generated from the following thread: 3.5.0 enable http-bind?