[ejabberd] mod_rest

Badlop badlop at gmail.com
Thu Aug 24 11:55:09 MSK 2017


And what about the ejabberd log files?

There's a typo in your config file, see that blankspace in the string
of the first host:
hosts:
  - " mydomain"
  - "localhost"

If I make a mistake like this, ejabberd does not start, and complains:
...
10:52:45.575 [info] Loading configuration from /etc/ejabberd/ejabberd.yml
10:52:45.665 [error] Can't load config file: invalid host name [<<"
example.com">>]
10:52:45.666 [error] CRASH REPORT Process <0.64.0> with 0 neighbours
exited with reason: "invalid hostname" in application_mast
er:init/4 line 134
10:52:45.666 [info] Application ejabberd exited with reason: "invalid hostname"

---
Badlop
ProcessOne


On 23 August 2017 at 20:01, Ricky Gutierrez <xserverlinux at gmail.com> wrote:
> 2017-08-23 2:45 GMT-06:00 Badlop <badlop at gmail.com>:
>> Hi,
>>
>> I imagine you have something like this:
>> hosts:
>>  - "example.com"
>> But later in the wget query you send the request to "localhost". This
>> is what the error complains about.
>>
>> Two possible solutions:
>> A) Send the request to example.com, or whatever vhost you have enabled
>> in ejabberd.yml
>> B) Or add localhost to the list of vhosts served by ejabberd
>>
> Hi badlop , thank for you answer , I made the change and add the
> localhost in hosts:
>
> hosts:
>
>   - " mydomain"
>   - "localhost"
>
> I try to connect to wget and it does not work for me.
>
> Trying with my domain
>
> wget http://localhost:5285/rest/ --server-response --post-data
> '<message to=“ricardog at mydomain"
> from="mydomain/rest"><body>World</body></message>'
> --2017-08-23 11:54:05--  http://localhost:5285/rest/
> Resolving localhost (localhost)... ::1, 127.0.0.1
> Connecting to localhost (localhost)|::1|:5285... failed: Connection refused.
> Connecting to localhost (localhost)|127.0.0.1|:5285... connected.
> HTTP request sent, awaiting response...
>   HTTP/1.1 406 Not Acceptable
>   Content-Type: text/html; charset=utf-8
>   Content-Length: 43
> 2017-08-23 11:54:05 ERROR 406: Not Acceptable.
>
> Trying with localhost
>
> wget http://localhost:5285/rest/ --server-response --post-data
> '<message to=“ricardog at localhost"
> from="localhost/rest"><body>World</body></message>'
> --2017-08-23 11:50:34--  http://localhost:5285/rest/
> Resolving localhost (localhost)... ::1, 127.0.0.1
> Connecting to localhost (localhost)|::1|:5285... failed: Connection refused.
> Connecting to localhost (localhost)|127.0.0.1|:5285... connected.
> HTTP request sent, awaiting response...
>   HTTP/1.1 406 Not Acceptable
>   Content-Type: text/html; charset=utf-8
>   Content-Length: 43
> 2017-08-23 11:50:34 ERROR 406: Not Acceptable.
>
>
> I'm trying with something simple, I do not want to enter with
> something more complex according to your documentation of the module.
>
> regardss
>
>
>
> --
> rickygm
>
> http://gnuforever.homelinux.com
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd


More information about the ejabberd mailing list