Skip to content

Instantly share code, notes, and snippets.

@duese
Created June 29, 2015 11:58
Show Gist options
  • Save duese/ab82600640515495df1f to your computer and use it in GitHub Desktop.
Save duese/ab82600640515495df1f to your computer and use it in GitHub Desktop.
Homestead extended bootstrap file ~/.homestead/after.sh
#!/bin/bash
# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
# Be sure to keep up to date with the files and default Settings
# if there is an update in the image the paths may change
# based upon laravel/homestead image for virtualbox version 0.2.7
# (via "vagrant box list")
if ! grep "max_execution_time = 300" /etc/php5/fpm/php.ini
then
cp -p /etc/php5/fpm/php.ini /etc/php5/fpm/php.ini.bak
sed -i '/max_execution_time = 30/c max_execution_time = 300' /etc/php5/fpm/php.ini
fi
if ! grep "request_terminate_timeout = 300" /etc/php5/fpm/pool.d/www.conf
then
cp -p /etc/php5/fpm/pool.d/www.conf /etc/php5/fpm/pool.d/www.conf.bak
sed -i '/;request_terminate_timeout = 0/c request_terminate_timeout = 300' /etc/php5/fpm/pool.d/www.conf
fi
if ! grep "fastcgi_read_timeout" /etc/nginx/nginx.conf
then
sed -e '/# Basic Settings/{:a;n;/^$/!ba;i\fastcgi_read_timeout 300;' -e '}' /etc/nginx/nginx.conf > /etc/nginx/nginx.conf.tmp
cp -p /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
mv /etc/nginx/nginx.conf.tmp /etc/nginx/nginx.conf
fi
# allow configuration of postgres from host
if ! grep "192.168.10.1" /etc/postgresql/9.4/main/pg_hba.conf
then
echo "host all all 192.168.10.1/32 md5" >> /etc/postgresql/9.4/main/pg_hba.conf
fi
# restart nginx, php, postgres to load new configuration
service php5-fpm restart
service nginx restart
service postgresql restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment