Setting up Speeqe on your own server.
This is a quick guide for setting up speeqe on your own servers. You can follow links for more details throughout this guide.
Speeqe consists of a javascript client and a web page built with django. The javascript client is the main user interface for using XMPP/MUC. The website creates accounts, handles room urls, dns named rooms, avatars, and autologin/session management for any XMPP account.
Speeqe Parts - what you will need
One thing to note, speeqe is a collection of software, you can mix and match to achieve the kind of install you need.
- A BOSH connection manager
- DNS server (if using dns named rooms)
- Storage for Speeqe room searching. (optional)
And of course, download Speeqe. For now you can use what is in git.
git clone git://code.stanziq.com/speeqe
Frontend
Webclient
In your speeqe directory this is named 'speeqewebclient'
The quick setup for simple xmmp/muc usage follows:
The javascript library simply needs to be web accessible and at the url, http://yourwebsite/speeqewebclient/.
At speeqe.com we use nginx to serve this portion of the site. Here is the configuration example:
location ~ ^/(speeqewebclient/scripts)/ {
# serve static files
expires 0d;
root /usr/local/var/www/;
index index.html index.htm;
}
You will then need to copy '/usr/local/var/www/speeqewebclient/scripts/local_settings.js.dist' to '/usr/local/var/www/speeqewebclient/scripts/local_settings.js'
Change /speeqewebclient/scripts/local_settings.js to the required configurations options :
See: local_settings.js.dist for options.
NOTE: There needs to be a sub-directory 'speeqewebclient' in /usr/local/var/www/ that contains the speeqe webclients, html and javascript.
You can test if this works by going to http://yourwebsite/speeqewebclient/test_client.html
BOSH Proxy
You will need to add a proxy to your BOSH connection manager.
The Nginx configuration looks like the following :
upstream punjab {
server localhost:5280;
}
# ...
location /xmpp-httpbind {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://punjab;
}
Website Proxy
You will also need to proxy to the django portions of Speeqe.
The Nginx configuration looks like the following:
location /avatar-service {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8000/avatar-service;
}
location / {
client_max_body_size 100m;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8000;
}
Backend/Servers
Database
Because of Django, Speeqe is able to use any backend storage that django supports. This can be Postgresql, MySQl, SQLite, etc.
The recommended database install is postgresql.
Website
In your speeqe directory this is names 'speeqeweb'.
To setup the website you will need the following:
Django (>=0.9.6) (http://www.djangoproject.com/)
A database backend such as Postgresql (http://postgresql.org)
xmppy (http://xmpppy.sourceforge.net/)
PIL - Python Image Library (http://www.pythonware.com/products/pil/)
Move or add the speeqeweb directory to your PYTHON_PATH.
Edit local_settings.py to point to your database. Add the settings from local_settings.py.dist to your local_settings.py file.
Example local_settings.py.dist
Sync/Install your database
python manage.py syncdb
Start up your django web server using port 8000. This is the port setting we did for the proxy. You are welcome to set it to whatever.
For more information about running django see http://www.djangoproject.com/documentation/0.96/modpython/
BOSH
You can use any BOSH connection manager you like, but this guide will describe how to set up Punjab.
http://code.stanziq.com/punjab
The following .tac file is what you will need :
# punjab tac file
from twisted.web import server, resource, static
from twisted.application import service, internet
from punjab.httpb import Httpb, HttpbService
root = static.File("./html")
b = resource.IResource(HttpbService(1, use_raw=True))
root.putChild('xmpp-httpbind', b)
site = server.Site(root)
application = service.Application("punjab")
internet.TCPServer(5280, site).setServiceParent(application)
And run punjab with twistd
twistd -y --syslog punjab.tac
This will put punjab in daemon mode and log to syslog.
XMPP Server
You do not have to install a XMPP server but to make sure things go well, it is best. Install ejabberd and make sure anonymous support is configured. You will also need to make sure mod_muc is up and running.
Setup URL domain named rooms
URL domain named rooms are using urls to access rooms.
For example:
http://speeqers.speeqe.com will go to the room speeqers
You can use any DNS server that supports wildcard CNAMEs to configure Speeqe to have domain named rooms.
This setup uses Bind for setting up dns for Speeqe.
First, The setup for the root domain is the same for any other root domain. For Speeqe to work you will need to add a wild card CNAME and have it point to your webserver.
* CNAME www
www points to your webserver.
http://www.debian-administration.org/articles/358 is a good example on configuring bind to do this.
Setup room message searching
In order to support this you will need to run ejabberd and couchdb.
After you have couchdb installed you will then need to set up mod_muc_logspeeqe
