Jwchat+openfire to build Instant messaging

Source: Internet
Author: User

Recently, the company needs to study the Jwchat+openfire Instant messaging system, then wandering in the Internet, according to its description Leng did not succeed, but eventually succeeded, now on the configuration process to explain, hope to have the same needs of netizens less take detours:
First, version information
jdk6.0
apache2.2
openfire3.7
jwchat1.0
Second, the Apache server configuration.

We download the installation is Httpd-2.2.17-win32-x86-no_ Ssl.msi, after the installation is complete, we need to configure, because the JWChat is with Javacript to communicate with OpenFire, so the communication between them is based on HTTP, but because the browser for security is not allowed JavaScript cross-domain access. We have to go through other techniques to circumvent this limitation, so we take the redirect of Apache server to break through this limitation.

After installation, enter the Apache folder to find the httpd.conf file, with Notepad open, the following several configuration items let go (the default is commented out)

1, LoadModule Rewrite_module modules/mod_rewrite.so

2, LoadModule Proxy_module modules/mod_proxy.so

3, LoadModule Proxy_http_module modules/mod_proxy_http.so

Then add the following line configuration at the end of this configuration file

ServerName blzc.com
<Directory/var/jwchat>
Options +indexes +multiviews
</Directory>
Adddefaultcharset UTF-8
Rewriteengine on
proxypass/jwchat/http-bind/http://blzc.com:7070/http-bind/

Here it is necessary to explain the parameters of Proxypass

"/jwchat/http-bind/": JWChat access to http://domain/jwchat/http-bind/address and OpenFire communication, Apache received the request will be redirected to Http://blzc.com : 7070/http-bind/

"http://blzc.com:7070/http-bind/": The redirected address, which is the HTTP access address of our openfire. Port 7070 is the default access port for OpenFire, but we can also enter OpenFire for configuration.

Iii. Configuration of OpenFire
After installing the OpenFire into the web-style management interface, select Server-Server Manager-"System Properties"
Add two attributes to the inside
xmpp.httpbind.client.requests.polling = 0
xmpp.httpbind.client.requests.wait = 10

Iv. Deployment of JWChat
The official download of the jwchat extracted files into the JWChat folder, and to rename the files inside, may be official in order to increase the readability of the file on the file's extension redefined. We need to remove the corresponding extension. Under Linux You can use the commands to complete.
Rename ". Js.js" ". js" *.js.js
Rename ". html.html" ". html" *.html.html
Rename ". Js.zh_cn" ". js" *.js.zh_cn
Rename ". Html.zh_cn" ". html" *.HTML.ZH_CN
Then open the Config.js file and change the corresponding content to the following form

var SITENAME = "blzc.com";//You want to access the domain name of Openfir

Name: "Native Binding",
Description: "Ejabberd ' s native HTTP Binding backend",
Httpbase: "/jwchat/http-bind/",//access to OpenFire address
Type: "Binding",
Servers_allowed:[sitename]

Finally, take the JWChat folder to the Apache Htdocs folder, restart the service, and then visit Http://localhost/jwchat.
If "Authorization Failed" appears, it may be the reason why SSL is not supported, you need to modify the jsjac.js, precede the IF (THIS.HAS_SASL) with This.has_sasl=false;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.