Skip to content

Instantly share code, notes, and snippets.

@dirkmoors
Last active June 22, 2016 19:29
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save dirkmoors/4acc602fedffe4768f39 to your computer and use it in GitHub Desktop.
Save dirkmoors/4acc602fedffe4768f39 to your computer and use it in GitHub Desktop.
ejabberd 13.12 Build from source + Ubuntu 14.04LTS installation
• Node 1, 2, … X
○ sudo su -l
○ cd
○ apt-get update
○ apt-get upgrade
○ apt-get install git-core
○ apt-get install libyaml-dev
○ apt-get install erlang
○ apt-get install unzip
○ apt-get build-dep ejabberd
○ apt-get install pkg-config
○ git clone https://github.com/processone/ejabberd.git (I've used commit #2723056fae)
○ cd ejabberd
○ ./configure
○ make
○ make install
○ nano /etc/ejabberd/ejabberd.yml
§ Go to "SERVED HOSTNAMES"
□ Add <HOSTNAME> under "hosts:"
§ Go to acl section and ensure:
acl:
admin:
user:
- "<USERNAME>": "<HOSTNAME>"
§ Save and close
○ ejabberdctl restart
○ ejabberdctl register <USERNAME> <HOSTNAME> <PASSWORD>
○ Go to http://<IP_OR_HOSTNAME>:5280/admin/
§ Log in with <USERNAME>@<HOSTNAME> and <PASSWORD>
○ Install / enable module(s):
§ ejabberdctl stop
§ git clone git://github.com/processone/ejabberd-contrib.git
§ Install mod_muc_admin
□ cd ejabberd-contrib/mod_muc_admin
□ ./build.sh
□ cd /lib/ejabberd/ebin/
□ ln -s ~/ejabberd-contrib/mod_muc_admin/ebin/mod_muc_admin.beam
□ nano /etc/ejabberd/ejabberd.yml
® Add "mod_muc_admin" to modules section:
mod_muc_admin: {}
® Save and close
□ cd ~
§ Install mod_admin_extra
□ cd mod_admin_extra
□ ./build.sh
□ cd /lib/ejabberd/ebin/
□ ln -s ~/ejabberd-contrib/mod_admin_extra/ebin/mod_admin_extra.beam
□ nano /etc/ejabberd/ejabberd.yml
® Add "mod_admin_extra" to modules section:
mod_admin_extra: {}
® Save and close
□ cd ~
§ Enable ejabberd_xmlrpc
□ nano /etc/ejabberd/ejabberd.yml
® Add (or uncomment) the following under "listen" section:
-
port: 4560
module: ejabberd_xmlrpc access_commands:
configure:
all: []
® Save and close
○ Edit access rules
§ nano /etc/ejabberd/ejabberd.yml
□ Under "access" add/modify the following:
muc_create:
admin: allow
register:
all: deny
admin: allow
□ Save and close
○ Create startup script:
See startup script below
#!/bin/bash
#
# /etc/init.d/ejabberd
#
# This is a custom ejabberd init script written
# for the Fedora Linux distribution, and is not
# included by the ejabberd RPM package(s).
#
# author: Sean O'Donnell
#
# chkconfig: - 99 10
# description: ejabberd XMPP server
# Source function library.
#./etc/init.d/functions
set -o errexit
start()
{
echo -n "Starting : "
/sbin/ejabberdctl start
return
}
status()
{
echo -n "Status : "
/sbin/ejabberdctl status
return
}
stop()
{
echo -n "Shutting down : "
/sbin/ejabberdctl stop
return
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
stop
start
;;
*)
echo "Usage: [start|stop|restart|status]"
exit 1
;;
esac
exit $?
@dirkmoors
Copy link
Author

If the startup script is created, run:

chmod 755 /etc/init.d/ejabberd
chown root:root /etc/init.d/ejabberd
update-rc.d ejabberd defaults
update-rc.d ejabberd enable

This will make ejabberd run automatically on server boot

@pyro2927
Copy link

Thanks for the startup script!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment