0

I'm trying to setup the virtual host in ejabberd, however regardless of what I try it either gives me the following error

/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

or nothing at all (doesn't add virtual host to list on virtuals hosts page of admin)

I compiled the sourcefrom github on centos 7

I'v followed the ejabberd config guide, I've even counted spaces to just check, I don't know how to proceed from here so any help would be appreciated

the following is the content of my ejabberd.yml, I would attach it as a file but there doesn't appear be to any way to do so

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

Best Regards

James

Romeo Ninov
  • 5,263
  • 4
  • 20
  • 26

1 Answers1

0

/usr/local/etc/ejabberd/ejabberdctl.cfg: line 187: host_config:: command not found

Umm, please be aware that ejabberd.yml configures ejabberd using YAML format. And ejabberdctl.cfg is a different config file for Erlang things in shell format.

host_config is an option for ejabberd.yml, so I don't understand why it's mentioned in ejabberdctl.cfg. Maybe you have tried so many things, that you have mixed those two files.

Idea:

  1. delete all those config files,
  2. install from scratch so you get new config files
  3. start ejabberd, to make sure it starts correctly, at least with default config files
  4. stop ejabberd
  5. modify one option in ejabberd.yml
  6. start ejabberd, check it starts correctly, and that your changes are applied correctly

I'm trying to setup the virtual host in ejabberd,

If you want to add a new virtual host to ejabberd (like "example.org"), simply add it like this:

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

Once you get it working, you can simply delete the lines of other hosts that you will not use.

Badlop
  • 580
  • 3
  • 5