title: Couldn't connect to host, Elasticsearch down? 500 Internal Server Error - HttpException
body: <p>I am working in my project in 2 different servers. The code is cloned from bitbucket so is exactly the same, but in one of them I get this error on every HTTP request:</p>
  
  <pre><code>Couldn't connect to host, Elasticsearch down?
  500 Internal Server Error - HttpException
  </code></pre>
  
  <p>S.O. Ubuntu 16.04</p>
  
  <p>When I run <code>service elasticsearch status</code> I get this:</p>
  
  <pre><code>    elasticsearch.service - LSB: Starts elasticsearch
     Loaded: loaded (/etc/init.d/elasticsearch; bad; vendor preset: enabled)
     Active: active (exited) since Sun 2017-01-15 11:05:25 CET; 1h 16min ago
       Docs: man:systemd-sysv-generator(8)
    Process: 1366 ExecStart=/etc/init.d/elasticsearch start (code=exited, status=0
  
  Jan 15 11:05:25 ubuntu systemd[1]: Starting LSB: Starts elasticsearch...
  Jan 15 11:05:25 ubuntu systemd[1]: Started LSB: Starts elasticsearch.
  </code></pre>
  
  <p>When I run <code>fos:elastica:populate</code> I got this error:</p>
  
  <pre><code>[Elastica\Exception\Connection\HttpException]
  Couldn't connect to host, Elasticsearch down?
  </code></pre>
  
  <p>And running <code>curl -XGET http://127.0.0.1:9200</code> I get</p>
  
  <pre><code>curl: (7) Failed to connect to 127.0.0.1 port 9200: Connection refused
  </code></pre>
  
  <p>I was searching for 5 days and think this issue is something about permissions.</p>