From 6cced7ffd54675cde9bbcc455962c11ee85e15f8 Mon Sep 17 00:00:00 2001 From: Samuel R. C. Vale Date: Tue, 26 Oct 2010 21:22:12 -0200 Subject: [PATCH] Added instructions to XMPP chat setup. --- INSTALL.chat | 231 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 217 insertions(+), 14 deletions(-) diff --git a/INSTALL.chat b/INSTALL.chat index c34bd46..3c404f1 100644 --- a/INSTALL.chat +++ b/INSTALL.chat @@ -13,11 +13,47 @@ To configure XMPP/BOSH in Noosfero you need: Take a look at util/chat directory to see samples of config file to configure a XMPP/BOSH server with ejabberd, postgresql and apache2. -== Server setup -Ejabberd creates semi-anonymous rooms by default, but Noosfero's Jabber client needs -non-anonymous room, then we need to change default params of creation rooms in ejabberd -to create non-anonymous rooms. +== XMPP Server Setup + +This is a step-by-step guide to get a XMPP service working, in a Debian system. + +1. Install the required packages + +# aptitude install ejabberd odbc-postgresql + + +2. Ejabberd configuration + +All the following changes must be done in config file: + + /etc/ejabberd/ejabberd.cfg + + 2.1. Set the default admin user + +{ acl, admin, { user, "", "localhost" } }. + + 2.2. Set the default host + +{ hosts, [ "localhost" ] }. + + 2.3. Http-Bind activation + +{ 5280, ejabberd_http, [ + http bind, + ] +} + +(...) + +{ modules, [ + ... + { mod_http_bind, [] } +] }. + +Ejabberd creates semi-anonymous rooms by default, but Noosfero's Jabber client +needs non-anonymous room, then we need to change default params of creation +rooms in ejabberd to create non-anonymous rooms. In non-anonymous rooms the jabber service sends the new occupant's full JID to all occupants in the room[1]. @@ -25,15 +61,182 @@ all occupants in the room[1]. Add option "{default_room_options, [{anonymous, false}]}" to /etc/ejabberd/ejabberd.cfg to mod_muc session. See below: - {mod_muc, [ - %%{host, "conference.@HOST@"}, - {access, muc}, - {access_create, muc}, - {access_persistent, muc}, - {access_admin, muc_admin}, - {max_users, 500}, - {default_room_options, [{anonymous, false}]} - ]}, - +{ mod_muc, [ + %%{host, "conference.@HOST@"}, + {access, muc}, + {access_create, muc}, + {access_persistent, muc}, + {access_admin, muc_admin}, + {max_users, 500}, + {default_room_options, [{anonymous, false}]} +]}, [1] - http://xmpp.org/extensions/xep-0045.html#enter-nonanon + + + 2.4. Authentication method + +To use Postgresql through ODBC, the following modifications must be done: + + * Disable the default method: + +{ auth_method, internal }. + + * Enable autheticantion through ODBC: + +{ auth_method, odbc }. +{ odbc_server, "DSN=PSQLejabberd" }. + + + 2.5. Increase the shaper traffic limit + +{ shaper, normal, { maxrate, 10000000 } }. + + + 2.6. Disable unused modules + +Unused modules can be disabled, for example: + + * s2s + * web_admin + * mod_pubsub + * mod_irc + * mod_offine + * ... + + +3. Configuring Postgresql + + 3.1. Create a new database + +# createdb ejabberd + + + 3.2. Basic database scheme for this setup: + +# zcat /usr/share/doc/ejabberd/examples/pg.sql.gz > pg.sql +# psql ejabberd < pg.sql + + +4. ODBC configuration + +The following files must be created: + + * /etc/odbc.ini + +[ PSQLejabberd ] + Description = PostgreSQL + Driver = PostgreSQL Unicode + Trace = No + TraceFile = /tmp/psqlodbc.log + Database = ejabberd + Servername = localhost + UserName = USER + Password = PASSWORD + Port = + ReadOnly = No + RowVersioning = No + ShowSystemTables= No + ShowOidColumn = No + FakeOidIndex = No + ConnSettings = + + * /etc/odbcinst.ini + +[ PostgreSQL Unicode ] + Description = PostgreSQL ODBC driver ( Unicode version ) + Driver = /usr/lib/odbc/psqlodbcw.so + Setup = /usr/lib/odbc/libodbcpsqlS.so + Debug = 0 + CommLog = 1 + UsageCount = 3 + + * testing all: + +# isql 'PSQLejabberd' USER + + +5. Enabling kernel polling and SMP in /etc/default/ejabberd + +POLL = true +SMP = auto + + +6. Increase the file descriptors limit for user ejabberd + + 6.1. Uncomment this line in file /etc/pam.d/su: + +session required pam_limits.so + + + 6.2. Add this lines to file /etc/security/limits.conf: + +ejabberd hard nofile 65536 +ejabberd soft nofile 65536 + +Now, test the configuration: + +# cat /proc//limits + + +7. Apache Configuration + +Be our server is jabber-br.org, Apache server must be configurated as follow: + + * /etc/apache2/sites-available/jabber-br-proxy: + +ProxyPass /http-bind/ https://jabber-br.org:5280/http-bind/ + + Order deny, allow + Allow from all + + + * /etc/apache2/apache2.conf: + + + StartServers 8 + MinSpareThreads 25 + MaxSpareThreads 75 + ThreadLimit 128 + ThreadsPerChild 128 + MaxClients 2048 + MaxRequestsPerChild 0 + + +Note: module proxy_http must be enabled: + +# a2enmod proxy_http + + +8. DNS configuration + + * /etc/bind/db.colivre: + +_xmpp-client._tcp SRV 5 100 5222 master +(...) +conference CNAME master +_xmpp-client._tcp.conference SRV 5 100 5222 master + + +9. Testing this Setup + +Adjust shell limits to proceed with some benchmarks and load tests: + +# ulimit −s 256 +# ulimit −n 8192 +# echo 10 > /proc/sys/net/ipv4/tcp_syn_retries + +To measure the bandwidth between server and client: + + * at server side: + +# iperf −s + + * at client side: + +# iperf −c server_ip + +For heavy load tests, clone and use this software: + +git clone http://git.holoscopio.com/git/metal/tester.git + -- libgit2 0.21.2