Skip to content

Instantly share code, notes, and snippets.

@dougalcorn
Created July 18, 2013 13:33
Show Gist options
  • Save dougalcorn/6029329 to your computer and use it in GitHub Desktop.
Save dougalcorn/6029329 to your computer and use it in GitHub Desktop.
Problems with registering my first user from the command line on ejabberd on ubuntu
{hosts, ["localhost", "semperubisububi.org"]}.
{access, max_user_sessions, [{10, all}]}.
{access, max_user_offline_messages, [{5000, admin}, {100, all}]}.
{access, local, [{allow, all}]}.
{access, c2s, [{deny, blocked},
{allow, all}]}.
{access, c2s_shaper, [{none, admin},
{normal, all}]}.
{access, s2s_shaper, [{fast, all}]}.
{access, announce, [{allow, admin}]}.
{access, configure, [{allow, admin}]}.
{access, muc_admin, [{allow, admin}]}.
{access, muc, [{allow, all}]}.
{access, register, [{allow, all}]}.
{access, pubsub_createnode, [{allow, all}]}.
{acl, local, {user_regexp, ""}}.
{auth_method, internal}.
{loglevel, 5}.
{listen,
[
{5222, ejabberd_c2s, [
{access, c2s},
{shaper, c2s_shaper},
{max_stanza_size, 65536},
%%zlib,
starttls, {certfile, "/etc/ejabberd/ejabberd.pem"}
]},
{5269, ejabberd_s2s_in, [
{shaper, s2s_shaper},
{max_stanza_size, 131072}
]},
{5280, ejabberd_http, [
%%{request_handlers,
%% [
%% {["pub", "archive"], mod_http_fileserver}
%% ]},
%%captcha,
http_bind,
http_poll,
web_admin
]}
]}.
{max_fsm_queue, 1000}.
{s2s_use_starttls, true}.
{s2s_certfile, "/etc/ejabberd/ejabberd.pem"}.
{shaper, normal, {maxrate, 1000}}.
{shaper, fast, {maxrate, 50000}}.
{language, "en"}.
{modules,
[
{mod_adhoc, []},
{mod_announce, [{access, announce}]}, % requires mod_adhoc
{mod_caps, []},
{mod_configure,[]}, % requires mod_adhoc
{mod_admin_extra, []},
{mod_disco, []},
%%{mod_echo, [{host, "echo.localhost"}]},
{mod_irc, []},
{mod_last, []},
{mod_muc, [
{access, muc},
{access_create, muc},
{access_persistent, muc},
{access_admin, muc_admin},
{max_users, 500}
]},
%%{mod_muc_log,[]},
{mod_offline, [{access_max_user_messages, max_user_offline_messages}]},
{mod_privacy, []},
{mod_private, []},
{mod_proxy65, [
{access, local},
{shaper, c2s_shaper}
]},
{mod_pubsub, [ % requires mod_caps
{access_createnode, pubsub_createnode},
{pep_sendlast_offline, false},
{last_item_cache, false},
%%{plugins, ["default", "pep"]}
{plugins, ["flat", "hometree", "pep"]} % pep requires mod_caps
]},
{mod_register, [
{welcome_message, {"Welcome!",
"Welcome to a Jabber service powered by Debian. "
"For information about Jabber visit "
"http://www.jabber.org"}},
{access, register}
]},
{mod_roster, []},
%%{mod_service_log,[]},
%%{mod_shared_roster,[]},
{mod_stats, []},
{mod_time, []},
{mod_vcard, []},
{mod_version, []}
]}.

I'm setting up an ejabberd server on an Ubuntu LTS 12.04. The community help wiki says I just need to:

  1. Install the package
  2. Edit the hosts configuration in ejabberd.cfg
  3. Update the admin user's definition
  4. Restart the server
  5. Register the admin user from the command line

It's that last step that doesn't work. Here's what I get:

$ sudo ejabberdctl register ejabberd semperubisubsubi.org <password>
Can't register user [email protected] at node '[email protected]': not_allowed

There are a bunch of Google hits for "ejabber register not_allowed". I've spent about four or five hours reading them all. I still can't figure this out. I could really use some help.

I know most of the posts talk about making sure you have agreement between your hostname, your hosts definition, and your node name. The Ubuntu init scripts are setup to use /etc/defaults/ejabberd to override some of the settings via environment variables. The only thing I have in there is this line:

[email protected]

Which corresponds to my hostname:

$ hostname
semperubisububi.org
$ hostname -f
localhost
$ hostname -s
semperubisububi

I think that hostname -f is due to adding my FQDN to my /etc/hosts:

127.0.0.1  localhost susu semperubisububi.org

Oh, I also found a post that says there's a tight bind between the hostname of your machine and the ejabberd configuration. I think while I was wrestling with this setup, I got that mucked up. The post said to rm /var/lib/ejabberd/* and restart. I wasn't actually able to get the server running properly until I did that. I know the server is running properly:

 sudo ejabberdctl status
The node '[email protected]' is started with status: started
ejabberd 2.1.10 is running in that node

And I can see the processes running:

$ ps -ef | grep eja[b]
ejabberd  1152     1  0 13:19 ?        00:00:00 /usr/lib/erlang/erts-5.8.5/bin/beam -K false -P 250000 -- -root /usr/lib/erlang -progname erl -- -home /var/lib/ejabberd -- -name [email protected] -pa /usr/lib/ejabberd/ebin -s ejabberd -kernel inetrc "/etc/ejabberd/inetrc" -ejabberd config "/etc/ejabberd/ejabberd.cfg" log_path "/var/log/ejabberd/ejaberd.log" erlang_log_path "/var/log/ejabberd/erlang.log" -sasl sasl_error_logger false -mnesia dir "/var/lib/ejabberd" -smp disable -noshell -noshell -noinput
ejabberd  1165  1152  0 13:19 ?        00:00:00 inet_gethost 4
ejabberd  1166  1165  0 13:19 ?        00:00:00 inet_gethost 4
ejabberd 30056     1  0 02:43 ?        00:00:00 /usr/lib/erlang/erts-5.8.5/bin/epmd -daemon
@greendancingmonkey
Copy link

greendancingmonkey commented Mar 20, 2018

Got it....I'm running ejabberd on a Rasberry Pi 3 with a FreedomBox software install - https://wiki.debian.org/FreedomBox - and the admin for ejabberd must be setup by FreedomBox to be the FreedomBox admin, domain and password. To make sure I was using the right domain I ran the following command in the commandlline:

hostname -s

my login is:
Username: [FreedoBox admin name]@[domain]
Password: [FreedomBox admin password]

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