HTTP Polling Is Broken (I think?)

Hi All -

This seems to be pretty pervasive out in the myriad of forums that I have looked through, so I hope someone can help me bring this to closure! I've installed ejabberd 1.1.3 on a SuSe 10.1 machine running Apache2. I intend to use JWChat with this installation, and as such I've followed the installtion guide posted on this site for that configuration. The thing is, I can't get HTTP Polling to work correctly for the ejabberd installation. When I browse to http://mysite:5280/http-poll, I get:

XML Parsing Error: no element found
Location: http://mysite:5280/http-poll
Line Number 1, Column 1:

^

Because this is broken, I can't test the JWChat installation specifc to HTTP Polling as I get a 403 error, I think due to the fact that the ejabberd installation isn't configured correctly.

Where does ejabberd read its configuration from, aside from the ejabberd.cfg file? If anyone can possibly point me in the right direction, I'd greatly appreciate it! I'll post anything you need to help me get through this!

Thanks in advance!

Tim

Figured it out for anybody who may encounter the same thing

All -

It came down to the configuration of my SuSe box and the way that I configured both JWChat and ejabberd. Bottom line, read the readme file in your jwchat directory - that's what unlocked the mystery for me.

Tim

there is no readme file in

there is no readme file in my JWChat directory... can you please be more specific?...

Jwchat readme

I built from source on FreeBSD and there is a README file in my jwchat dir.
The notes in config.js are also helpful.
Here is the Quick Install Guide section of the readme:
Quick Install Guide
===================

* Unpack jwchat into some directory that is accessible by your web
server. E.g.: /var/www/jwchat

* Setup your web server so that it redirects some local address like
http://jabber.example.com/http-poll/ to some service that either
implements HTTP Polling or HTTP Binding.

Some servers like ejabberd do have such a service built-in. Please
refer to the docs of your jabber server to find out how to use it.

If your server does not have such a service built-in or you don't
plan to run your own jabber server at all there are standalone
components like punjab or JabberHTTPBind available that let you
connect to any jabber server using HTTP Binding or HTTP Polling.

Here is an example that should work with a default ejabberd
installation on the same host:

%<----------

ServerName jabber.example.com
DocumentRoot /var/www/jwchat

Options +Indexes +Multiviews

AddDefaultCharset UTF-8
RewriteEngine on
RewriteRule http-poll/ http://127.0.0.1:5280/http-poll/ [P]

%<----------

Alternatively you could put a .htaccess file within jwchat's
subdirectory like this (you need to have 'AllowOverride All' in your
apache config in order to make this work):

%<----------

RewriteEngine On
RewriteRule http-poll/ http://127.0.0.1:5280/http-poll/ [P]

%<----------

Note 1: You need to enable mod_rewrite and mod_proxy at your apache
configuration. Apache2 users also need to enable the protocol
specific proxy module mod_proxy_http.

Note 2: With JabberHTTPBind you don't need to do this sort of
address rewriting if you're serving JWChat's files from within your
servlet container directly or you're using some technique like
mod_jk to mount a remote servlet engine directory transparently into
your apache's domain of served addresses.

* Restart your web server.

* Test if this redirect works. Following the example above point your
browser to http://jabber.example.com/http-poll/. You should see the
same response as if you you're pointing it to
http://jabber.example.com:5280/http-poll/.

* Edit 'config.js' to suit your needs.
Be sure to set 'httpbase' to the redirected address from
above. Within our example it would have to be
'http://jabber.example.com/http-poll/' or 'http-poll/' in short.

config.js

In addition to following the instructions in the JWChat readme, make sure your "type" is set to be "polling" instead of "binding" if you intend for JWChat to poll against the port. That was the final step that got me over the top.

Apache22; ejabberd

my apache uses '/usr/local/www/data' instead of '/var/www/data'; changes made; still dunno where this 'http-poll' list is/should be.

README:
"%<----------

RewriteEngine On
RewriteRule http-poll/ http://127.0.0.1:5280/http-poll/ [P]

%<----------

Note 1: You need to enable mod_rewrite and mod_proxy at your apache
configuration. Apache2 users also need to enable the protocol
specific proxy module mod_proxy_http."

Me:
Found "LoadModule rewrite_module libexec/apache22/mod_rewrite.so" but not the others.
Assuming I'm to add the others (guessing at convention):
"LoadModule proxy_module libexec/apache22/mod_proxy.so" and "LoadModule
proxy_http_module libexec/apache22/mod_proxy_http.so"
Wrote; stopped httpd; restarted

Apache:
"httpd: Syntax error on line 104 of /usr/local/etc/apache2/httpd.xonf: Cannot load
/usr/local/libexec/apache2/mod_proxy.so into server: cannot open
"/usr/local/libexec/apache22/mod_proxy.so"

Me:
Found a 'mod_proxy.c' and a 'mod_proxy.h' (some type of compiling needed?!?)
could not find a 'mod_proxy_http.so' either. #'d them both. jabber.server.name:5280/http-poll/ still not
equal output to jabber.server.name/http-poll/ or jabber.server.name (obviously I'd prefer the later
without some silly http-poll after it.

Syndicate content