【问题标题】:BOSH module not started: Ejabberd / Strophe setup issue [closed]BOSH 模块未启动:Ejabberd / Strophe 设置问题 [关闭]
【发布时间】:2013-02-12 14:43:42
【问题描述】:

我正在尝试使用内部 Ejabberd 网络服务器在 Ubuntu 12(Linode 最新版本)上使用 Ejabberd 设置 Strophe,以提供聊天服务。

测试网址(http-bindadmin)都有效。
JWChat 有效。
Strophe 报错:

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`

设置很简单(虽然花了很长时间才解决这个问题):

  1. 使用 sudo apt-get 安装
  2. 在 sudo 下运行
  3. 使用内部服务器,以避免弄乱代理或设置 PunJab。
  4. 在 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,  []},

任何帮助将不胜感激。

【问题讨论】:

    标签: xmpp ejabberd strophe


    【解决方案1】:

    答案很明显。

    Strophe 需要以下格式的用户名:

    用户名@主机
    例如。 admin@example.com

    否则它会假设用户名确实是主机,并且由于这样的主机不存在,它会抛出一个错误mod_http_bind is not started in that host

    这个错误充其量是误导,但它确实从技术上解释了这个问题。
    我试图只使用用户名 [在 JWChat 中运行良好] 登录,因此出现了问题。

    如果这不起作用,请列出需要验证的其他一些事项的清单:

    1. 确保您的域已添加到 /etc/hosts

      127.0.0.1    localhost.localdomain   localhost
      12.34.56.78  squire.example.com  squire
      
    2. 确保您的域已添加到 /etc/ejabberd/ejabberd.cfg

      %% Hostname
      Hostname {hosts, ["example.com","98.765.43.21","localhost"]}.
      
    3. 确保您的用户名存在且已注册:

      ejabberdctl register username example.com password
      

      如果用户是管理员,则包含在 ejabberd.cfg [注意:它必须注册!]

      %% Admin user
      {acl, admin, {user, "", "localhost"}}.
      {acl, admin, {user, "admin", "example.com"}}.
      
    4. 检查服务器是否正在运行:

      a. sudo ejabberdctl status  
      b. http://example.com:5280/admin  
      c. http://example.com:5280/http-bind
      
    5. 如果有问题,请重新使用两者(我知道理论上你不需要两者。实际上,有时使用其中一个或另一个将无法正常工作。)

      sudo /etc/init.d/ejabberd restart
      sudo ejabberdctl restart
      
    6. 检查日志 - /var/log/ejabberd/ejabberd.log (see here)。

    7. 安装 JWChat 并尝试(或者,如果您有 JWChat,请安装 Strophe)。
      以下简短教程非常宝贵,请严格按照:http://www.ejabberd.im/jwchat-localserver

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-08-15
      • 1970-01-01
      • 2011-02-06
      • 2011-10-24
      • 2015-11-28
      • 1970-01-01
      • 2019-12-26
      相关资源
      最近更新 更多