Recently I started working on a Laravel project that requires integration with Elasticsearch search engine. I didn’t want to change super cool development environment that Taylor (creator of Laravel) so kindly provided to us, so I installed Elasticsearch on Homestead instead of creating a new Vagrant box specially for this project. Here is a little snippet that will help you if you want to use Elasticsearch in you Laravel application.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# Login as root root@homestead:~# sudo -s # Update Aptitude root@homestead:~# apt-get update # Install Java root@homestead:~# apt-get install openjdk-7-jre-headless -y # Download and install Elasticsearch Public Signing Key root@homestead:~# wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - # Add repository root@homestead:~# echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list # Update Aptitude root@homestead:~# apt-get update # Install Elasticsearch root@homestead:~# apt-get install elasticsearch # Set Elasticsearch to run on startup root@homestead:~# update-rc.d elasticsearch defaults 95 10 # Start Elasticsearch server root@homestead:~# /etc/init.d/elasticsearch start |