我正在尝试在 Ubuntu 12(Linode 最新版本)上使用 Ejabberd 设置 Strope,使用内部 Ejabberd 网络服务器来提供聊天服务。
测试网址( http-bind 和 admin )都有效。
JWChat 可以工作。
Strope 抛出错误:
In Strophe:
RECV: <body xmlns='http://jabber.org/protocol/httpbind' type='terminate' condition='internal-server-error'>BOSH module not started</body>
In ejabberd.log:
E(<0.468.0>:ejabberd_http_bind:1236) :
You are trying to use BOSH (HTTP Bind) in host "admin", but the module mod_http_bind is not started in that host.
Configure your BOSH client to connect to the correct host, or add your desired host`
设置很简单(尽管花了很长时间才解决这个问题):
- 使用 sudo apt-get 安装
- 在 sudo 下运行
- 使用内部服务器,以避免干扰代理或设置 PunJab。
- 在 ejabberd.cfg 中进行了更改。
对 ejabberd.cfg 的更改:
%% In listening ports, amended the following lines:
{ request_handlers, [
{["pub"], mod_http_fileserver},
{["http-bind"], mod_http_bind}
]},
%% In modules, added the following:
{ mod_http_fileserver, [
{docroot, "/var/lib/ejabberd/www"},
{accesslog, "/var/log/ejabberd/access.log"}
]},
{mod_http_bind, []},
任何帮助将不胜感激。
最佳答案
答案相当明显。
Strope 需要以下格式的用户名:
username@host
eg. admin@example.com
否则它会假设用户名确实是主机,并且由于这样的主机不存在,因此它会抛出mod_http_bind未在该主机中启动的错误
此错误充其量只是一种误导,但它确实从技术上解释了问题。
我试图仅使用用户名登录[在 JWChat 中工作正常],因此出现了问题。
如果这不起作用,请检查其他一些要验证的事项的 list :
确保您的域已添加到/etc/hosts
127.0.0.1 localhost.localdomain localhost 12.34.56.78 squire.example.com squire
确保您的域已添加到/etc/ejabberd/ejabberd.cfg
%% Hostname Hostname {hosts, ["example.com","98.765.43.21","localhost"]}.
确保您的用户名存在并已注册:
ejabberdctl register username example.com password
如果用户是管理员,则包含在 ejabberd.cfg 中 [注意:它也必须注册!]
%% Admin user {acl, admin, {user, "", "localhost"}}. {acl, admin, {user, "admin", "example.com"}}.
检查服务器是否正在运行:
a. sudo ejabberdctl status b. http://example.com:5280/admin c. http://example.com:5280/http-bind
如果出现问题,请重新使用两者(我知道理论上您不需要两者。在实践中,有时使用其中之一无法正常工作。)
sudo /etc/init.d/ejabberd restart sudo ejabberdctl restart
检查日志 -/var/log/ejabberd/ejabberd.log ( see here )。
安装 JWChat 并尝试(或者,如果您有 JWChat,请安装 Strope)。
以下简短教程非常宝贵,请严格遵循:http://www.ejabberd.im/jwchat-localserver
关于xmpp - BOSH模块未启动: Ejabberd/Strophe setup issue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15101140/