Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pteich
Created October 22, 2014 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pteich/7ed6b11410916513969e to your computer and use it in GitHub Desktop.
Save pteich/7ed6b11410916513969e to your computer and use it in GitHub Desktop.
Bootstrap to setup up Vagrant Ubuntu Box with Apache, PHP, ElasticSearch, Beanstalkd and Beanstalk workers via Supervisord
#!/usr/bin/env bash
sudo apt-get install mc -y
wget -qO - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb http://packages.elasticsearch.org/elasticsearch/1.3/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch.list
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
sudo apt-get install elasticsearch -y
sudo apt-get install php5-curl -y
sudo /usr/share/elasticsearch/bin/plugin -install mobz/elasticsearch-head
sudo update-rc.d elasticsearch defaults 95 10
sudo /etc/init.d/elasticsearch start
sudo apt-get install beanstalkd -y
sudo perl -pi -e 's/DocumentRoot \/var\/www\/html/DocumentRoot \/var\/www\/html\/public/g' /etc/apache2/sites-enabled/000-default.conf
sudo /etc/init.d/apache2 restart
sudo perl -pi -e 's/#START=yes/START=yes/g' /etc/default/beanstalkd
sudo /etc/init.d/beanstalkd start
sudo apt-get install supervisor -y
echo "[program:searchqueue]
command=php index.php queue beanstalkd searchQueue
directory=/var/www/html/public
numprocs=3
process_name=%(program_name)s_%(process_num)s
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisord.log" | sudo tee -a /etc/supervisor/conf.d/myqueue.conf
sudo /etc/init.d/supervisor restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment