Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Elastic search
1. Setting up Elastic Search on
Ubuntu Server from scratch
By: Rahul Agarwal
Sr. web developer at
Gaadi.com
2. Overview
● Requirement
● Solution
● Set up server
● Install Apache
● Install PHP,JAVA
● Install Elastic Search server,Composer
● Install Elastic Search PHP API
● Test php scripts with elastic search api
3. Requirement
● Setting Up Elastic Search on the server.
With PHP and Apache server for front end
connection.
● Setting up on Ubuntu server.
9. Test PHP
● Run “php -r 'echo "nnYour PHP installation
is working fine.nnn";' "
10. Install Java
● Run “add-apt-repository -y
ppa:webupd8team/java"
● Run "apt-get update"
● Run "apt-get install oracle-java8-installer"
11. Install ElasticSearch server
● Run “sudo wget -qO -
https://packages.elastic.co/GPG-KEY-
elasticsearch | sudo apt-key add -"
● Run "echo "deb
http://packages.elastic.co/elasticsearch/2.x/
debian stable main" | sudo tee -a
/etc/apt/sources.list.d/elasticsearch-2.x.list"
● Run "sudo apt-get update"
● Run "sudo apt-get -y install elasticsearch"
12. Install ElasticSearch server
● Run "sudo nano
/etc/elasticsearch/elasticsearch.yml"
● You will want to restrict outside access to
your Elasticsearch instance (port 9200), so
outsiders can't read your data or shutdown
your Elasticsearch cluster through the HTTP
API. Find the line that specifies
network.host, uncomment it, and replace its
value with "localhost" so it looks like this:
● network.host: localhost
13. Install ElasticSearch server
● Save and exit elasticsearch.yml.
● Run "sudo service elasticsearch restart"
● Then run the following command to start
Elasticsearch on boot up:
● Run “ sudo update-rc.d elasticsearch
defaults 95 10"
14. Set up Elastic Search PHP files
● Run "cd /var/www/html"
● Upload composer file “composer.json” on the
folder /var/www/html
● Run
● curl -s http://getcomposer.org/installer | php
● php /root/composer.phar install –no-dev
● sudo apt-get install php5-curl
● sudo service apache2 restart
16. Test basic connection files
● Upload insert.php,out.txt,search.php on
/var/www/html folder
● Go to browser and hit insert.php
● Go to browser and hit search.php and search
google