ejabberd 虚拟主机设置问题

ejabberd 虚拟主机设置问题

我正在尝试在 ejabberd 中设置虚拟主机,但无论我如何尝试,它都会给出以下错误

/usr/local/etc/ejabberd/ejabberdctl.cfg: 
line 187: host_config:: command not found /usr/local/etc/ejabberd/ejabberdctl.cfg: 
line 188: test.lan: command not found /usr/local/etc/ejabberd/ejabberdctl.cfg: 
line 189: auth_method:: command not found Failed RPC connection to the node ejabberd@localhost: nodedown

或者什么都没有(不会将虚拟主机添加到管理员的虚拟主机页面上的列表中)

我在 centos 7 上从 github 编译了源代码

我遵循了 ejabberd 配置指南,我甚至计算了空格来检查,但我不知道如何继续,所以任何帮助都将不胜感激

以下是我的 ejabberd.yml 的内容,我想将其作为文件附加,但似乎没有任何方法可以这样做

hosts:
  - "test.lan"

loglevel: 5 log_rotate_size: 10485760 log_rotate_date: "" log_rotate_count: 1 log_rate_limit: 100

certfiles:
  - "/etc/letsencrypt/live/localhost/fullchain.pem"
  - "/etc/letsencrypt/live/localhost/privkey.pem"

define_macro:   # TLS options for client not being able to use modern ciphers (Windows XP+, Android 3.0+)   CIPHERS_INTERMEDIATE: "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS" PROTOCOL_OPTIONS_INTERMEDIATE:
    - "no_sslv2"
    - "no_sslv3"

  # TLS options for client able to use modern ciphers (Windows 7+, Android 5.0+)   CIPHERS_MODERN: "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256" PROTOCOL_OPTIONS_MODERN:
    - "no_sslv2"
    - "no_sslv3"
    - "no_tlsv1"
    - "no_tlsv1_1"

c2s_ciphers: CIPHERS_INTERMEDIATE c2s_protocol_options: PROTOCOL_OPTIONS_INTERMEDIATE

listen:
  -
    port: 5222
    ip: "::"
    module: ejabberd_c2s
    max_stanza_size: 262144
    shaper: c2s_shaper
    access: c2s
    starttls_required: true
  -
    port: 5269
    ip: "::"
    module: ejabberd_s2s_in
    max_stanza_size: 524288
  -
    port: 5443
    ip: "::"
    module: ejabberd_http
    request_handlers:
      "/api": mod_http_api
      "/bosh": mod_bosh
      "/upload": mod_http_upload
      "/ws": ejabberd_http_ws
    web_admin: true
    captcha: true
    ciphers: CIPHERS_INTERMEDIATE
    protocol_options: PROTOCOL_OPTIONS_INTERMEDIATE
    tls: true
  -
    port: 5280
    ip: "::"
    module: ejabberd_http
    web_admin: true

s2s_use_starttls: optional

acl:   local:
    user_regexp: ""   loopback:
    ip:
      - "127.0.0.0/8"
      - "::1/128"   admin:
    user:
      - "james": "test.lan" access_rules:   local:
    - allow: all   c2s:
    - deny: blocked
    - allow   announce:
    - allow: admin   configure:
    - allow: admin   muc_create:
    - allow: local   pubsub_createnode:
    - allow: local   register:
    - allow   trusted_network:
    - allow: loopback

api_permissions:   "console commands":
    from:
      - ejabberd_ctl
    who: all
    what: "*"   "admin access":
    who:
      - access:
          - allow:
            - acl: loopback
            - acl: admin
      - oauth:
        - scope: "ejabberd:admin"
        - access:
          - allow:
            - acl: loopback
            - acl: admin
    what:
      - "*"
      - "!stop"
      - "!start"   "public commands":
    who:
      - ip: "127.0.0.1/8"
    what:
      - "status"
      - "connected_users_number"

shaper:   normal: 1000   fast: 50000

shaper_rules:   max_user_sessions: 10   max_user_offline_messages:
    - 5000: admin
    - 100   c2s_shaper:
    - none: admin
    - normal   s2s_shaper: fast

modules:   mod_adhoc: {}   mod_admin_extra: {}   mod_announce:
    access: announce   mod_avatar: {}   mod_blocking: {}   mod_bosh: {}   mod_caps: {}   mod_carboncopy: {}   mod_client_state: {}   mod_configure: {}   mod_disco: {}   mod_fail2ban: {}   mod_http_api: {}   mod_http_upload:
    put_url: "https://@HOST@:5443/upload"   mod_last: {}   mod_mam:
    ## Mnesia is limited to 2GB, better to use an SQL backend
    ## For small servers SQLite is a good fit and is very easy
    ## to configure. Uncomment this when you have SQL configured:
    ## db_type: sql
    assume_mam_usage: true
    default: always   mod_muc:
    access:
      - allow
    access_admin:
      - allow: admin
    access_create: muc_create
    access_persistent: muc_create
    access_mam:
      - allow
    default_room_options:
      mam: true   mod_muc_admin: {}   mod_offline:
    access_max_user_messages: max_user_offline_messages   mod_ping: {}   mod_privacy: {}   mod_private: {}   mod_proxy65:
    access: local
    max_connections: 5   mod_pubsub:
    access_createnode: pubsub_createnode
    plugins:
      - "flat"
      - "pep"
    force_node_config:
      ## Change from "whitelist" to "open" to enable OMEMO support
      ## See https://github.com/processone/ejabberd/issues/2425
      "eu.siacs.conversations.axolotl.*":
        access_model: whitelist
      ## Avoid buggy clients to make their bookmarks public
      "storage:bookmarks":
        access_model: whitelist   mod_push: {}   mod_push_keepalive: {}   mod_register:
    ## Only accept registration requests from the "trusted"
    ## network (see access_rules section above).
    ## Think twice before enabling registration from any
    ## address. See the Jabber SPAM Manifesto for details:
    ## https://github.com/ge0rg/jabber-spam-fighting-manifesto
    ip_access: trusted_network   mod_roster:
    versioning: true   mod_s2s_dialback: {}   mod_shared_roster: {}   mod_stream_mgmt:
    resend_on_timeout: if_offline   mod_vcard: {}   mod_vcard_xupdate: {}   mod_version:
    show_os: false

此致

詹姆士

答案1

/usr/local/etc/ejabberd/ejabberdctl.cfg: 第 187 行:host_config:: 未找到命令

嗯,请注意,ejabberd.yml 使用 YAML 格式配置 ejabberd。而 ejabberdctl.cfg 是用于 Erlang 的 shell 格式的不同配置文件。

host_config 是 ejabberd.yml 的一个选项,所以我不明白为什么在 ejabberdctl.cfg 中提到它。也许你尝试了太多东西,以至于把这两个文件混在一起了。

主意:

  1. 删除所有配置文件,
  2. 从头开始安装,以便获得新的配置文件
  3. 启动 ejabberd,确保它至少使用默认配置文件正确启动
  4. 停止 ejabberd
  5. 修改ejabberd.yml中的一个选项
  6. 启动 ejabberd,检查它是否正确启动,以及你的更改是否正确应用

我正在尝试在 ejabberd 中设置虚拟主机,

如果您想向 ejabberd 添加一个新的虚拟主机(如“example.org”),只需像这样添加:

hosts:
  - "test.lan"
  - "example.org"

一旦使其工作,您可以简单地删除您不会使用的其他主机的行。

相关内容