This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "precise64-dev" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Show PHP errors | |
sed -i -r -e 's/short_open_tag = On/short_open_tag = Off/g' /etc/php5/fpm/php.ini | |
sed -i -r -e 's/error_reporting = E_ALL & ~E_DEPRECATED/error_reporting = E_ALL | E_STRICT/g' /etc/php5/fpm/php.ini | |
sed -i -r -e 's/display_errors = Off/display_errors = On/g' /etc/php5/fpm/php.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set a helpful hostname as a convenient reference. | |
echo "project-name" > /etc/hostname | |
echo "127.0.0.1 project-name" >> /etc/hosts | |
hostname project-name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "--> Creating a fresh database..." | |
mysql -uroot --execute "DROP DATABASE IF EXISTS <db_name>; CREATE DATABASE <db_name> CHARACTER SET utf8 COLLATE utf8_unicode_ci;" | |
echo "<-- Complete." | |
echo "--> Configuring SSH access to production resources for `id -un`..." | |
mkdir ~/.ssh | |
cp /vagrant/.ssh/<name>.pem ~/.ssh | |
chmod 700 ~/.ssh | |
chmod 600 ~/.ssh/* | |
SSH_OPTIONS='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Varnish | |
if [ -z `command -v varnishd` ]; then | |
echo -n "Installing varnish (http://www.varnish-cache.org)..." | |
# curl http://repo.varnish-cache.org/debian/GPG-key.txt | sudo apt-key add - > /dev/null | |
# echo "deb http://repo.varnish-cache.org/ubuntu/ precise varnish-3.0" | sudo tee -a /etc/apt/sources.list > /dev/null | |
apt-get install varnish -qq -y > /dev/null | |
echo "complete." | |
else | |
echo "Varnish is aleady installed." | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate a self-signed certificate | |
echo -n "Generating a self-signed SSL cert..." | |
openssl req -new -x509 -days 365 -subj "/C=US/ST=MD/L=Baltimore/O=Rob Wilkerson Consulting, LLC/CN=*.MYDOMAIN.COM" -nodes -out /etc/ssl/certs/wildcard-cert.pem -keyout /etc/ssl/private/wildcard-cert.key | |
echo "complete." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tweak the Nginx conf. sendfile is broken on Virtualbox. | |
echo -n "Setting the Nginx configuration..." | |
sed -i -r -e 's/sendfile\s*on/sendfile off/g' /etc/nginx/nginx.conf | |
sed -i -r -e 's/^(\s*)#\s*gzip on(.*)$/\1gzip on\2/' /etc/nginx/nginx.conf | |
sed -i -r -e 's/^(\s*)#\s*gzip_types(.*)$/\1gzip_types\2/' /etc/nginx/nginx.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if grep -Fxq 'memcache.hash_strategy="consistent"' /etc/php5/conf.d/memcache.ini; then | |
echo "Memcache configuration updates have already been made." | |
else | |
echo -n "Updating the memcached config..." | |
echo 'memcache.hash_strategy="consistent"' >> /etc/php5/conf.d/memcache.ini | |
echo "complete." | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installing dnsmasq so that loopback communication using the site URL doesn't fail. | |
if [ ! -e '/etc/dnsmasq.conf' ]; then | |
echo -n "Installing and configuring DNSMasq..." | |
apt-get install dnsmasq -qq -y > /dev/null 2>&1 | |
cat >> /etc/dnsmasq.conf << "EOF" | |
address=/.umassmemorial.org/127.0.0.1 | |
listen-address=127.0.0.1 | |
EOF | |
sed -i -r -e 's/^(\s*)#(\s*prepend domain-name-servers\s+.*)$/\1\2/' /etc/dhcp/dhclient.conf | |
service dnsmasq restart > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -n "Installing compass (http://compass-style.org)..." | |
apt-get update -qq -y | |
apt-get install ruby1.9.1 -qq -y > /dev/null | |
gem install rubygems-update > /dev/null | |
update_rubygems > /dev/null | |
gem install compass > /dev/null | |
echo "complete." |