-
Notifications
You must be signed in to change notification settings - Fork 3
Hide Elasticsearch behind Apache HTTP server
José Villaveces edited this page Nov 11, 2015
·
1 revision
- Elasticsearch instance up and running.
- Apache HTTP server. If you haven't install it already, you can get Apache installed on your server through apt-get:
sudo apt-get update
sudo apt-get install apache2
Install and enable mod_proxy
so Apache can forward requests to any ports you want:
apt-get install libapache2-mod-proxy-html
a2enmod proxy
a2enmod proxy_http
In this case we are going to edit Apache's default vhost
000-default.conf
.
- Open the file 000-default.conf
vi /etc/apache2/sites-available/default-000.conf
- Add a new location. You can copy an paste the code bellow, just replace
%your_location%
with the location you want to use.
#ProxyPass http://localhost:9200/
<Location /%your_location%>
ProxyPass http://localhost:9200/
ProxyPassReverse http://localhost:9200/
</Location>
- Save and close the file. If necessary restart Apache.
- In your browser try to access elastic search by navigating to
%your_location%
.
http://localhost/%your_location%