I have been working on a WordPress website that communicates with an Elastic Search server through the Elastic Press plugin to index and retrieve the data. EP uses WP-CLI to communicate with the ES server by the way.
Locally it works fine an worked from the beginning. I moved the site to the server today, and.. it doesn’t work. I tried to see what is happening, and in the plugin, on connecting to the server I am getting this:
array(5) {["headers"]=> array(4) {
["cache-control"]=> string(8) "no-cache"
["connection"]=> string(5) "close"
["content-type"]=> string(9) "text/html"
["www-authenticate"]=> string(23) "Basic realm="basicauth""
}
["body"]=> string(112) "<html><body><h1>401 Unauthorized</h1>You need a valid user and password to access this content.</body></html>"
["response"]=> array(2) { ["code"]=> int(401), ["message"]=> string(12) "Unauthorized" } ["cookies"]=> array(0) {} ["filename"]=> NULL
}
The EP_HOST you’re supposed to have in WP is of the format https://username:password@domain.com:30XXX so it sends the username and password.
Using wget or curl on this url works fine from SSH, so the server talks with the ES server.
I was thinking it might be from the Apache version, but I am not sure.
Currently, the server is a Ubuntu OS with Apache/2.4.7
Any ideas? Thanks in advance!