CentOS 7 64位操作系統,自建加密聊天環境Openfire XMPP服務

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、隨便找一個客戶端,就可以愉快的使用啦!
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章