CentOS 6部署Openfire 擴充平台聊天功能。

來源:互聯網
上載者:User

標籤:

openfire 是個好東西。在團隊規模有限的情況下用這個是非常的的。當然也可以用node.js 開發聊天。

linux 下面有幾個要注意的地方。

  1.  因為我選擇的CentOS 6是64位的了,然而Openfire卻是32位的,因此必須要安裝32位的C++運行時。如果伺服器能夠訪問外網,那麼執行

  2. openfire 是java 開發的所以需要安裝java 注意你的版本。

  3. 接下來按照順序安裝

  4. http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/index.html 這個是原版地址

Openfire 版本相容
# yum install libstdc++.i686
java 安裝

安裝好的CentOS會內建OpenJdk,用命令 java -version ,會有下面的資訊:

java version "1.6.0"
OpenJDK Runtime Environment (build 1.6.0-b09)
OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode)

最好還是先卸載掉openjdk,在安裝sun公司的jdk.

先查看 rpm -qa | grep java

http://jingyan.baidu.com/article/4853e1e51d0c101909f72607.html 或是看這個。

查看yum庫中的Java安裝包。

◆輸入:yum -y list java* 。

使用yum安裝Java環境。

◆輸入:yum -y install java-1.7.0-openjdk* ,以yum庫中java-1.7.0為例。 

  當結果顯示為Complete!即安裝完畢。

查看剛安裝的Java版本資訊。

◆輸入:java -version 可查看Java版本;


Openfire 下載安裝
  這裡看下載 wget http://download.igniterealtime.org/openfire/openfire-3.6.4-1.i386.rpm

Openfire 程式安裝啟動
# rpm -ivh openfire-3.9.3-1.i386.rpm

上傳Openfire的安裝程式。推薦使用openfire-3.9.3-1.i386.rpm這個安裝包,裡面已經內建對應的JRE,無需額外配置。執行:

Preparing… ########################################### [100%]1:openfire ########################################### [100%]3.開啟服務service openfire start

Openfire 啟動  Openfire in Linux/Unix

If you are running on a Red Hat or Red Hat like system (CentOS, Fedora, etc), we recommend using the RPM as it contains some custom handling of the standard Red Hat like environment.  Assuming that you have used the RPM, you can start and stop Openfire using the /etc/init.d/openfire script.

# /etc/init.d/openfireUsage /etc/init.d/openfire {start|stop|restart|status|condrestart|reload}# /etc/init.d/openfire startStarting openfire:

成功了會顯示成這樣的。

Starting openfire:

If you are running on a different Linux/Unix varient, and/or you have used the .tar.gz ‘installer‘, you can start and stop Openfire using the bin/openfire script in your Openfire installation:# ./openfire
Usage: ./openfire {start|stop}
# ./openfire start

很多人可能看到這裡就認為完了,但是到我這裡還沒完。請繼續看

連接埠映射外網訪問

伺服器是遠程 有固定ip 而這個openfire 預設安裝完了是http://127.0.0.1:9090 可以用curl  檢測或是連接埠檢測。這個本機可以外網那個沒法開啟。

所以需要在外網映射一下就可以了。

apache中設定代理:
NameVirtualHost xxx.xxxx.xxx:80
<VirtualHost *:80 >
ServerAdmin [email protected]
ServerName openfire.baidu.com
ErrorLog logs/rsa-error.log
CustomLog logs/rsa-access.log common
ProxyPass / http://127.0.0.1:9090/
ProxyPassReverse / http://127.0.0.1:9090/
</VirtualHost>

到此可以用外網網域名稱開啟了。

CentOS 6部署Openfire 擴充平台聊天功能。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.