Skip to content

Installation

Andrey Gagarin edited this page Aug 6, 2019 · 25 revisions

Xabber server installation

Download lastest Xabber server installer:

wget https://www.xabber.com/xabberserver/releases/xabberserver_installer.bin

Make installer executable:

chmod +x xabberserver_installer.bin

Run installer from user:

./xabberserver_installer.bin

Or install Xabber server as a superuser:

sudo ./xabberserver_installer.bin

If Xabber server installation process was started without root permission, files are unpacked into user home directory.

Database installation

Xabber server uses PostgreSQL database. To install it, run the following commands:

sudo apt-get update

sudo apt-get install postgresql postgresql-contrib

Database preparation

Login as postgres user:

sudo -i -u postgres

Create user:

createuser -P xabber_server_user

Create database:

createdb xabber_server_db -O xabber_server_user

You will need this information later when configuring database connection.

Configuring WebServer for Xabber Server UI

To access Xabber Server UI on http://yourdomain.com you need to install some of webservers and configure it to work properly with Xabber Server UI.

Apache

Installing Apache

Install the Apache webserver and the necessary modules.

sudo apt update

sudo apt install apache2

Enable modules:

sudo a2enmod headers proxy proxy_http ssl proxy_wstunnel rewrite

Disable the placeholder site that comes with Apache:

sudo a2dissite 000-default.conf

Setting Apache

Create a file /etc/apache2/sites-available/001-site.conf with the following contents, replacing your.site.com with the DNS name of your site. This site will simply redirect all traffic from port 80 (HTTP) to port 443 (HTTPS).

<VirtualHost *:80>

ServerName your.site.com

Redirect / https://your.site.com/

</VirtualHost>

Create a file /etc/apache2/sites-available/001-site-ssl.conf with the following contents, replacing your.site.com with the DNS name of your site and /path/to/your/ssl-keys/ with the path to your SSL keys. This site will listen on port 443 (HTTPS), decrypt the connection, and pass on the HTTP requests to backend.

<VirtualHost *:443>

ServerName your.site.com

ProxyRequests Off

ProxyPreserveHost Off

SSLEngine On

# Proxy Websocket requests

RewriteEngine On

RewriteCond %{HTTP:Connection} Upgrade [NC]

RewriteCond %{HTTP:Upgrade} websocket [NC]

RewriteRule /(.*) ws://localhost:8000/ [P,L]

# Proxy HTTP requests

ProxyPass / http://localhost:8000/

ProxyPassReverse / http://localhost:8000/

SSLCertificateFile /path/to/your/ssl-keys/seeq-cert.pem

SSLCertificateKeyFile /path/to/your/ssl-keys/seeq-key.pem

</VirtualHost>

Enable both of the new sites:

sudo a2ensite 001-site.conf

sudo a2ensite 001-site-ssl.conf

sudo service apache2 restart

Configuring HTTPS

To enable all server's features - you need to ensure, that you have a valid ssl certificate. If you don't have it - you can obtain free Let's Encrypt certificate. Read the following manual to obtain it.

Step 1

Install certbot on you server. If you have fresh version of Ubuntu or Debian:

apt update

apt install certbot

For other system you can find installation tips on official website of Certbot:

https://certbot.eff.org/

Step 2

Now it's time to obtain certificate. If you don't have any webserver, running on your host machine, use standalone option to obtain certificate:

sudo certbot certonly --standalone

If you have a webserver and you don't want to stop it, use:

sudo certbot certonly --webroot

For more information https://certbot.eff.org/

Step 3

After you obtain your certificate - you need to copy certificate to installation directory. By default Xabber Server will be installed into /opt/xabberserver/xabberserver/.

You need to delete self-signed certificate.

rm /opt/xabberserver/xabberserver/certs/server.pem

After you need to create symlinks to Let's Encrypt certificate:

ln -s /etc/letsencrypt/live/yourdomain.com/* /opt/xabberserver/xabberserver/certs/

Ensure, what Xabber Server has access to certs. Change permissions for folders of letsencrypt:

find /etc/letsencrypt/ -type d -exec chmod 755 {} \;

Change permissions for *.pem files:

find /etc/letsencrypt/archive/ -type f -exec chmod 644 {} \;

Ensure, what your Xabber Server user can access files:

chown -R xabberserver:xabberserver /opt/xabberserver/xabberserver/certs/

Set up Xabber Server

Subsequent installation steps are done via a web console, located at http://yourdomain.com:8000 or http://your_server_ip:8000 address.

Step 1. Choose server domain

Domain is necessary to communicate with other XMPP servers. To make communication possible you'll need to have access to domain DNS settings.

Step 2. Create administrator account

You need an XMPP account to manage Xabber Server!

Step 3. Connect to database

Here you'll need that database you've configured above

Step 4. Configure DNS

Probably should be step 2, no?

Contents

Clone this wiki locally