Automatic XMPP/Chat Setup
=========================
Since Noosfero 1.2, the XMPP/Chat can be installed via `noosfero-chat` Debian
package. So you don't need to follow the manual instructions here if you
already have it installed on your system.
But if you are going to install the `noosfero-chat` package on a system that
already has `noosfero` older 1.2 installed then you need to check if apache's
configuration file `/etc/apache2/sites-available/noosfero` has this line below:
Include /usr/share/noosfero/util/chat/apache/xmpp.conf
Manual XMPP/Chat Setup
======================
The samples of config file to configure a XMPP/BOSH server with ejabberd,
postgresql and apache2 can be found at util/chat directory.
This setup supposes that you are using Noosfero installed via Debian package
in a production environment.
Steps
-----
This is a step-by-step guide to get a XMPP service working, in a Debian system.
## 1. Install the required packages
# apt-get install ejabberd odbc-postgresql librestclient-ruby pidgin-data ruby1.8-dev
# gem install SystemTimer
## 2. Ejabberd configuration
# cp /usr/share/noosfero/util/chat/ejabberd.cfg /etc/ejabberd/
Edit the /etc/ejabberd/ejabberd.cfg file and set your domain on the first 2 lines.
## 3. Configuring Postgresql
Give permission to noosfero user create new roles, login as
postgres user and execute:
$ psql
postgres=# GRANT CREATE ON DATABASE noosfero TO noosfero;
Change the postgresql authentication method to md5 instead of ident,
add the following line to the file /etc/postgresql/8.4/main/pg_hba.conf:
# Noosfero user
local noosfero noosfero md5
(add this line before the following line)
# "local" is for Unix domain socket connections only
local all all ident
Restart postgresql server:
# service postgresql restart
Login as noosfero user, and execute:
$ psql -U noosfero -W noosfero < /usr/share/noosfero/util/chat/postgresql/ejabberd.sql
(see database password in the /etc/noosfero/database.yml file)
This will create a new schema inside the noosfero database, called `ejabberd`.
Note that there should be at least one domain with `is_default = true` in
`domains` table, otherwise people won't be able to see their friends online.
## 4. ODBC configuration
Create the following files:
# cp /usr/share/noosfero/util/chat/odbc.ini /etc/
# cp /usr/share/noosfero/util/chat/odbcinst.ini /etc/
Edit the odbc.ini file and set the password for the database user, see
the file /etc/noosfero/database.yml to get the password.
Adjust premissions:
# chmod 640 /etc/odbc.ini
# chown ejabberd /etc/odbc.ini
## 4.1 testing all:
# isql 'PostgreSQLEjabberdNoosfero'
If the configuration was done right, the message "Connected!" will be displayed.
## 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/