Hi
i'm trying the mod_http_fileserver, my config:
Ejabberd 2.0.1 from svn, revision 1342, without tls suport.
%%% ===============
%%% LISTENING PORTS
{5280, ejabberd_http, [
http_poll,
http_bind,
{request_handlers, [
{["web"], mod_http_fileserver}
]},
web_admin
]}
%%% =======
%%% MODULES
{mod_http_fileserver, [
{docroot, "/var/lib/ejabberd/www"},
{accesslog, "/var/log/ejabberd/webaccess.log"}
]},
/var/log/ejabberd/ejabberd.log:
=INFO REPORT==== 2008-05-26 15:42:56 ===
I(<0.248.0>:ejabberd_listener:114) : (#Port<0.424>) Accepted connection {{127,0,0,1},54505} -> {{127,0,0,1},5280}
=INFO REPORT==== 2008-05-26 15:42:56 ===
D(<0.241.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-05-26 15:42:56 ===
I(<0.241.0>:ejabberd_http:123) : started: {gen_tcp,#Port<0.424>}
=INFO REPORT==== 2008-05-26 15:42:56 ===
D(<0.356.0>:ejabberd_http:224) : (#Port<0.424>) http query: 'GET' /web/test/index.html
=INFO REPORT==== 2008-05-26 15:42:56 ===
D(<0.356.0>:ejabberd_http:263) : ["web","test","index.html"] matches ["web"]
=INFO REPORT==== 2008-05-26 15:42:56 ===
D(<0.356.0>:mod_http_fileserver:54) : Requested ["test","index.html"]
=INFO REPORT==== 2008-05-26 15:42:56 ===
D(<0.356.0>:mod_http_fileserver:71) : Delivering content.
==================================================
But the page comes blank, and firebug dont't show any response!
If try it in apache, it works and show the simple hello world!
the file has total pemissions to everyone!
Any ideas????
Thanks
Vinicius Dittgen
Strange problem
/var/log/ejabberd/ejabberd.log:
Ohh, it's strange that it doesn't show any error message.
Can you check also sasl.log, and both files since the beginning of ejabberd?
Ejabberd 2.0.1 from svn, revision 1342, without tls suport.
Do you mean trunk/, branches/ejabberd-2.0.x or tags/ejabberd-2.0.1 ?
And what SVN revision of ejabberd-modules ?
Also: which version of Erlang/OTP?
Me too!
Hi, I'm having what seems like a very similar problem to this.
I've set up mod_http_fileserver and mod_http_bind using ejabberd 2.0 (latest svn trunk as of today). Basically I followed the instructions at http://www.ejabberd.im/jwchat-localserver.
Both modules were built from the latest svn trunk and copied into /var/lib/ejabberd/ebin, chowned to ejabberd user and group. Viewing any file results in a server crash, and no output being displayed into the browser. Interestingly, directory viewing "works", i.e. it gives the expected "eisdir".
Here's the server crash output from /var/log/ejabberd/sasl.log when trying to view a text file (same thing happens for html files, except that the string, to_lower, [".txt"]} becomes ".html"):
=CRASH REPORT==== 13-Jun-2008::18:01:13 ===
crasher:
pid: <0.334.0>
registered_name: []
error_info: {undef,[{string,to_lower,[".txt"]},
{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.413>,
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.36.0>]
messages: []
links: [<0.233.0>,#Port<0.413>]
dictionary: []
trap_exit: false
status: running
heap_size: 377
stack_size: 21
reductions: 5104
neighbours:
=SUPERVISOR REPORT==== 13-Jun-2008::18:01:13 ===
Supervisor: {local,ejabberd_http_sup}
Context: child_terminated
Reason: {undef,[{string,to_lower,[".txt"]},
{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.334.0>},
{name,undefined},
{mfa,{ejabberd_http,start_link,
[{gen_tcp,#Port<0.413>},
[{request_handlers,
[{["web"],mod_http_fileserver}]},
http_bind,
http_poll,
web_admin]]}},
{restart_type,temporary},
{shutdown,brutal_kill},
{child_type,worker}]
Any ideas? It seems like it's really close to working, and it's been fun to mess around with (the ejabberd server is working great otherwise). My environment:
Debian Etch
Erlang 11b.2-4 (that's from the Debian showpkg, let me know if it's wrong as I don't understand Erlang versioning too well)
ejabberd built from r1353 (trunk)
ejabberd-modules built from r642 (trunk)
Solution
A solution is to edit Emakefile of mod_http_fileserver and remove this:
However, once you have a chance, upgrade that old 'Erlang 11b.2-4' to Erlang/OTP R11B-5 or newer.
Related ticket:Use httpd_util:to_lower when not compiling with Erlang R12