Commit 22fce6dddb7570e1d997f625a421b72da61f594d
Committed by
Antonio Terceiro
1 parent
69383c66
Exists in
master
and in
28 other branches
XMPP/Chat install doc updated
Showing
2 changed files
with
90 additions
and
81 deletions
Show diff stats
INSTALL.chat
| 1 | -== Client setup | |
| 1 | +== XMPP/Chat Client Setup | |
| 2 | 2 | |
| 3 | 3 | To configure XMPP/BOSH in Noosfero you need: |
| 4 | 4 | |
| ... | ... | @@ -6,22 +6,24 @@ To configure XMPP/BOSH in Noosfero you need: |
| 6 | 6 | * SystemTimer - http://ph7spot.com/musings/system-timer |
| 7 | 7 | * Pidgin data files - http://www.pidgin.im/ |
| 8 | 8 | |
| 9 | -# apt-get install librestclient-ruby | |
| 10 | -# apt-get install libsystemtimer-ruby (depends to do Debian package to this) | |
| 9 | +If you use Debian Lenny: | |
| 10 | + | |
| 11 | +# apt-get install librestclient-ruby (from backports) | |
| 11 | 12 | # apt-get install pidgin-data |
| 13 | +# apt-get install ruby1.8-dev | |
| 14 | +# gem install SystemTimer | |
| 12 | 15 | |
| 13 | 16 | Take a look at util/chat directory to see samples of config file to configure a |
| 14 | 17 | XMPP/BOSH server with ejabberd, postgresql and apache2. |
| 15 | 18 | |
| 16 | - | |
| 17 | -== XMPP Server Setup | |
| 19 | +== XMPP/Chat Server Setup | |
| 18 | 20 | |
| 19 | 21 | This is a step-by-step guide to get a XMPP service working, in a Debian system. |
| 20 | 22 | |
| 21 | 23 | 1. Install the required packages |
| 22 | 24 | |
| 23 | -# aptitude install ejabberd odbc-postgresql | |
| 24 | - | |
| 25 | +# apt-get -t lenny-backports install ejabberd | |
| 26 | +# apt-get install odbc-postgresql | |
| 25 | 27 | |
| 26 | 28 | 2. Ejabberd configuration |
| 27 | 29 | |
| ... | ... | @@ -31,24 +33,26 @@ All the following changes must be done in config file: |
| 31 | 33 | |
| 32 | 34 | 2.1. Set the default admin user |
| 33 | 35 | |
| 34 | -{ acl, admin, { user, "", "localhost" } }. | |
| 36 | +{ acl, admin, { user, "john", "www.example.com" } }. | |
| 37 | +{ acl, admin, { user, "bart", "www.example.com" } }. | |
| 35 | 38 | |
| 36 | 39 | 2.2. Set the default host |
| 37 | 40 | |
| 38 | -{ hosts, [ "localhost" ] }. | |
| 41 | +{ hosts, [ "www.example.com" ] }. | |
| 39 | 42 | |
| 40 | 43 | 2.3. Http-Bind activation |
| 41 | 44 | |
| 42 | 45 | { 5280, ejabberd_http, [ |
| 43 | - http bind, | |
| 44 | - ] | |
| 46 | + http_bind, | |
| 47 | + web_admin | |
| 48 | + ] | |
| 45 | 49 | } |
| 46 | 50 | |
| 47 | 51 | (...) |
| 48 | 52 | |
| 49 | 53 | { modules, [ |
| 50 | - ... | |
| 51 | - { mod_http_bind, [] } | |
| 54 | + {mod_http_bind, []}, | |
| 55 | + ... | |
| 52 | 56 | ] }. |
| 53 | 57 | |
| 54 | 58 | Ejabberd creates semi-anonymous rooms by default, but Noosfero's Jabber client |
| ... | ... | @@ -59,16 +63,16 @@ In non-anonymous rooms the jabber service sends the new occupant's full JID to |
| 59 | 63 | all occupants in the room[1]. |
| 60 | 64 | |
| 61 | 65 | Add option "{default_room_options, [{anonymous, false}]}" to |
| 62 | -/etc/ejabberd/ejabberd.cfg to mod_muc session. See below: | |
| 66 | +/etc/ejabberd/ejabberd.cfg in mod_muc session. See below: | |
| 63 | 67 | |
| 64 | 68 | { mod_muc, [ |
| 65 | - %%{host, "conference.@HOST@"}, | |
| 66 | - {access, muc}, | |
| 67 | - {access_create, muc}, | |
| 68 | - {access_persistent, muc}, | |
| 69 | - {access_admin, muc_admin}, | |
| 70 | - {max_users, 500}, | |
| 71 | - {default_room_options, [{anonymous, false}]} | |
| 69 | + %%{host, "conference.@HOST@"}, | |
| 70 | + {access, muc}, | |
| 71 | + {access_create, muc}, | |
| 72 | + {access_persistent, muc}, | |
| 73 | + {access_admin, muc_admin}, | |
| 74 | + {max_users, 500}, | |
| 75 | + {default_room_options, [{anonymous, false}]} | |
| 72 | 76 | ]}, |
| 73 | 77 | |
| 74 | 78 | [1] - http://xmpp.org/extensions/xep-0045.html#enter-nonanon |
| ... | ... | @@ -80,12 +84,15 @@ To use Postgresql through ODBC, the following modifications must be done: |
| 80 | 84 | |
| 81 | 85 | * Disable the default method: |
| 82 | 86 | |
| 83 | -{ auth_method, internal }. | |
| 87 | +{auth_method, internal}. | |
| 84 | 88 | |
| 85 | 89 | * Enable autheticantion through ODBC: |
| 86 | 90 | |
| 87 | -{ auth_method, odbc }. | |
| 88 | -{ odbc_server, "DSN=PSQLejabberd" }. | |
| 91 | +{auth_method, odbc}. | |
| 92 | + | |
| 93 | + * Set database server name | |
| 94 | + | |
| 95 | +{odbc_server, "DSN=PostgreSQLEjabberdNoosfero"}. | |
| 89 | 96 | |
| 90 | 97 | |
| 91 | 98 | 2.5. Increase the shaper traffic limit |
| ... | ... | @@ -102,62 +109,74 @@ Unused modules can be disabled, for example: |
| 102 | 109 | * mod_pubsub |
| 103 | 110 | * mod_irc |
| 104 | 111 | * mod_offine |
| 105 | - * ... | |
| 112 | + * mod_admin_extra | |
| 113 | + * mod_register | |
| 106 | 114 | |
| 107 | 115 | |
| 116 | + 2.7. Enable ODBC modules | |
| 117 | + | |
| 118 | + * mod_privacy -> mod_privacy_odbc | |
| 119 | + * mod_private -> mod_private_odbc | |
| 120 | + * mod_roster -> mod_roster_odbc | |
| 121 | + | |
| 108 | 122 | 3. Configuring Postgresql |
| 109 | 123 | |
| 110 | -Change to the noosfero user, and: | |
| 124 | +Login as noosfero user, and execute: | |
| 111 | 125 | |
| 112 | - $ psql noosfero_production < /path/to/noosfero/util/chat/postgresql/ejabberd.sql | |
| 126 | + $ psql noosfero < /path/to/noosfero/util/chat/postgresql/ejabberd.sql | |
| 113 | 127 | |
| 114 | -where "noosfero_production" may need to be replace by the name of the | |
| 115 | -database used for noosfero. | |
| 128 | +Where 'noosfero' may need to be replace by the name of the database used for | |
| 129 | +Noosfero. | |
| 116 | 130 | |
| 117 | 131 | This will create a new schema inside the noosfero database, called 'ejabberd'. |
| 118 | 132 | |
| 133 | +Note 'noosfero' user should have permission to create Postgresql schemas. Also, | |
| 134 | +there should be at least one domain with 'is_default = true' in 'domains' | |
| 135 | +table, otherwise people couldn't see your friends online. | |
| 136 | + | |
| 137 | + | |
| 119 | 138 | 4. ODBC configuration |
| 120 | 139 | |
| 121 | 140 | The following files must be created: |
| 122 | 141 | |
| 123 | 142 | * /etc/odbc.ini |
| 124 | 143 | |
| 125 | -[ PSQLejabberd ] | |
| 126 | - Description = PostgreSQL | |
| 127 | - Driver = PostgreSQL Unicode | |
| 128 | - Trace = No | |
| 129 | - TraceFile = /tmp/psqlodbc.log | |
| 130 | - Database = ejabberd | |
| 131 | - Servername = localhost | |
| 132 | - UserName = USER | |
| 133 | - Password = PASSWORD | |
| 134 | - Port = | |
| 135 | - ReadOnly = No | |
| 136 | - RowVersioning = No | |
| 137 | - ShowSystemTables= No | |
| 138 | - ShowOidColumn = No | |
| 139 | - FakeOidIndex = No | |
| 140 | - ConnSettings = SET search_path TO ejabberd | |
| 144 | +[PostgreSQLEjabberdNoosfero] | |
| 145 | +Description = PostgreSQL Noosfero ejabberd database | |
| 146 | +Driver = PostgreSQL Unicode | |
| 147 | +Trace = No | |
| 148 | +TraceFile = /tmp/psqlodbc.log | |
| 149 | +Database = noosfero | |
| 150 | +Servername = localhost | |
| 151 | +UserName = <DBUSER> | |
| 152 | +Password = <DBPASS> | |
| 153 | +Port = | |
| 154 | +ReadOnly = No | |
| 155 | +RowVersioning = No | |
| 156 | +ShowSystemTables = No | |
| 157 | +ShowOidColumn = No | |
| 158 | +FakeOidIndex = No | |
| 159 | +ConnSettings = SET search_path TO ejabberd | |
| 141 | 160 | |
| 142 | 161 | * /etc/odbcinst.ini |
| 143 | 162 | |
| 144 | -[ PostgreSQL Unicode ] | |
| 145 | - Description = PostgreSQL ODBC driver ( Unicode version ) | |
| 146 | - Driver = /usr/lib/odbc/psqlodbcw.so | |
| 147 | - Setup = /usr/lib/odbc/libodbcpsqlS.so | |
| 148 | - Debug = 0 | |
| 149 | - CommLog = 1 | |
| 150 | - UsageCount = 3 | |
| 163 | +[PostgreSQL Unicode] | |
| 164 | +Description = PostgreSQL ODBC driver (Unicode version) | |
| 165 | +Driver = /usr/lib/odbc/psqlodbcw.so | |
| 166 | +Setup = /usr/lib/odbc/libodbcpsqlS.so | |
| 167 | +Debug = 0 | |
| 168 | +CommLog = 1 | |
| 169 | +UsageCount = 3 | |
| 151 | 170 | |
| 152 | 171 | * testing all: |
| 153 | 172 | |
| 154 | -# isql 'PSQLejabberd' USER | |
| 173 | +# isql 'PostgreSQLEjabberdNoosfero' DBUSER | |
| 155 | 174 | |
| 156 | 175 | |
| 157 | 176 | 5. Enabling kernel polling and SMP in /etc/default/ejabberd |
| 158 | 177 | |
| 159 | -POLL = true | |
| 160 | -SMP = auto | |
| 178 | +POLL=true | |
| 179 | +SMP=auto | |
| 161 | 180 | |
| 162 | 181 | |
| 163 | 182 | 6. Increase the file descriptors limit for user ejabberd |
| ... | ... | @@ -169,8 +188,8 @@ session required pam_limits.so |
| 169 | 188 | |
| 170 | 189 | 6.2. Add this lines to file /etc/security/limits.conf: |
| 171 | 190 | |
| 172 | -ejabberd hard nofile 65536 | |
| 173 | -ejabberd soft nofile 65536 | |
| 191 | +ejabberd hard nofile 65536 | |
| 192 | +ejabberd soft nofile 65536 | |
| 174 | 193 | |
| 175 | 194 | Now, test the configuration: |
| 176 | 195 | |
| ... | ... | @@ -179,26 +198,23 @@ Now, test the configuration: |
| 179 | 198 | |
| 180 | 199 | 7. Apache Configuration |
| 181 | 200 | |
| 182 | -Be our server is jabber-br.org, Apache server must be configurated as follow: | |
| 201 | +Apache server must be configurated as follow: | |
| 183 | 202 | |
| 184 | - * /etc/apache2/sites-available/jabber-br-proxy: | |
| 203 | + * /etc/apache2/sites-enabled/noosfero | |
| 185 | 204 | |
| 186 | -ProxyPass /http-bind/ https://jabber-br.org:5280/http-bind/ | |
| 187 | - <Proxy ∗> | |
| 188 | - Order deny, allow | |
| 189 | - Allow from all | |
| 190 | - </Proxy> | |
| 205 | +RewriteEngine On | |
| 206 | +Include /usr/share/noosfero/util/chat/apache/xmpp.conf | |
| 191 | 207 | |
| 192 | 208 | * /etc/apache2/apache2.conf: |
| 193 | 209 | |
| 194 | 210 | <IfModule mpm_worker_module> |
| 195 | - StartServers 8 | |
| 196 | - MinSpareThreads 25 | |
| 197 | - MaxSpareThreads 75 | |
| 198 | - ThreadLimit 128 | |
| 199 | - ThreadsPerChild 128 | |
| 200 | - MaxClients 2048 | |
| 201 | - MaxRequestsPerChild 0 | |
| 211 | + StartServers 8 | |
| 212 | + MinSpareThreads 25 | |
| 213 | + MaxSpareThreads 75 | |
| 214 | + ThreadLimit 128 | |
| 215 | + ThreadsPerChild 128 | |
| 216 | + MaxClients 2048 | |
| 217 | + MaxRequestsPerChild 0 | |
| 202 | 218 | </IfModule> |
| 203 | 219 | |
| 204 | 220 | Note: module proxy_http must be enabled: |
| ... | ... | @@ -210,10 +226,10 @@ Note: module proxy_http must be enabled: |
| 210 | 226 | |
| 211 | 227 | * /etc/bind/db.colivre: |
| 212 | 228 | |
| 213 | -_xmpp-client._tcp SRV 5 100 5222 master | |
| 229 | +_xmpp-client._tcp SRV 5 100 5222 master | |
| 214 | 230 | (...) |
| 215 | -conference CNAME master | |
| 216 | -_xmpp-client._tcp.conference SRV 5 100 5222 master | |
| 231 | +conference CNAME master | |
| 232 | +_xmpp-client._tcp.conference SRV 5 100 5222 master | |
| 217 | 233 | |
| 218 | 234 | |
| 219 | 235 | 9. Testing this Setup |
| ... | ... | @@ -237,4 +253,3 @@ To measure the bandwidth between server and client: |
| 237 | 253 | For heavy load tests, clone and use this software: |
| 238 | 254 | |
| 239 | 255 | git clone http://git.holoscopio.com/git/metal/tester.git |
| 240 | - | ... | ... |
util/chat/postgresql/ejabberd.sql
| ... | ... | @@ -36,12 +36,6 @@ CREATE VIEW users AS |
| 36 | 36 | WHERE |
| 37 | 37 | e.is_default; |
| 38 | 38 | |
| 39 | -CREATE TABLE last ( | |
| 40 | - username text PRIMARY KEY, | |
| 41 | - seconds text NOT NULL, | |
| 42 | - state text NOT NULL | |
| 43 | -); | |
| 44 | - | |
| 45 | 39 | CREATE VIEW rosterusers AS |
| 46 | 40 | select |
| 47 | 41 | p1.identifier AS username, -- text NOT NULL, | ... | ... |