Skip to content

Instantly share code, notes, and snippets.

@Server4001 Server4001/after.sh
Last active May 30, 2016

Embed
What would you like to do?
Homestead after provisioning script setting up Beanstalkd, Supervisord, Elasticsearch, & PHP Drivers for ImageMagick and Memcached
#!/bin/sh
# Beanstalkd config
cat << EOF | sudo tee -a /etc/default/beanstalkd
BEANSTALKD_EXTRA="-b /var/lib/beanstalkd"
# Start at server boot:
START=yes
EOF
sudo service beanstalkd restart
# Supervisord config
sudo touch /etc/supervisor/conf.d/queue.conf
cat << EOF | sudo tee -a /etc/supervisor/conf.d/queue.conf
[program:laravel5queue]
command=/usr/bin/php artisan queue:work --daemon --tries=2
directory=/home/vagrant/laravel5
autostart=true
autorestart=true
startretries=3
stdout_logfile=/home/vagrant/laravel5/storage/logs/queue-supervisor.log
redirect_stderr=true
[program:larapressqueue]
command=/usr/bin/php artisan queue:work --daemon --tries=2
directory=/home/vagrant/larapress
autostart=true
autorestart=true
startretries=3
stdout_logfile=/home/vagrant/larapress/storage/logs/queue-supervisor.log
redirect_stderr=true
EOF
# Java Install
sudo apt-get update -y
sudo apt-get install -y build-essential rsync telnet screen man wget
sudo apt-get install -y strace tcpdump
sudo apt-get install -y libssl-dev zlib1g-dev libcurl3-dev libxslt-dev
sudo apt-get install -y software-properties-common python-software-properties
curl -L --cookie "oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u65-b17/jdk-7u65-linux-x64.tar.gz -o jdk-7-linux-x64.tar.gz
tar -xvf jdk-7-linux-x64.tar.gz
sudo mkdir -p /usr/lib/jvm
sudo mv ./jdk1.7.* /usr/lib/jvm/
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_65/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_65/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0_65/bin/javaws" 1
sudo chmod a+x /usr/bin/java
sudo chmod a+x /usr/bin/javac
sudo chmod a+x /usr/bin/javaws
sudo chown -R root:root /usr/lib/jvm/jdk1.7.0_65
rm jdk-7-linux-x64.tar.gz
java -version
# Elasticsearch Install
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.2.deb
sudo dpkg -i elasticsearch-1.5.2.deb
sudo /bin/systemctl enable elasticsearch.service
sudo service elasticsearch start
rm -rf ~/elasticsearch-1.5.2.deb
cat << EOF | sudo tee -a /etc/elasticsearch/elasticsearch.yml
network.bind_host: localhost
script.disable_dynamic: true
EOF
sudo service elasticsearch restart
# Memcache PHP Driver:
sudo pecl install memcache
cat << EOF | sudo tee -a /etc/php5/cli/php.ini
extension=memcache.so
EOF
cat << EOF | sudo tee -a /etc/php5/fpm/php.ini
extension=memcache.so
EOF
sudo service php5-fpm restart
# Imagemagick
sudo apt-get install -y imagemagick
sudo apt-get install -y php5-imagick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.