Install Openfire 4.2.3 in CentOS 7

share on:
install openfire on Centos 7

Openfire is a cross-platform instant messaging server written in java. It is easy to install and setup. It is available as a free download by Ignite Realtime website.

You can also use their client software Spark to connect with your Openfire serverAnother client that you can use to connect to your Openfire server is Pidgin.

Openfire requires Java Runtime environment to run. If you want to install Openfire on RPM-based systems then you don’t need to install Java as the Openfire installer for their distribution already includes a JRE.

You will need to install Java on your Debian-based system before running Openfire server.

In this guide, we will install Openfire on CentOS 7. We will also install some plugins and set Java memory limit for our server. 🙂

About this guide:

 

Install Openfire on CentOS 7.

Set the Hostname for your server. I am using chat.engytech.in

shell> hostnamectl set-hostname chat.engytech.in

 

Restart systemd-hostnamed service.

shell> systemctl restart systemd-hostnamed

 

Edit /etc/hosts file and add the following line in the file.

shell> vi /etc/hosts
127.0.0.1 chat.engytech.in

 

Update your server.

shell> yum update.

 

Download and Install Openfire 4.2.3 server.

Download the latest version of Openfire 4.2.3 on CentOS 7.

shell> wget http://download.igniterealtime.org/openfire/openfire-4.2.3-1.x86_64.rpm

 

Install Important libraries required by Openfire.

shell> yum install -y glibc.i686

 

Install OpenFire on CentOS 7.

shell> yum install openfire-4.2.3-1.x86_64.rpm -y

 

Authentication policy for Openfire.

Configure PAM Authentication policy for OpenFire. we will replicate “system-auth” policy for Openfire service.

shell> cp -Rp /etc/pam.d/system-auth /etc/pam.d/openfire

 

Set Root as Process User for OpenFire.

shell> vi /etc/sysconfig/openfire
# OPENFIRE_USER="daemon"
OPENFIRE_USER="root"

 

Also, configure logging for OpenFire. By default OpenFire logs everything in /opt/openfire/logs directory.

OPENFIRE_LOGDIR="/var/log/openfire/logs"

 

Make log directory if not already present on server.

shell> mkdir -p /var/log/openfire/logs

 

To view Real time logging of OpenFire service, use the following command.

shell> journalctl -u openfire -f -a -n 0

 

Enable Openfire Service at Reboot.

shell> systemctl enable openfire

 

Start OpenFire Service.

shell> systemctl start openfire

 

Check the status of OpenFire service.

shell> systemctl status openfire

 

Check the Ports used by OpenFire.

[[email protected] ~]# netstat -tulpn
Active Internet connections (only servers)
Proto  Recv-Q Send-Q Local Address Foreign Address  State        PID/Program name 
tcp       0           0           0.0.0.0:22        0.0.0.0:*               LISTEN   21826/sshd 
tcp       0           0           127.0.0.1:25    0.0.0.0:*               LISTEN   1075/master 
tcp6     0           0           :::22                 :::*                        LISTEN   21826/sshd 
tcp6     0           0           ::1:25               :::*                        LISTEN   1075/master 
tcp6     0           0           :::9090             :::*                        LISTEN   10686/java

 

Setup database and user for Openfire.

Install Latest MariaDB 10.3.10

We will install Latest MariaDB server by creating a repo file in /etc/yum.repos.d directory. Then enable that repo. for MariaDB.

shell> cat <<EOF>> /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF

 

Update your server.

shell> yum update.

 

Install Latest MariaDB 10.3.10.

shell> yum -y install MariaDB-server MariaDB-client

 

Check the MariaDB server version.

shell> mysql -V
mysql  Ver 15.1 Distrib 10.3.10-MariaDB, for Linux (x86_64) using readline 5.1

 

Start the MariaDB server.

shell> systemctl enable mariadb

 

Enable the MariaDB server at Reboot.

shell> systemctl start mariadb

 

Check the status of MariaDB server.

shell> systemctl status mariadb

 

Secure the MariaDB server.

shell> mysql_secure_installation

 

Create a User and Database for OpenFire server.

shell> mysql -uroot -p

MariaDB [(none)]> create database fired;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on fired.* to [email protected] identified by 'cool_fired';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> quit
Bye

 

Now we have created a database and user for our Openfire server. We can now start configuring Openfire server by visiting the Installation page of Openfire.

Login to your Openfire XMPP server.

http://server-ip-address:9090/login.jsp

 

 

Setup Openfire server

Select a Language to use with your OpenFire XMPP server.

 

Openfire server will detect your system hostname. Enter the Domain name you want to use with your Openfire server. Select Property Encryption via AES.

 

Select the database Type. Select Standard Database connection if you want to use an external database for openfire.

If you want to use inbuilt/Embedded database of Openfire server then select the Embedded Database option.

 

If you want to use an external database, which we are in this tutorial, then select MySQL option in Database Driver Presets.

Now Edit Database URL field.

By default the value will be:

jdbc:mysql://[host-name]:3306/[database-name]?rewriteBatchedStatements=true

 

Our database-name is fired and host-name will be 127.0.0.1.

The end result will be something like this.

jdbc:mysql://127.0.0.1:3306/fired?rewriteBatchedStatements=true

 

Next, The Username will be the user/owner of the database, which is cool in our example :).

Next, Enter the Password of user cool. In this example it is cool_fired.

Also you can select the Minimum Connections, Maximum Connections, Connection Timeout according to the server resources and capacity.

 

Choose Default in your Profile settings.

 

Finally, enter your Admin email address and a new strong Openfire admin Password to finish the setup.

 

Click on Login to the Openfire admin console to Access your Login console.

Finally, Enter your Username which is admin by default and the Openfire admin password to login to your Openfire XMPP server.

 

 

Install Opnefire 4.2.3 on centos 7
Opnefire 4.2.3

 

Install plugins in Openfire.

Also You can install plugins like Zapcat in Openfire XMPP server.

  • First Download Zapcat plugin for Openfire from Sourceforge.
  • Extract the Zapcat plugin from the zip file.
  • File with name zapcat-openfire-x.x.jar is the important one.

 

Go to the Administration console of you Openfire server. Also Click on the “Plugins” tab > Choose File > Select the file and then click Upload Plugin.

 

Once installed you can see the new plugin in the Plugins list.

 

 

Increase Java memory in Openfire.

Edit /etc/sysconfig/openfire file and add these lines at the end of the file.

shell> vi /etc/sysconfig/openfire
.....
.....
# Increase Java memory in Openfire server.
OPENFIRE_OPTS="-Xms256m -Xmx2048m"

 

Now we have a working Openfire XMPP server. Thanks for visiting this page. Good day. 🙂

 

 

 

share on:
engy

engy

Hello there, My name is Rishi Guleria and I work as a Linux system administrator. I have created this blog to share what I have learned so far and to learn new things. Good Day. :)

2 Comments

Leave a Response

share on: