how to open ejabberd server to public

狂风中的少年 提交于 2019-11-29 08:43:21
  1. Verify that connections really go through to the server.

    On an Internet-connected box use telnet, nc or a similar command to verify connecting to well-known ports of your server works. Do

    $ telnet 123.123.10.210 5222
    

    and then type in some gibberish and press Enter to send it—you should receive an XML stanza from your server telling you you've sent a malformed stream and indicating a stream closure (to exit telnet session, press Crl-] then enter q and hit Enter).

    If this command hangs and then times out or outright fails, you have a network connectivity problem.

    When you're checking it's really handy to have an instance of tcpdump running to see if clien't packets come in and replies come out:

    # tcpdump -n -i eth0 'tcp and (port 5222 or port 5269)'
    

    (substitute the name of your Internet-connected interface instead of eth0).

  2. You must have a proper DNS setup for your XMPP domain.

    That is, if your users have JIDs in example.domain.com, everyone on the Internet should be able to ask their DNS servers about how to contact users with JIDs in that domain using XMPP. This is done using SRV records. The DNS server(s) maintaining the example.domain.com must have two DNS records:

    • _xmpp-client._tcp.example.domain.com pointing to the host and port of the server accepting client connections (so they should be 123.123.10.210 and 5222).
    • _xmpp-server._tcp.example.domain.com pointing to the host and port of the server accepting server connections (so they should be 123.123.10.210 and 5269).

    More info here.

    Run

    $ host -t srv _xmpp-client._tcp.gmail.com
    $ host -t srv _xmpp-server._tcp.gmail.com
    

    to get some idea about how it should look like.

One more thing to be aware here is that if your server is in a DMZ (not directly connected to Internet but mediated by a NAT device) the firewall setup should be more involved. But before delving into this please check the connectivity as explained above.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!