You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

ejabberd 18.03配置问题:Strophe注册用户提示不支持带内注册

解决ejabberd 18.03 「The Server does not support In-Band Registration」注册错误

嘿,我来帮你搞定这个注册失败的问题,咱们一步步拆解排查:

1. 先确认mod_register模块真的启用了

从你贴的配置来看,只展示了mod_register的子配置,但得确保它在modules顶级列表里。正确的格式应该是这样的:

modules:
  mod_register:
    ## ## Protect In-Band account registrations with CAPTCHA.
    ## ## captcha_protected: true
    ## ## Set the minimum informational entropy for passwords.
    ## ## password_strength: 32
    ## ## After successful registration, the user receives
    ## a message with this subject and body.
    ## welcome_message:
      subject: "Welcome!"
      body: |-
        Hi. Welcome to this XMPP server.
    ## ## When a user registers, send a notification to
    ## these XMPP accounts.
    ## registration_watchers:
      - "admin1@example.org"
    ## ## Only clients in the server machine can register accounts
    ## ip_access: trusted_network
    ## ## Local c2s or remote s2s users cannot register accounts
    ## access_from: register
    access: register

如果之前你的modules里没写mod_register:这一行,赶紧加上,然后重启ejabberd。

2. 修复访问控制规则的语法问题

你贴的ACCESS RULES部分格式有点乱,ejabberd对YAML缩进和格式要求很严,得改成这样:

access_rules:
  local:
    - allow: local
  c2s:
    - deny: blocked
    - allow: all
  register:
    - allow: trusted_network
  trusted_network:
    - allow: all

注意要把顶级键写成小写的access_rules,每个规则下面的条目要正确缩进,不然ejabberd会读不懂你的规则。

3. 检查mod_register的访问限制配置

你的mod_register里设置了access: register,这意味着只有符合register规则的客户端能注册。现在你的register规则允许trusted_network,而trusted_network是允许所有IP的,这没问题。不过要确保你没打开注释掉的ip_access或access_from限制,目前你是注释掉的,这部分没问题。

4. 修正服务器域名的拼写错误

你的admin配置里写的是"admin@localhot",这里应该是"admin@localhost"吧?如果你的服务器主机名是localhost,这个拼写错误可能导致注册时域名不匹配,改过来准没错。

5. 最关键的点:BOSH连接地址错了!

看你的ejabberd_http配置:

request_handlers:
  "/ws": ejabberd_http_ws
  "/bosh": mod_bosh

你把BOSH服务挂载在了/bosh路径下,但你客户端用的是http://localhost:5280/http-bind!这完全不匹配啊!正确的BOSH地址应该是http://localhost:5280/bosh,赶紧把客户端的连接地址改过来,这大概率是导致报错的核心原因。

最后别忘了重启服务器

所有配置改完后,一定要重启ejabberd让新配置生效:

ejabberdctl restart

按照上面的步骤调整后,应该就能正常注册了。

内容的提问来源于stack exchange,提问作者Devid

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 09:48:05