安装OpenFire XMPP服务器以交换消息¶
以下命令将为部署CentOS 7 Minimal ISO机器做好准备:
OpenFire XMPP服务器
NFS共享文件系统
备注
本节的先决条件是按本节所述准备CentOS机器 使用WPS远程插件部署和设置地理服务器 .
OpenFire XMPP服务器的设置和配置¶
XMPP最初名为Jabber,是 可扩展的消息传递和状态协议。 它主要与即时通讯联系在一起。
建立PostgreSQL数据库后端¶
为了运行一个私有的XMPP通信平台,我们可以安全地使用PostgreSQL 9.2,它是稳定的,默认在CentOS 7中出现。
# as root
$> yum install -y postgresql postgresql-server postgresql-devel postgresql-libs
# After PostgreSQL packages are installed, enable PostgreSQL to start after each reboot.
$> systemctl enable postgresql.service
# Initialize directory structure and postgres system database.
$> postgresql-setup initdb
# And start the service.
$> systemctl start postgresql.service
Postgres安装现在已经启动并运行,让我们继续为OpenFire设置特定的数据库和专用用户,以及身份验证方法和管理密码。
要获得完全的管理权限,请切换到Postgres用户。
su postgres
# as postgres
$> createdb openfire
$> createuser -P openfire
# The '-P' parameter ensures that the shell will explicitly ask for user's password and you will need to type it in. Enter the password twice
R3m0T3wP5
$> psql -U postgres -d postgres -c "ALTER USER postgres WITH PASSWORD 'R3m0T3wP5';"
Postgres用户使用新密码进行保护。让我们将身份验证方法付诸实践,并强制每个应用程序或shell登录提示输入这些密码。
# as postgres
$> vim /var/lib/pgsql/data/pg_hba.conf
# Scroll down to the bottom of the file and replace all peer and ident strings with md5 string.
# The configuration should look like this:
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
从postgres shell(ctrl+d)返回并以root身份重新启动postgresql服务。
# as root
$> systemctl restart postgresql.service
从Ignite实时下载并安装OpenFire¶
由于OpenFire RPM包不包含在任何主要的RHEL/CentOS/Fedora分发存储库中,因此必须直接从Ignite实时网站下载。
# as root
$> wget http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire-3.10.0-1.i386.rpm -O openfire-3.10.0-1.i386.rpm
# This package come in 32bit version only, so in case we run this installation on x86_64 system, we need to make sure to install corresponding 32bit libraries as well.
$> yum install -y /root/openfire-3.9.3-1.i386.rpm
$> yum install -y glibc.i686
启用OpenFire服务并启动它
# as root
$> chkconfig openfire on
$> systemctl start openfire.service
# We need to open the firewall ports in order to expose the gui to the outside
$> firewall-cmd --permanent --zone=public --add-port=9090/tcp
$> firewall-cmd --permanent --zone=public --add-port=9091/tcp
$> firewall-cmd --reload
Openfire服务器的配置
将浏览器移动到URL
选择合适的语言并点击 Contine
将服务器域指定为
geoserver.org
选择 标准数据库连接 在下一节
在标准连接部分提供PostgreSQL数据库的数据库连接参数。
用户的密码 openfire
与PostgreSQL数据库设置中提供的相同(见上文)。
备注
确保 openfire
数据库和用户已在PostgreSQL和提供的密码上正确创建(有关说明,请参阅上文)。
如果没有连接问题,请选择 Default
用户配置文件设置部分的值。
创建 管理员 下一节中的帐户。
密码 *must *与中指定的匹配 remoteProcess.properties
文件
R3m0T3wP5
初始设置现已完成。使用新创建的 管理员 帐户。
移到 Server Certificates
剖面图 Server Settings
选项卡面板。
警告
OpenFire 4.0+上不需要此通道。至少证书的管理有些不同。有关详细信息,请参阅特定的OpenFire文档。
确保已正确生成自签名证书,然后单击 here
以便重新启动服务器
警告
OpenFire 4.0+上不需要此通道。至少证书的管理有些不同。有关详细信息,请参阅特定的OpenFire文档。
同一部分现在显示服务器证书,除非再次生成证书,否则不会要求重新启动。
更新 Security Settings
以便允许服务器接受安全连接上的自签名证书。
警告
OpenFire 4.0+上不需要此通道。至少证书的管理有些不同。有关详细信息,请参阅特定的OpenFire文档。
创建 default
通道如下图所示。
创建 management
通道如下图所示。注意 Room Options
并指定频道的密码
R3m0T3wP5
再次检查通道是否已正确创建,并且它们出现在 Group Chat Rooms
.
重新启动geoserver
# as root
$> systemctl restart geoserver
成功重新启动GeoServer后,请使用 admin
资格证书。
它是 *very *重要的是用户显示为 Authenticated
.
还要检查用户是否已注册到上面创建的XMPP通道。
XMPP端口的防火墙规则¶
默认情况下,XMPP服务器监听传入连接的TCP端口是对外关闭的。因此,有必要至少为Openfire默认安全端口启用防火墙规则 5223 除非在服务器安装过程中被用户更改。
为此,发出以下命令:
# as root
# We need to open the firewall ports in order to expose the gui to the outside
$> firewall-cmd --permanent --zone=public --add-port=5222/tcp
$> firewall-cmd --permanent --zone=public --add-port=5223/tcp
$> firewall-cmd --reload
将代理转发到Apache httpd服务器¶
本节描述的过程允许通过httpd通过apache httpd服务器公开geoserver。
这些步骤不是强制性的,程序可能会随着生产系统的最终部署而相应更改。
要安装Apache httpd服务器,请执行以下操作:
# as root
$> yum -y install httpd mod_ssl
$> vi /etc/httpd/conf.d/forward-proxy.conf
ProxyRequests Off
ProxyPass /geoserver ajp://localhost:8009/geoserver
ProxyPassReverse /geoserver ajp://localhost:8009/geoserver
$> systemctl enable httpd.service
$> service httpd restart
香叶菊 ,默认情况下启用,需要指示允许http网络连接。这可以通过运行以下命令来完成:
# as root
$> /usr/sbin/setsebool -P httpd_can_network_connect 1