how to install openfire in centos 7

12
How To Install Openfire – CentOS 7 i | Page Table of Contents Overview ....................................................................................................................................................... 1 Applies To...................................................................................................................................................... 1 Pre-requisites ................................................................................................................................................ 1 Java – Download and Install Java / JRE ......................................................................................................... 1 Java - Extract Java Bundle ......................................................................................................................... 2 Java – Environment Variables ................................................................................................................... 2 Set FQDN – Host........................................................................................................................................ 3 Restart Daemon .................................................................................................................................... 3 Install MariaDB Server .................................................................................................................................. 3 Install MariaDB Server – Download .......................................................................................................... 4 Install MariaDB Server – Installation Status.............................................................................................. 4 Install MariaDB Server – Package Listing .................................................................................................. 5 Install MariaDB Server – Start Daemon .................................................................................................... 5 Install MariaDB Server – Enable Daemon ................................................................................................. 5 Install MariaDB Server – Status Daemon .................................................................................................. 6 Install MariaDB Server – Connect MySQL ................................................................................................. 6 Configuring – Hardening MySQL ........................................................................................................... 7 Openfire Server – Download......................................................................................................................... 7 Openfire Server – Install ........................................................................................................................... 8 Openfire – PAM Config ............................................................................................................................. 8 Openfire – Change Process User............................................................................................................... 9 Install Package – libstdc++.i686 ................................................................................................................ 9 Openfire – Start Daemon ........................................................................................................................ 10 Openfire Service – Service Status ........................................................................................................... 10 Troubleshooting .......................................................................................................................................... 11 Openfire Service Failed – Issue ............................................................................................................... 11 Openfire Service – Real-time Service Log ............................................................................................... 11

Upload: vcp-muthukrishna

Post on 14-Apr-2017

7.751 views

Category:

Technology


2 download

TRANSCRIPT

How To Install Openfire – CentOS 7

i | P a g e

Table of Contents Overview ....................................................................................................................................................... 1

Applies To ...................................................................................................................................................... 1

Pre-requisites ................................................................................................................................................ 1

Java – Download and Install Java / JRE ......................................................................................................... 1

Java - Extract Java Bundle ......................................................................................................................... 2

Java – Environment Variables ................................................................................................................... 2

Set FQDN – Host ........................................................................................................................................ 3

Restart Daemon .................................................................................................................................... 3

Install MariaDB Server .................................................................................................................................. 3

Install MariaDB Server – Download .......................................................................................................... 4

Install MariaDB Server – Installation Status.............................................................................................. 4

Install MariaDB Server – Package Listing .................................................................................................. 5

Install MariaDB Server – Start Daemon .................................................................................................... 5

Install MariaDB Server – Enable Daemon ................................................................................................. 5

Install MariaDB Server – Status Daemon .................................................................................................. 6

Install MariaDB Server – Connect MySQL ................................................................................................. 6

Configuring – Hardening MySQL ........................................................................................................... 7

Openfire Server – Download ......................................................................................................................... 7

Openfire Server – Install ........................................................................................................................... 8

Openfire – PAM Config ............................................................................................................................. 8

Openfire – Change Process User ............................................................................................................... 9

Install Package – libstdc++.i686 ................................................................................................................ 9

Openfire – Start Daemon ........................................................................................................................ 10

Openfire Service – Service Status ........................................................................................................... 10

Troubleshooting .......................................................................................................................................... 11

Openfire Service Failed – Issue ............................................................................................................... 11

Openfire Service – Real-time Service Log ............................................................................................... 11

How To Install Openfire – CentOS 7

1 | P a g e

Overview

Openfire is an open source instant messaging chat server that runs on XMPP, which is a server that

facilitates XML based communication, such as chatting services.

Applies To

CentOS 7, RHEL 7

Pre-requisites

MySQL / MariaDB Database for User Information

Java JRE Java Runtime for Openfire

AD Info Active Directory Integration for User Authentication

wget Download Packages from Internet

Hostname Set hostname of the chat server, ideally FQDN

FQDN Fully qualified Domain Name (DNS record)

Java – Download and Install Java / JRE

Download and extract Java Package.

cd /usr/src

wget --no-cookies --no-check-certificate --header "Cookie:

gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie"

"http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz"

How To Install Openfire – CentOS 7

2 | P a g e

Java - Extract Java Bundle

Extract the downloaded java bundle and move to “opt” folder, run the below commands.

tar -xzf jdk-7u79-linux-x64.tar.gz

mv /usr/src/jdk1.7.0_79 /opt/

Java – Environment Variables

Set the environment variables, such as JAVA_HOME and bin directory of Java executables. Save the file

and logout and log back into the server.

vi ~/.bash_profile

JAVA_HOME=/opt/jdk1.7.0_79

PATH=/usr/bin/:$JAVA_HOME/bin

EXPORT PATH JAVA_HOME

How To Install Openfire – CentOS 7

3 | P a g e

Set FQDN – Host

Set the hostname of the server run the below command.

hostnamectl set-hostname chatsrvr.effonetech.com

Restart Daemon

To update the changes of the hostname set, restart the “systemd-hostnamed” daemon, run the below

command and reboot the server to make the changes permanent.

systemctl restart systemd-hostnamed

reboot

Install MariaDB Server

First step that we need to perform is to install MariaDB Server, which is inline replacement for MySQL

Server. To start the installation of the mariadb-server.

yum install mariadb-server mariadb

How To Install Openfire – CentOS 7

4 | P a g e

Install MariaDB Server – Download

After package dependency is resolved, accept the package download and installation.

Install MariaDB Server – Installation Status

After the package is downloaded, installation will be completed.

How To Install Openfire – CentOS 7

5 | P a g e

Install MariaDB Server – Package Listing

Run the rpm query package list; run the below command.

rpm -qa | grep maria

Install MariaDB Server – Start Daemon

Start the “mariadb” server daemon, run the below command.

systemctl start mariadb

Install MariaDB Server – Enable Daemon

After installation the init script “mariadb” will be copied to the /etc/init.d/ folder. To enable in it in specific

run levels run the below command, default in runlevel 345 it will turn on when you enable the service.

systemctl enable mariadb

How To Install Openfire – CentOS 7

6 | P a g e

Install MariaDB Server – Status Daemon

Check the status “mariadb” server daemon, run the below command, if the daemon is running “Active:

active (running)”.

systemctl status mariadb

Install MariaDB Server – Connect MySQL

Login to the server, run the command “mysql” . You will be connected to the server.

mysql

How To Install Openfire – CentOS 7

7 | P a g e

Configuring – Hardening MySQL

Additionally, to harden (secure) mariadb-server, run the below command and follow the instructions

while configuring. Run the below command.

mysql_secure_installation

Openfire Server – Download

Download and Openfire (Instant Messaging server).

wget http://download.igniterealtime.org/openfire/openfire_3_10_2.tar.gz

How To Install Openfire – CentOS 7

8 | P a g e

Openfire Server – Install

Install the Openfire instant messaging service run the command.

rpm -ivh openfire-3.10.2-1.i386.rpm

Openfire – PAM Config

After installation is successful, configure PAM for “openfire”; we will replicate “system-auth” policy for

openfire service. Run the copy command as below.

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

How To Install Openfire – CentOS 7

9 | P a g e

Openfire – Change Process User

Edit the file “openfire” in the directory “/etc/sysconfig” and uncomment, update the attribute

“OPENFIRE_USER” from “daemon” to “root”; then save and exit the editor

vi /etc/sysconfig/openfire

OPENFIRE_USER="root"

Install Package – libstdc++.i686

Install “libstdc++.i686” package and its dependencies. To install run the command the below command

yum install libstdc++.i686

How To Install Openfire – CentOS 7

10 | P a g e

Openfire – Start Daemon

After installation is successful, start the “openfire” daemon; to start run the command

systemctl start openfire

Openfire Service – Service Status

After starting the service; to know the current status of the service run the below command.

system status openfire

How To Install Openfire – CentOS 7

11 | P a g e

Troubleshooting

Openfire Service Failed – Issue

If you have not installed package “libstdc++.i686” you will be thrown an error as below.

Openfire Service – Real-time Service Log

To view real-time log for a specific service “openfire” run the below command.

journalctl -u openfire -f -a -n 0