CentOS 7 64位操作系统,自建加密聊天环境Openfire XMPP服务

来源:互联网 发布:映射网络驱动器 密码 编辑:程序博客网 时间:2024/06/06 09:36
0、参考资料:
https://xmpp.org/software/clients.html
http://aqq.eu/
http://www.igniterealtime.org/projects/openfire/


1、首先准备自己的服务器,安装好CentOS7操作系统,如果是自己公司的服务器,需要自己安装操作系统。

    CentOS 7 启动图形界面问题,之前有在虚拟机装了centos6.7,切换方法是在 /etc/inintab中直接修改就行了,
但是换到7发现这个方法已经不管用了。

命令行中打开配置文件,查询如下内容。
vi /etc/inittab

multi-user.target: analogous to runlevel 3  #命令行模式
graphical.target: analogous to runlevel 5   #图形模式

通过systemctl get-default 命令获取当前模式:如果结果是multi-user.target,那么当前就是命令行模式。

设置:
systemctl set-default graphical.target 

然后重启计算机查看是否成功,如果未成功说明在安装过程中没有安装GUI界面,需要重新安装对应的包,或者重新安装操作系统。

如果英文不好,开机后的License信息确认问题:
CentOS7安装完毕,重新开机启动后显示:
Initial setup of CentOS Linux 7 (core) 
1) [x] Creat user 2) [!] License information
(no user will be created) (license not accepted)
Please make your choice from above ['q' to quit | 'c' to continue | 'r' to refresh]:
解决方法:
输入“1”,按Enter键
输入“2”,按Enter键
输入“q",按Enter键
输入“yes”,按Enter键

2、CentOS 7 64 宽带测速,验证一下我们的带宽是否正常。

$ wget https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
$ chmod a+rx speedtest_cli.py
$ sudo mv speedtest_cli.py /usr/local/bin/speedtest-cli
$ sudo chown root:root /usr/local/bin/speedtest-cli

3、安装Openfire服务器环境
去官方网站下载最新版的服务器包
openfire-4.0.2-1.i386.rpm

在服务器的命令行执行:
wget http://www.igniterealtime.org/downloads/download-landing.jsp?file=openfire/openfire-4.0.2-1.i386.rpm

然后执行命令安装:
rpm -ivh openfire-4.0.2-1.i386.rpm

系统默认安装到:/opt/openfire 目录

切换到服务器程序目录,执行openfire.sh启动程序测试!
如果发现如下错误,说明Glibc相关内容未安装好,这个时候需要去我们的安装光盘里面找对应的包。
[root@localhost bin]# ./openfire.sh 
./openfire.sh: /opt/openfire/jre/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: 没有那个文件或目录
./openfire.sh:行178: /opt/openfire/jre/bin/java: 成功

如下几个安装包都需要安装,安装之后即可正常启动服务。
[root@localhost ~]# rpm -qa|grep glibc
glibc-headers-2.17-106.el7_2.8.x86_64
glibc-common-2.17-106.el7_2.8.x86_64
glibc-2.17-106.el7_2.8.x86_64
glibc-2.17-106.el7_2.8.i686
glibc-devel-2.17-106.el7_2.8.x86_64

4、开机启动,默认Openfire服务安装完成就是开机启动状态,重启系统即可。
# chkconfig openfire on
# chkconfig --list openfire
openfire 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭

5、开放防火墙9090端口(Web管理界面使用),开启5222客户端端口。

systemctl status firewalld   查看状态
firewall-cmd --permanent --add-service=http 开放Http访问
firewall-cmd --permanent --add-port=9090/tcp     开放Web访问
firewall-cmd --permanent --add-port=5222/tcp 开放客户端连接
firewall-cmd --reload
systemctl start  firewalld      启动
systemctl enable firewalld 开机启动
systemctl disable firewalld 取消开机启动

6、打开浏览器,输入http://[公网或私网ip]:9090/进入配置界面
按照说明进行配置即可!

7、随便找一个客户端,就可以愉快的使用啦!
1 0