[ejabberd] mod_http_fileserver only returns 404

Aaron Brashears aaron at stageit.com
Fri Sep 17 03:09:26 MSD 2010

Hi there. I am in the process of configuring our ejabberd 2.1.2 server
to allow connections from our web application over bosh from some kind
of flash widget. As such, our front end dev has asked for ejabberd to
serve up a crossdomain.xml file so that the flash socket will work

I have configured ejabberd_http in the listening ports section to be
quite standard:

  {5280, ejabberd_http, [
                           {["public"], mod_http_fileserver}

And Nothing surprising in the modules section where I enable and
configure mod_http_fileserver:

  {mod_http_fileserver, [
                         {docroot, "/var/www/ejabberd"},
                         {accesslog, "/var/log/ejabberd/access.log"},
                         {directory_indices, ["index.html"]},
                         {content_types, [{".html", "text/html"},
                                          {".xml", "text/xml"}

In /var/www/ejabberd (world readable, root writable), I have placed
both an index.html and crossdomain.xml file. When I issue a GET to
localhost:5280/public/crossdomain.xml, I get a 404 instead of my

$ curl -v http://localhost:5280/public/crossdomain.xml
> GET /public/crossdomain.xml HTTP/1.1
> User-Agent: curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/ libidn/1.15
> Host: localhost:5280
> Accept: */*
< HTTP/1.1 404 Not Found
< Content-Type: text/html; charset=utf-8
< Content-Length: 334

I have tried shuffling files, permissions, ownerships, paths, module
order, and all with never anything besides a 404.
/var/log/ejabberd/access.log is always empty and if I turn on debug
logging in ejabberd.cfg, the following logs are emitted to

=INFO REPORT==== 2010-09-16 16:05:49 ===
I(<0.361.0>:ejabberd_listener:232) : (#Port<0.3538>) Accepted
connection {{127,0,0,1},53736} -> {{127,0,0,1},5280}

=INFO REPORT==== 2010-09-16 16:05:49 ===
D(<0.379.0>:ejabberd_http:135) : S: [{["public"],mod_http_fileserver},

=INFO REPORT==== 2010-09-16 16:05:49 ===
I(<0.379.0>:ejabberd_http:137) : started: {gen_tcp,#Port<0.3538>}

=INFO REPORT==== 2010-09-16 16:05:49 ===
D(<0.379.0>:ejabberd_http:254) : (#Port<0.3538>) http query: 'GET'

=INFO REPORT==== 2010-09-16 16:05:49 ===
D(<0.379.0>:ejabberd_http:322) : ["public","crossdomain.xml"] matches ["public"]

=INFO REPORT==== 2010-09-16 16:05:49 ===
D(<0.379.0>:mod_http_fileserver:294) : Requested ["crossdomain.xml"]

So from my understanding, GET /public/ should map to /var/www/ejabberd
and the crossdomain.xml should be served from that directory. I hate
asking such a silly question and I'm wondering if anyone has seen
anything like this.

More information about the ejabberd mailing list