An XMPP server provides messaging, presence, and XML routing features in one package. This guide will demonstrate how to setup an XMPP server on SkySilk Linux VPS.
How to: Setup Openfire / Jabber XMPP Server
We will be downloading, installing, and configuring our Openfire XMPP server. After we're done, you will have a functional XMPP messaging server.
Start by logging onto you VPS via SSH. You may follow this guide to help you SSH into your SkySilk VPS
Install dependencies and updates
First we want to make sure that your system has updated components installed as well as other dependencies:
yum update yum install -y wget yum install -y epel-release yum install -y glibc.i686 yum install -y zlib.i686 libstdc++.i686
Download and install the Openfire rpm
We'll be installing wget, then downloading the official Openfire rpm:
wget "https://www.igniterealtime.org/downloadServlet?filename=openfire/openfire-4.3.2-1.i686.rpm" -O openfire-4.3.2-1.i686.rpm
Install the rpm:
yum install -y openfire-4.3.2-1.i686.rpm
Start the openfire service
systemctl start openfire.service
Install and configure a PostgreSQL
We'll be installing PostgreSQL:
yum install postgresql-server postgresql-contrib
Enable the service to start on boot:
systemctl enable postgresql.service
Initialize the PostgreSQL Database:
postgresql-setup initdb
Start the postgresql service:
systemctl start postgresql.service
Create a database for Openfire and configure the user
Switch to postgres user context:
su - postgres
Set password for postgres database user. This is used to administer postgresql:
psql \password postgres \quit
Create database "openfire":
createdb openfire
Create database user "openfire":
createuser -P openfire
Next we'll modify the postgresql configuration to require the client to supply an MD5-encrypted password for authentication.
Open the /var/lib/pgsql/data/pg_hba.conf file in a text editor and under the METHOD column, change the peer or ident values to md5.
# TYPE DATABASE USER ADDRESS METHOD # "local" is for Unix domain socket connections only local all all md5 # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5 # Allow replication connections from localhost, by a user with the # replication privilege. #local replication postgres md5 #host replication postgres 127.0.0.1/32 md5 #host replication postgres ::1/128 md5
Exit postgres user context:
exit
Restart PostgreSQL service
systemctl restart postgresql.service
Open necessary ports
9090 and 9091 are the typical ports utilized by Openfire, we will open them up:
firewall-cmd --permanent --zone=public --add-port=9090/tcp firewall-cmd --permanent --zone=public --add-port=9091/tcp firewall-cmd --reload
You're now ready to continue the setup via the GUI.
Complete setup via the GUI
Browse to the setup GUI URL:
http://[IP_ADDRESS_OF_YOUR_SERVER]:9090
This is very straight forward. You'll walk through setting up the language, server settings, database settings, profile settings, and admin account.
The key points here are the Database configuration. Choose PostgreSQL as seen below and in the Database URL make sure to point to our local PostgreSQL installation and the openfire database we created. The username and password are for the openfire database user we created in an earlier step.
Once you are done with the wizard you'll see this and you're done. Login to your admin console