Thursday, March 27, 2008

http-bind ที่ openfire

ปัญหา http-bin กับ server หลายๆตัวต้องทำการ config ที่ Apache จึงจะใช้ได้
http-bin ของ openfire ก็เหมือนกัน มันต้อง config ทั้งบน Apache และตัว Openfire เองด้วย
ขั้นตอนยังไม่มีโอกาสทำเอง เต้ทำให้บนเครื่องจริง และทอมก็ทำให้บนเครื่อง beta ปัจจุบันนี้

แต่เอาหน้าที่บอกวิธีมาเก็บไว้ ให้ดูแต่ส่วนที่ config ตัว openfire เค้าร config jwchat ไม่ต้องไปดูมันก็ได้ เราทำแล้วใน xmpp4js

กระทู้ http://www.igniterealtime.org/community/message/156841

ตอบโดย ethan

Sep 25, 2007 10:40 PM in response to: ethan Re: My openfire http-binding with jwchat sucks
It is ok now. Thanks Amish Mehta from
https://sourceforge.net/forum/forum.php?thread_id=1802250&forum_id=317560

jwchat can now be used through both apache(http://localhost) and openfire jetty (http://localhost:8080/jwchat/index.html)

Following is the relative complete configuration. And my software version is jwchat 1.0 beta3 + openfire 3.3.3

1 config the httpd.conf file of apache

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so


ServerName localhost
DocumentRoot /var/www/jwchat

Options +MultiViews

AddDefaultCharset UTF-8
ProxyPass /http-bind/ http://127.0.0.1:8080/http-bind/http://127.0.0.1:8080/http-bind/


2Open config.js and comment all BACKENDS except 'Native Binding'

3 Edit jsjac.js and setvar JSJACHBC_USE_BOSH_VER = false; /* true; */

4Edit jwchat.html and just before line:con.connect(oArg);
Add this line:oArg.authtype = 'nonsasl';

5Log into OpenFire as an administrator and add two server properties:
xmpp.httpbind.client.requests.polling = 0xmpp.httpbind.client.requests.wait = 10

6 restart openfire and apache,then login through http://localhost
it is ok

===================
ถ้ายังไม่ได้ดูที่ link http://www.linuxquestions.org/questions/linux-server-73/authentication-error-openfirejwchat-http-binding-612818/

...and another issue bites the dust of the 'solved' stack on my (virtual) desk!
I got the thing running, and as usual feel compelled to explain how I did it, to save the hair on the heads of our future sys admins...
In this case I will list the points one has to cover in order to achieve the working Openfire 3.4.2 running with JWChat 1.0beta3 setup.
Get Openfire up and running, meaning that there are accounts for clients, you can log in with standalone clients, etc.

Extract the JWChat zip/tar.gz to a directory in your webroot (usually /var/www/).
Enable HTTP-binding, and the BOSH 1.6 support in the UI of Openfire.
Make sure that you can access the JWChat folder via a regular URL to your webserver.

Configure your httpd.conf (or */sites-enabled/000-default) to proxy '/http-bind/' to 'http://127.0.0.1:8080/http-bind/' (this is or course the default port for unsecure HTTP-binding. I advise setting up secure access later, when this is working)

Now, check that this proxy re-direct is working (proxy module will need to be loaded, and if you use apache2.x you may wanna check the readme's on http://www.igniterealtime.org/community/) by visiting 'http://myweb.server/http-bind/'. You should be redirected to 'http://127.0.0.1:8080/http-bind', meaning your browser will be sent to 'http://myweb.server:8080/http-bind/' and you should receive an error from Jetty.
When this is working, and you are an English speaking person (I ain't tested no other languages yet, and browser charsets could well play a role here) delete all the 'funky language files' from the jwchat dir in your webroot, so that only .html.html files and the .js scripts remain. (Yes, leave the images alone, as well.)

Next add
xmpp.httpbind.client.requests.polling 0
xmpp.httpbind.client.requests.wait 10

to your Openfire config, and you should be almost set to go.
In my case I had to edit the jsjac.js library to get the thing working, due to a bug/limitation. If you have a newer release I recommend you try your setup out, without executing the next step:
Edit jsjac.js and replace the instances of --> ",charset=utf-8' <-- with --> ",' <--. Just to explain that in a clearer way, delete the text charset=utf-8.
OK, Mr Chatmaster, you should have a working install now. Don't forget to restart apache, and maybe openfire to be on the safe side, flush the cache of your browser, and you're good to go.
regards
PelliX

PS: there is a typo that reads "instrunctions" instead of "instructions" when you perform a search in 'Open Chatrooms'.Last edited by PelliX : 01-12-2008 at 10:03 AM.

===================
Hello Poil,I was looking into your issue, and there are a couple of little pointers I can give you, but it would be nice if you could maybe post the (relevant) logs from your Openfire server. Anyhow, you may wanna add an extra line to your 'httpd.conf' or '~/site-enabled/000-default' or what you are currently using for the apache config:your config:
Quote:

ServerName jwchat.mydomain.com
DocumentRoot /home/mydomain/sd/jwchat/www/


When looking at this, I am a little puzzled that the directory is ~/jwchat/www/ and not /www(/html)/jwchat or similiar, but OK, I guess you have that pointing to the right spot.

Quote:


Options FollowSymLinksAllowOverride None


Options +Multiviews

AddDefaultCharset UTF-8
ProxyRequests On#ProxyPassReverse /http-bind/ http://127.0.0.1:8080/http-bind/
ProxyPass /http-bind/ http://127.0.0.1:8080/http-bind/
ProxyTimeout 10000

ErrorLog /var/log/apache2/jwchat.mydomain.error.log
LogLevel warn
CustomLog /var/log/apache2/jwchat.mydomain.acces.log combined
ServerSignature Off


Now, I had a little scrape with this part (regarding the proxy redirect) myself.

You may wanna add

"ProxyPass http-bind/ http://127.0.0.1:8080/http-bind/"

as well as

"ProxyPass /http-bind/ http://127.0.0.1:8080/http-bind/"

just to be on the safe side, and I also checked my config, and appear to have an 'AllowOverride All' directive in that section. You might wanna try this, too. You would appear to be using Apache2x, which requires the mod_proxy module (and I think mod_proxy_http) to be active in your apache config, I don't want to nag, but are you sure that the proxy redirect is working? I.e. when you visit http://your.server.i.p/http-bind/" you should be redirected to http://your.server.i.p:8080/http-bind and you should receive an error from the Jetty service (I think a good old '404', but I'm not quite sure on that one anymore).

As for replacing the charset value in the jsjac library, it's a dirty hack, but it should work, IF you are using the exact same version. Now as I remember there are two references to utf-8 in the library, and I am more than willing to send you a copy of mine via email if you like. Also, you have the MultiViews directive configured, which the INSTALL does tell you to do. I also have this configured, but as you may have read in my previous posts, I deleted all non-US international files, and that worked for me. There have been some speculations that it could even be the encoding or language setting of the browser causing the failure in some cases. I used firefox 2 and IE6 to test all this, and never noticed any difference, even when changing the encoding settings in the browser. Could you maybe post those logs should all the above info not help?

Cheers

PelliX

2 comments:

Anonymous said...

viagra discount which is better cialis or viagra viagra side affects viagra vs cialis cheapest viagra in uk women does viagra work what is generic viagra does viagra really work cheapest viagra in uk how viagra works does viagra really work free viagra in the uk lowest price viagra free trial of viagra

Anonymous said...

prograf 4 mg b i d
[url=http://www.jnf.nl/swf/log/1/avodart-1mg.html]avodart 1mg[/url]
topamax effects stomach
where to buy viagra in holland
common side effects yasmin birth control
http://www.jnf.nl/swf/log/31/buy-viagra-new-zealand.html