Search code examples
amazon-ec2xmppejabberd

cant run ejabberd on EC2 instance


I installed ejabberd on an ec2 instance, however I am facing multiple problems running it

  1. when I use my ip/5280/admin or ip/5280 i dont recieve a response. The other thing in my conf file i chose my host: ip (xx.xxx.xx.xx). When I check the status of ejabberd i recieve ejabberd@localhost is started with status : started
  2. The other thing when I run netstat I cant see that ejabberd is connected or running
  3. finally I check ejabberd log file. It has the following error: No certificate found matching 'pubsub.ip-xxx-xx-xx-xxx.ec2.internal': strictly configured clients or servers will reject connections with this host; obtain a certificate for this (sub)domain from any trusted CA such as Let's Encrypt (www.letsencrypt.org)

Any help will be apprieciated. I am running the latest version of ejabberd


Solution

    1. finally I check ejabberd log file. It has the following error: No certificate found matching

    Don't worry, that's a warning, I also get it and it doesn't break ejabberd. The important thing is to have something like this:

    ...
    12:33:00.546 [info] ejabberd 18.04.107 is started in the node ejabberd@localhost in 8.10s
    12:33:00.551 [info] Start accepting TCP connections at [::]:5280 for ejabberd_http
    12:33:00.551 [info] Start accepting TCP connections at [::]:5269 for ejabberd_s2s_in
    12:33:00.552 [info] Start accepting TCP connections at [::]:5222 for ejabberd_c2s
    12:33:00.552 [info] Application ejabberd started on node ejabberd@localhost
    
    1. The other thing when I run netstat I cant see that ejabberd is connected or running

    Maybe you are looking at the established connections, not the listening ports? This is my client connected to remote servers:

    $ netstat | grep xmpp
    tcp        0      0 192.168.1.14:39299      cookie.ziri:xmpp-client ESTABLISHED
    tcp        0      0 192.168.1.14:41867      lb.jabb.im:xmpp-client  ESTABLISHED
    tcp        0      0 192.168.1.14:33063      ec2-52-50-2:xmpp-client ESTABLISHED
    tcp        0      0 192.168.1.14:39769      cookie.ziri:xmpp-client ESTABLISHED
    

    And this is what you want to see, this is ejabberd listening for xmpp connections:

    $ netstat -l | grep xmpp
    tcp6       0      0 [::]:xmpp-client        [::]:*                  LISTEN     
    tcp6       0      0 [::]:xmpp-server        [::]:*                  LISTEN     
    
    1. when I use my ip/5280/admin or ip/5280 i dont recieve a response. The other thing in my conf file i chose my host: ip (xx.xxx.xx.xx).

    It's host:port/admin, not host/port/admin. See:

    $ wget -S --user=user1@localhost --password=mypass11 http://localhost:5280/admin/
    --2018-06-28 12:39:19--  http://localhost:5280/admin/
    S'està resolent localhost (localhost)... 127.0.0.1
    S'està connectant a localhost (localhost)|127.0.0.1|:5280... conectat.
    HTTP: s'ha enviat la petició, s'està esperant una resposta... 
      HTTP/1.1 401 Unauthorized
      Content-Type: text/html; charset=utf-8
      Content-Length: 333
      WWW-Authenticate: basic realm="ejabberd"
    Authentication selected: basic realm="ejabberd"
    S'està reutilitzant la connexió a localhost:5280.
    HTTP: s'ha enviat la petició, s'està esperant una resposta... 
      HTTP/1.1 200 OK
      Content-Type: text/html; charset=utf-8
      Content-Length: 1803
    Mida: 1803 (1,8K) [text/html]
    S'està desant a: «index.html»
    
    index.html                     100%[==================================================>]   1,76K  --.-KB/s    in 0s      
    
    2018-06-28 12:39:19 (85,8 MB/s) - s'ha desat «index.html» [1803/1803]
    
    $ head index.html 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http....