Install and configure Ejabberd on Ubuntu

Source: Internet
Author: User

1. Installation

Execution apt-get Install Ejabberd , You can also log in to the official website https://www.process-one.net download package installation.


2. Start-Stop service

Ejabberdctl Restart/stop/start/stop/status

Note: sometimes use ejabberdctl Start On startup there will be " Failed RPC connectionto the node [email protected]: Nodedown "Errors such as this can be /etc/init.d/ejabberd Start start.


3. Create a user

3.1 registering a user with a command

For example , to register the user "user1" on localhost, the password is "123456":

Ejabberdctl Register User1localhost 123456

3.2 Modifying a configuration file

Edit File /etc/ejabberd/ejabberd.cfg , in

Percent Admin User

{ACL, Admin,{user, "", "LocalHost"}}.

after (about $ row) to add

{ACL, admin, {user, ' user1 ', ' localhost '}}.

{Access, configure, [{Allow, admin}]}.

3.3 Restart

Ejabberdctl restart

3.4 Access Management interface

use the browser to access http://192.168.10.142:5280/admin, the user name is [email protected], the password is 123456. The post-login interface looks like this:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/47/wKiom1XKMPmTirfAAAIP9XGhOG4546.jpg "title=" ej.png "alt=" Wkiom1xkmpmtirfaaaip9xghog4546.jpg "/>

4 connecting MySQL

4.1 in the MySQL create databases and users in

Create DATABASE ejabberd default character set UTF8 collate utf8_general_ci;

Grantall privileges on ejabberd.* to [email protected] ' localhost ' identified by ' ej123456 ';

4.2 Initializing the database

The Ejabberd installed via Apt-get does not have a database initialization script, and if installed manually, the MySQL script is located in ejabberd/lib/ejabberd/ Priv/sql/mysql.sql. You can also download the script directly from Https://github.com/processone/ejabberd/blob/master/sql/mysql.sql.

Import the data with the following command

Mysql-u Ej_user-p Ejabberd < Mysql.sql

This error may occur at this time:

ERROR 1214 (HY000) at line 99:the usedtable type doesn ' t support fulltext indexes

since MySQL 5.5 does not support full-text indexing, changing the table's storage engine to MyISAM resolves the problem.

4.3 Modifying a configuration file

Modify a file /etc/ejabberd/ejabberd.cfg

Notes {auth_method,internal}.

Cancel Comment {AUTH_METHOD,ODBC}.

Uncomment and modify database connection information {odbc_server, {mysql, "server", "Database", "username", "Password"}}.

Modify the module, starting at approximately 579 lines and adding _ODBC after the original module , such as:

{MOD_LAST_ODBC,

{MOD_OFFLINE_ODBC,

{MOD_PRIVACY_ODBC,

{MOD_PRIVATE_ODBC,

{MOD_PUBSUB_ODBC,

{MOD_ROSTER_ODBC,

{MOD_VCARD_ODBC,

4.4 compiling Mysql Module

Ejabberd default does not have MySQL module, need to compile manually, otherwise the following error will appear on startup:

=error report==== 2015-08-11 23:55:24 = = =

C (<0.684.0>:ejabberd_check:63): Ejabberd is configured for use of ' MySQL ', but the following Erlang modules was not ins talled: ' [MySQL,


Mysql_auth,

Mysql_conn,

MYSQL_RECV] '

=info report==== 2015-08-11 23:55:24 = = =

Application:ejabberd

Exited: {bad_return,{{ejabberd_app,start,[normal,[]]},

{' EXIT ', Database_module_missing}}}

Type:temporary

Download the module from https://svn.process-one.net/ejabberd-modules/mysql/trunk/ source code, using the command ERLC *.erl Compile the module in SRC and get mysql_auth.beam,mysql.beam,mysql_conn.beam,mysql_ Recv.beam four files, put them into the/usr/lib/ejabberd/ebin/ , will be able to start the ejabberd normally.

4.5 Add User

Use the following command to add a user

Ejabberdctl Register Rootlocalhost 123456

Access by Browser Http://192.168.10.142:5280/admin , the user name is [email protected] , the password is 123456 .


This article is from the "Guanglin 51CTO blog" blog, be sure to keep this source http://guanglin.blog.51cto.com/3038587/1683846

Install and configure Ejabberd on Ubuntu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.