In today’s age, the age of security, many organizations like to have control of their communications. Fortunately, it has an open, secure and reliable protocol like XMPP. Thanks to this, it is possible to deploy various communication solutions for businesses and organization, specifically messaging. Therefore, today I will teach you how to install Ejabberd on CentOS 7 so that you too can take advantage of this protocol.
In case you did not know, Ejabberd is a messaging server that uses the XMPP protocol. It is open source and has a community version that will save us money, ideal if our company is small. Its main objective is to be fast and scalable, so, that it can be used in almost any scenario.
So, let us start to install Ejabberd on CentOS 7.
1. Upgrade the system and install glibc
First, you need to update the system. You know, with this you will have installed the latest security patches and you will be able to enjoy a more stable and secure system.
:~$ su :~# yum update
Now, you have to install a required library. It is glibc
.
:~# yum install glibc
So, now you have the system updated and with glibc installed, you can continue with the installation.
2. Download and install Ejabberd
The next step is to download the Ejabberd binaries from the website. In this case, I will use the binary in. RPM format. At the time of writing this post, the latest stable version of Ejabberd is 18.12.1.
:~# yum install wget :~# wget https://www.process-one.net/downloads/downloads-action.php?file=/ejabberd/18.12.1/ejabberd-18.12.1-0.x86_64.rpm
After that, install the downloaded package using yum.
:~# mv downloads-action.php\?file\=%2Fejabberd%2F18.12.1%2Fejabberd-18.12.1-0.x86_64.rpm ejabberd.rpm :~# rpm -ivh ejabberd.rpm
Note the following, the ejabberd initialization script is located at /etc/init.d/
. In addition, the ejabberd
user will be created.
3. Starting the Ejabberd service
Now it is necessary to work with the Ejabberd service, to start it or restart it when it is convenient.
All you have to do is copy the ejabberd.service
file located in the /opt/ejabberd-18.12.1/bin/
folder to the /etc/systemd/system/
folder.
:~# cp /opt/ejabberd-18.12.1/bin/ejabberd.service /etc/systemd/system/
In order for the service to be recognized by systemd, it is necessary to refresh the services.
:~# systemctl daemon-reload
After that, enable and start the service. Finally, it is a good idea to check the status of the service.
:~# systemctl enable ejabberd :~# systemctl start ejabberd :~# systemctl status ejabberd
As you can see in the image above, everything is going well. It is now necessary to create an administrator account.
4. Create an administrator account and access from the web browser
To access the Ejabberd administration panel, it is necessary to create an administrator account. Let us go for it.
First, access the folder where the binary is.
:~# cd /opt/ejabberd-18.12.1/bin/
Then, use the following formula to create your user.
:~# ./ejabberdctl register user localhost your_password
Of course, replace user and your_password by yours. And localhost by your hostname.
After that, you have to edit one file to give administration rights to the new user.
:~# nano /opt/ejabberd/conf/ejabberd.yml
Then, restart the service to apply the changes.
:~# systemctl restart ejabberd
After that, set the right rules in the firewall for ejabberd. Remember, ejabberd uses the 5280 port.
:~# firewall-cmd --add-port=5280/tcp --permanent :~# firewall-cmd --reload
Finally, open your web browser and go to http://SERVER_IP:5280/admin
and log in. Remember the user is complete including the hostname. In my case is angelo@osradar.
So, that is it.
Conclusion
Ejabberd is a great alternative to deploy an XMPP server quickly and easily. That’s why Ejabberd is listed as one of the leading solutions in this segment. Its installation in CentOS 7 is quite simple and does not present too many drawbacks.
Share this post with your friends.
Congratulations, it was perfect.
I followed the steps and everything worked perfectly, thanks for your work 😉
it is perfect example ..but i am getting
Error: cannot_register
i am using ejabberd-21.04-0
same error here with 21.04