【发布时间】:2015-03-16 07:40:43
【问题描述】:
意图:使用单个 Ubuntu 主机托管多个聊天服务器。
OS: Ubuntu 14.04
Server: ejabberd
我有一个静态 IP,并且在我的内部(公司)网络上的 VirtualBox 上运行 Ubuntu VM,并且我已将所有 jabber 流量端口转发到运行 ejabberd 服务器的这台 Ubuntu 机器。
我还有一些域名:我们称它们为 example.com、example.net 和 example.org。我添加了诸如 chat.example.com、chat.example.net 和 chat.example.org 之类的 A 记录,并将它们指向我的静态 IP 地址,然后我的路由器将它们转发到运行 ejabberd 的 Ubuntu VM服务器。这些 A 记录是几天前添加的。
我还更新了 ejabberd 配置文件以反映管理员用户和域,如下所示:
%% Admin user
{acl, admin, {user, "najeeb", "chat.example.com"}}.
{acl, admin, {user, "najeeb", "chat.example.net"}}.
{acl, admin, {user, "najeeb", "chat.example.org"}}.
%% Hostname
{hosts, ["localhost", "chat.example.com", "chat.example.net","chat.example.org"]}.
我还使用 ejabberdctl 命令行实用程序成功地将多个用户(包括用户“najeeb”)添加到上面列出的每个域。
虽然我可以使用凭据 najeeb@chat.example.com 连接到 ejabberd,但我无法连接到其他聊天系统,例如 najeeb@chat.example.net 或 najeeb@chat.example.org。 (我使用 Pandion 作为客户端。)但是,当我将 Pandion 客户端中的连接设置切换到我的 IP 地址(作为主机)时,连接工作正常。
我还尝试将这样的条目添加到我的 /etc/hosts 文件中,如下所示:
127.0.0.1 localhost
127.0.1.1 example.com myhost # myhost is my Ubuntu hostname
127.0.0.1 chat.example.com
127.0.0.1 example.net
127.0.0.1 chat.example.net
127.0.0.1 example.org
127.0.0.1 chat.example.org
尽我所能解决这个问题,但它根本不行。
谢谢。
【问题讨论】: