JWChat and Fileserver not working?

I followed these steps:

http://www.ejabberd.im/jwchat-localserver

that didn't work because the mod was missing in 2.0.1 so I built & installed 2.0.0.
Followed the steps again. Now when I type this address in my browser:

http://jabber.domain.de:5280/web/jwchat/index.html

I get Error: Host Not Accessible

But in ejabberd log I see this:

=INFO REPORT==== 2008-08-12 18:51:01 ===
D(<0.1517.0>:mod_http_fileserver:54) : Requested ["jwchat","index.html"]

=INFO REPORT==== 2008-08-12 18:51:01 ===
D(<0.1517.0>:mod_http_fileserver:71) : Delivering content.

when I type this:

http://domain.de:5280/web/jwchat/index.html

I get a blank page. Log is the same as above.

Without the index.html part, I get eisdir.

I created a test.html file with "hello" content in /var/lib/ejabberd/www/jwchat

and the results are the same:

http://jabber.domain.de:5280/web/jwchat/test.html

Error: Host Not Accessible (Log as above)

http://domain.de:5280/web/jwchat/test.html

Blank page (log as above)

Can somebody tell me what went wrong?

Maybe there is something

Maybe there is something wrong in my ejabberd.cfg ??

{hosts, ["jabber.domain.de"]}.

listen {[

%% ...

  {5280, ejabberd_http, [
                           {request_handlers, [
                               {["web"], mod_http_fileserver}
                            ]},
                               http_bind,
                               http_poll,
                               web_admin
                            ]}

]}.

{auth_method, internal}.

{modules,
[

%% ...

  {mod_http_bind,  []},
  {mod_http_fileserver, [
            {docroot, "/var/lib/ejabberd/www"},
            {accesslog, "/var/log/ejabberd/webaccess.log"}
        ]}
]}.

Hmm I can't think of anything else
What's more likely to cause this, ejabberd, configuration, or my something on my machine?

I don't get where is the problem. Some ideas

Umm, it's a little strange.

Just to be sure: when you start ejabberd, check its log files and ensure there isn't any error report.

Then, with that configuration, when you visit the URL http://jabber.domain.de:5280/web/test.html ejabberd will call to mod_http_fileserver, and this will try to read the file /var/lib/ejabberd/www/test.html

When you request an URL, if you get:

  • eisdir: it means you requested a directory. Some webservers like Apache would show you the content of the directory; but this isn't implemented in mod_http_fileserver.
  • a blank page: probably something crashed in ejabberd. Check ejabberd.log and sasl.log for some report.
  • Error: Host Not Accessible: I don't remember getting this error before.

logs

badlop thanks for your support!
I hope you can help me.

I think it's best if I post logs here.
When I start ejabberd, this is in the log:

=INFO REPORT==== 2008-08-15 09:54:30 ===
I(<0.35.0>:ejabberd_rdbms:37) : ejabberd has not been compiled with relational database support. Skipping database startup.

=INFO REPORT==== 2008-08-15 09:54:30 ===
I(<0.287.0>:mod_pubsub:152) : pubsub init "jabber.domain.de" [{access_createnode,
                                                                  pubsub_createnode},
                                                              {plugins,
                                                                  ["default",
                                                                   "pep"]}]

=INFO REPORT==== 2008-08-15 09:54:30 ===
I(<0.287.0>:mod_pubsub:207) : ** tree plugin is nodetree_default

=INFO REPORT==== 2008-08-15 09:54:30 ===
I(<0.287.0>:mod_pubsub:211) : ** init default plugin

=INFO REPORT==== 2008-08-15 09:54:30 ===
I(<0.287.0>:mod_pubsub:211) : ** init pep plugin

sasl.log is too big, here some examples:

=PROGRESS REPORT==== 15-Aug-2008::10:09:48 ===
          supervisor: {local,ejabberd_sup}
             started: [{pid,<0.244.0>},
                       {name,ejabberd_http_sup},
                       {mfa,{ejabberd_tmp_sup,
                                start_link,
                                [ejabberd_http_sup,ejabberd_http]}},
                       {restart_type,permanent},
                       {shutdown,infinity},
                       {child_type,supervisor}]

=PROGRESS REPORT==== 15-Aug-2008::10:09:48 ===
          supervisor: {local,ejabberd_sup}
             started: [{pid,<0.245.0>},
                       {name,ejabberd_http_poll_sup},
                       {mfa,{ejabberd_tmp_sup,
                                start_link,
                                [ejabberd_http_poll_sup,ejabberd_http_poll]}},
                       {restart_type,permanent},
                       {shutdown,infinity},
                       {child_type,supervisor}]

=PROGRESS REPORT==== 15-Aug-2008::10:09:48 ===
          supervisor: {local,ejabberd_listeners}
             started: [{pid,<0.251.0>},
                       {name,5280},
                       {mfa,{ejabberd_listener,
                                start,
                                [5280,
                                 ejabberd_http,
                                 [{request_handlers,
                                      [{["web"],mod_http_fileserver}]},
                                  http_bind,
                                  http_poll,
                                  web_admin]]}},
                       {restart_type,transient},
                       {shutdown,brutal_kill},
                       {child_type,worker}]

=PROGRESS REPORT==== 15-Aug-2008::10:09:48 ===
          supervisor: {local,ejabberd_sup}
             started: [{pid,<0.325.0>},
                       {name,ejabberd_http_bind_sup},
                       {mfa,{ejabberd_tmp_sup,
                                start_link,
                                [ejabberd_http_bind_sup,ejabberd_http_bind]}},
                       {restart_type,permanent},
                       {shutdown,infinity},
                       {child_type,supervisor}]

Then I put this into the browser:

http://jabber.domain.de:5280/web/test.html

The result is "Error: Host Not Accessible" - it might be a subsequent error?
I forgot to mention maybe, that I put a CNAME record jabber.domain.de -> domain.de

Anyway here is the logs for ejabberd.log and sasl.log.
webaccess.log is empty.

=INFO REPORT==== 2008-08-15 10:32:02 ===
I(<0.251.0>:ejabberd_listener:112) : (#Port<0.403>) Accepted connection {{212,202,145,26},2778} -> {{88,121,137,85},5280}

=INFO REPORT==== 2008-08-15 10:32:02 ===
D(<0.244.0>:ejabberd_http:121) : S: [{["web"],mod_http_fileserver},
                                     {["admin"],ejabberd_web_admin},
                                     {["http-bind"],mod_http_bind},
                                     {["http-poll"],ejabberd_http_poll}]

=INFO REPORT==== 2008-08-15 10:32:02 ===
I(<0.244.0>:ejabberd_http:123) : started: {gen_tcp,#Port<0.403>}

=INFO REPORT==== 2008-08-15 10:32:02 ===
D(<0.345.0>:ejabberd_http:224) : (#Port<0.403>) http query: 'GET' /web/test.html

=INFO REPORT==== 2008-08-15 10:32:02 ===
D(<0.345.0>:ejabberd_http:263) : ["web","test.html"] matches ["web"]

=INFO REPORT==== 2008-08-15 10:32:02 ===
D(<0.345.0>:mod_http_fileserver:54) : Requested ["test.html"]

=INFO REPORT==== 2008-08-15 10:32:02 ===
D(<0.345.0>:mod_http_fileserver:71) : Delivering content.

=INFO REPORT==== 2008-08-15 10:32:03 ===
I(<0.251.0>:ejabberd_listener:112) : (#Port<0.407>) Accepted connection {{212,202,145,26},2779} -> {{88,121,137,85},5280}

=INFO REPORT==== 2008-08-15 10:32:03 ===
D(<0.244.0>:ejabberd_http:121) : S: [{["web"],mod_http_fileserver},
                                     {["admin"],ejabberd_web_admin},
                                     {["http-bind"],mod_http_bind},
                                     {["http-poll"],ejabberd_http_poll}]

=INFO REPORT==== 2008-08-15 10:32:03 ===
I(<0.244.0>:ejabberd_http:123) : started: {gen_tcp,#Port<0.407>}

=INFO REPORT==== 2008-08-15 10:32:03 ===
D(<0.346.0>:ejabberd_http:224) : (#Port<0.407>) http query: 'GET' /favicon.ico

=CRASH REPORT==== 15-Aug-2008::10:32:02 ===
  crasher:
    pid: <0.345.0>
    registered_name: []
    error_info: {undef,[{string,to_lower,[".html"]},
                         {mod_http_fileserver,content_type,1},
                         {mod_http_fileserver,serve,1},
                         {mod_http_fileserver,process,2},
                         {ejabberd_http,process_request,1},
                         {ejabberd_http,process_header,2},
                         {ejabberd_http,receive_headers,1},
                         {proc_lib,init_p,5}]}
    initial_call: {ejabberd_http,receive_headers,
                                [{state,
                                     gen_tcp,
                                     #Port<0.403>,
                                     undefined,
                                     undefined,
                                     undefined,
                                     undefined,
                                     undefined,
                                     undefined,
                                     "en",
                                     [{["web"],mod_http_fileserver},
                                      {["admin"],ejabberd_web_admin},
                                      {["http-bind"],mod_http_bind},
                                      {["http-poll"],ejabberd_http_poll}],
                                     false,
                                     []}]}
    ancestors: [ejabberd_http_sup,ejabberd_sup,<0.35.0>]
    messages: []
    links: [<0.244.0>,#Port<0.403>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 377
    stack_size: 21
    reductions: 2847
  neighbours:

=SUPERVISOR REPORT==== 15-Aug-2008::10:32:02 ===
     Supervisor: {local,ejabberd_http_sup}
     Context:    child_terminated
     Reason:     {undef,[{string,to_lower,[".html"]},
                         {mod_http_fileserver,content_type,1},
                         {mod_http_fileserver,serve,1},
                         {mod_http_fileserver,process,2},
                         {ejabberd_http,process_request,1},
                         {ejabberd_http,process_header,2},
                         {ejabberd_http,receive_headers,1},
                         {proc_lib,init_p,5}]}
     Offender:   [{pid,<0.345.0>},
                  {name,undefined},
                  {mfa,{ejabberd_http,start_link,
                                      [{gen_tcp,#Port<0.403>},
                                       [{request_handlers,
                                            [{["web"],mod_http_fileserver}]},
                                        http_bind,
                                        http_poll,
                                        web_admin]]}},
                  {restart_type,temporary},
                  {shutdown,brutal_kill},
                  {child_type,worker}]

The next case is,

http://domain.de:5280/web/test.html

which gives me a blank page. Again, webaccess.log is empty.
Other logs:

=INFO REPORT==== 2008-08-15 10:38:38 ===
I(<0.251.0>:ejabberd_listener:112) : (#Port<0.423>) Accepted connection {{212,202,145,26},2909} -> {{88,121,137,85},5280}

=INFO REPORT==== 2008-08-15 10:38:38 ===
D(<0.244.0>:ejabberd_http:121) : S: [{["web"],mod_http_fileserver},
                                     {["admin"],ejabberd_web_admin},
                                     {["http-bind"],mod_http_bind},
                                     {["http-poll"],ejabberd_http_poll}]

=INFO REPORT==== 2008-08-15 10:38:38 ===
I(<0.244.0>:ejabberd_http:123) : started: {gen_tcp,#Port<0.423>}

=INFO REPORT==== 2008-08-15 10:38:38 ===
D(<0.356.0>:ejabberd_http:224) : (#Port<0.423>) http query: 'GET' /web/test.html

=INFO REPORT==== 2008-08-15 10:38:38 ===
D(<0.356.0>:ejabberd_http:263) : ["web","test.html"] matches ["web"]

=INFO REPORT==== 2008-08-15 10:38:38 ===
D(<0.356.0>:mod_http_fileserver:54) : Requested ["test.html"]

=INFO REPORT==== 2008-08-15 10:38:38 ===
D(<0.356.0>:mod_http_fileserver:71) : Delivering content.

=CRASH REPORT==== 15-Aug-2008::10:38:38 ===
  crasher:
    pid: <0.354.0>
    registered_name: []
    error_info: {undef,[{string,to_lower,[".html"]},
                         {mod_http_fileserver,content_type,1},
                         {mod_http_fileserver,serve,1},
                         {mod_http_fileserver,process,2},
                         {ejabberd_http,process_request,1},
                         {ejabberd_http,process_header,2},
                         {ejabberd_http,receive_headers,1},
                         {proc_lib,init_p,5}]}
    initial_call: {ejabberd_http,receive_headers,
                                [{state,
                                     gen_tcp,
                                     #Port<0.419>,
                                     undefined,
                                     undefined,
                                     undefined,
                                     undefined,
                                     undefined,
                                     undefined,
                                     "en",
                                     [{["web"],mod_http_fileserver},
                                      {["admin"],ejabberd_web_admin},
                                      {["http-bind"],mod_http_bind},
                                      {["http-poll"],ejabberd_http_poll}],
                                     false,
                                     []}]}
    ancestors: [ejabberd_http_sup,ejabberd_sup,<0.35.0>]
    messages: []
    links: [<0.244.0>,#Port<0.419>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 987
    stack_size: 21
    reductions: 3500
  neighbours:

=SUPERVISOR REPORT==== 15-Aug-2008::10:38:38 ===
     Supervisor: {local,ejabberd_http_sup}
     Context:    child_terminated
     Reason:     {undef,[{string,to_lower,[".html"]},
                         {mod_http_fileserver,content_type,1},
                         {mod_http_fileserver,serve,1},
                         {mod_http_fileserver,process,2},
                         {ejabberd_http,process_request,1},
                         {ejabberd_http,process_header,2},
                         {ejabberd_http,receive_headers,1},
                         {proc_lib,init_p,5}]}
     Offender:   [{pid,<0.354.0>},
                  {name,undefined},
                  {mfa,{ejabberd_http,start_link,
                                      [{gen_tcp,#Port<0.419>},
                                       [{request_handlers,
                                            [{["web"],mod_http_fileserver}]},
                                        http_bind,
                                        http_poll,
                                        web_admin]]}},
                  {restart_type,temporary},
                  {shutdown,brutal_kill},
                  {child_type,worker}]

=CRASH REPORT==== 15-Aug-2008::10:38:38 ===
  crasher:
    pid: <0.355.0>
    registered_name: []
    error_info: {undef,[{string,to_lower,[".html"]},
                         {mod_http_fileserver,content_type,1},
                         {mod_http_fileserver,serve,1},
                         {mod_http_fileserver,process,2},
                         {ejabberd_http,process_request,1},
                         {ejabberd_http,process_header,2},
                         {ejabberd_http,receive_headers,1},
                         {proc_lib,init_p,5}]}
    initial_call: {ejabberd_http,receive_headers,
                                [{state,
                                     gen_tcp,
                                     #Port<0.421>,
                                     undefined,
                                     undefined,
                                     undefined,
                                     undefined,
                                     undefined,
                                     undefined,
                                     "en",
                                     [{["web"],mod_http_fileserver},
                                      {["admin"],ejabberd_web_admin},
                                      {["http-bind"],mod_http_bind},
                                      {["http-poll"],ejabberd_http_poll}],
                                     false,
                                     []}]}
    ancestors: [ejabberd_http_sup,ejabberd_sup,<0.35.0>]
    messages: []
    links: [<0.244.0>,#Port<0.421>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 610
    stack_size: 21
    reductions: 2901
  neighbours:

=SUPERVISOR REPORT==== 15-Aug-2008::10:38:38 ===
     Supervisor: {local,ejabberd_http_sup}
     Context:    child_terminated
     Reason:     {undef,[{string,to_lower,[".html"]},
                         {mod_http_fileserver,content_type,1},
                         {mod_http_fileserver,serve,1},
                         {mod_http_fileserver,process,2},
                         {ejabberd_http,process_request,1},
                         {ejabberd_http,process_header,2},
                         {ejabberd_http,receive_headers,1},
                         {proc_lib,init_p,5}]}
     Offender:   [{pid,<0.355.0>},
                  {name,undefined},
                  {mfa,{ejabberd_http,start_link,
                                      [{gen_tcp,#Port<0.421>},
                                       [{request_handlers,
                                            [{["web"],mod_http_fileserver}]},
                                        http_bind,
                                        http_poll,
                                        web_admin]]}},
                  {restart_type,temporary},
                  {shutdown,brutal_kill},
                  {child_type,worker}]

=CRASH REPORT==== 15-Aug-2008::10:38:38 ===
  crasher:
    pid: <0.356.0>
    registered_name: []
    error_info: {undef,[{string,to_lower,[".html"]},
                         {mod_http_fileserver,content_type,1},
                         {mod_http_fileserver,serve,1},
                         {mod_http_fileserver,process,2},
                         {ejabberd_http,process_request,1},
                         {ejabberd_http,process_header,2},
                         {ejabberd_http,receive_headers,1},
                         {proc_lib,init_p,5}]}
    initial_call: {ejabberd_http,receive_headers,
                                [{state,
                                     gen_tcp,
                                     #Port<0.423>,
                                     undefined,
                                     undefined,
                                     undefined,
                                     undefined,
                                     undefined,
                                     undefined,
                                     "en",
                                     [{["web"],mod_http_fileserver},
                                      {["admin"],ejabberd_web_admin},
                                      {["http-bind"],mod_http_bind},
                                      {["http-poll"],ejabberd_http_poll}],
                                     false,
                                     []}]}
    ancestors: [ejabberd_http_sup,ejabberd_sup,<0.35.0>]
    messages: []
    links: [<0.244.0>,#Port<0.423>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 377
    stack_size: 21
    reductions: 2888
  neighbours:

=SUPERVISOR REPORT==== 15-Aug-2008::10:38:38 ===
     Supervisor: {local,ejabberd_http_sup}
     Context:    child_terminated
     Reason:     {undef,[{string,to_lower,[".html"]},
                         {mod_http_fileserver,content_type,1},
                         {mod_http_fileserver,serve,1},
                         {mod_http_fileserver,process,2},
                         {ejabberd_http,process_request,1},
                         {ejabberd_http,process_header,2},
                         {ejabberd_http,receive_headers,1},
                         {proc_lib,init_p,5}]}
     Offender:   [{pid,<0.356.0>},
                  {name,undefined},
                  {mfa,{ejabberd_http,start_link,
                                      [{gen_tcp,#Port<0.423>},
                                       [{request_handlers,
                                            [{["web"],mod_http_fileserver}]},
                                        http_bind,
                                        http_poll,
                                        web_admin]]}},
                  {restart_type,temporary},
                  {shutdown,brutal_kill},
                  {child_type,worker}]

It does serve the directories. (Subdomain or not)
Sry for the long post, hope you can glean something that could help!

Using ejabberd 2.0.0 with old Erlang/OTP

robse wrote:
=CRASH REPORT==== 15-Aug-2008::10:32:02 ===
  crasher:
    pid: <0.345.0>
    registered_name: []
    error_info: {undef,[{string,to_lower,[".html"]},
                         {mod_http_fileserver,content_type,1},
                         {mod_http_fileserver,serve,1},
                         {mod_http_fileserver,process,2},
                         {ejabberd_http,process_request,1},
                         {ejabberd_http,process_header,2},
                         {ejabberd_http,receive_headers,1},
                         {proc_lib,init_p,5}]}

The version of mod_http_fileserver.erl that you are using calls to the function string:to_lower, which is available since Erlang/OTP R11B-4. However in your case erlang complains that it is undefined, probably because you are using an older version of Erlang.

In ejabberd 2.0.1, that module is clever enough to call httpd_util:to_lower, which is defined in older versions.

If I'm right, then you have three options:

  • Use ejabberd 2.0.0 and Erlang/OTP to R11B-5
  • Use ejabberd 2.0.1 and Erlang/OTP R11B-5 or R12B-*
  • Use ejabberd 2.0.0 and the old Erlang/OTP you have currently, but modify the source code, instead of string:to_lower put httpd_util:to_lower

Related ticket:
Use httpd_util:to_lower when not compiling with Erlang R12

Syndicate content