ElasticSearch and Apache setup

Discussion in 'Installation/Configuration' started by brody182, Jan 1, 2020.

  1. brody182

    brody182 Member

    I want to use TLS and HTTP Basic authentication together prevents anyone from intercepting communication with Elasticsearch. How do I do it?

    1) htpasswd -c /usr/local/apache/password/.htpasswd_elasticsearch magento_elasticsearch

    2) Set up proxy for apache 2.4

    1. Listen 8080
    2. /etc/apache2/sites-available/000-default.conf

      <VirtualHost *:8080>
      ProxyPass "/" "http://localhost:9200/"
      ProxyPassReverse "/" "http://localhost:9200/"

      3) Secure communication with Apache
    <Proxy *>
       Order deny,allow
       Allow from all
       AuthType Basic
       AuthName "Elastic Server"
       AuthBasicProvider file
       AuthUserFile /usr/local/apache/password/.htpasswd_elasticsearch
       Require valid-user
      # This allows OPTIONS-requests without authorization
      <LimitExcept OPTIONS>
           Require valid-user

Share This Page