Introduction
In this guide, we’ll set up the Ejabberd XMPP server, configure LDAP authentication, and secure it with SSL certificates. We’ll reference our previous setups of Inspircd and LDAP for user authentication and SSL certificate generation.
Step 1: Install Ejabberd
Begin by installing the Ejabberd XMPP server:
sudo apt update
sudo apt install ejabberd
Step 2: Configure Ejabberd
Navigate to the Ejabberd configuration directory and edit the ejabberd.yml
configuration file:
cd /etc/ejabberd/
sudo nano ejabberd.yml
Update the configuration file with the following settings:
- hosts: Set the domain name for your Ejabberd server. If your domain is
domain.com
, it should be:
hosts:
- "domain.com"
- auth_method: Configure Ejabberd to use LDAP for authentication. Reference the LDAP server we set up previously:
auth_method: [ldap]
ldap_servers: ["localhost"]
ldap_port: 389
ldap_rootdn: "cn=admin,dc=domain,dc=com"
ldap_password: "p@$$word"
ldap_base: "dc=domain,dc=com"
- certfiles: Specify the path to the SSL certificate file generated for Ejabberd. If using Let’s Encrypt, concatenate the
privkey.pem
andfullchain.pem
files:
certfiles:
- "/etc/letsencrypt/live/domain/privkey.pem"
- "/etc/letsencrypt/live/domain/fullchain.pem"
Step 3: Restart Ejabberd
After making changes to the configuration, restart the Ejabberd service to apply the new settings:
sudo systemctl restart ejabberd.service
Step 4: Verify Ejabberd is Running
Check the status of the Ejabberd service and ensure the required ports are open:
sudo systemctl status ejabberd.service
sudo ss -nplt
Conclusion
You’ve successfully set up the Ejabberd XMPP server, configured LDAP authentication, and secured it with SSL certificates. Ejabberd provides a powerful and scalable platform for real-time communication within your organization. In the previous guides, we set up Inspircd for IRC communication and LDAP for centralized authentication, laying the foundation for a comprehensive communication infrastructure.
Stay tuned for more guides on enhancing your server setup and security!
For reference, here are the previous guides: