Skip to content

Instantly share code, notes, and snippets.

@andrey-hohlov
Created April 18, 2017 11:14
Show Gist options
  • Save andrey-hohlov/dfa7c94d2d91822eb07f0d2fdabe489c to your computer and use it in GitHub Desktop.
Save andrey-hohlov/dfa7c94d2d91822eb07f0d2fdabe489c to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -y install software-properties-common
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:nginx/stable
sudo apt-get -y update
sudo apt-get upgrade
# Install packages
echo postfix postfix/main_mailer_type select Internet Site | debconf-set-selections
echo postfix postfix/mailname string vagrant | debconf-set-selections
echo mysql-server mysql-server/root_password password root | debconf-set-selections
echo mysql-server mysql-server/root_password_again password root | debconf-set-selections
apt_package_list=(
curl
git
imagemagick
libapache2-mod-php5
mariadb-client
mariadb-server
mcrypt
memcached
nginx
php
php5-cgi
php5-cli
php5-common
php5-curl
php5-dev
php5-fpm
php5-imagick
php5-mcrypt
php5-memcache
php5-mysql
php-pear
postfix
)
sudo apt-get install --assume-yes ${apt_package_list[@]}
sudo apt-get clean
# Install Composer
sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
# https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
# Virtual hosts config
sudo cp /vagrant/provision/config/nginx/nginx.conf /etc/nginx/nginx.conf
sudo cp /vagrant/provision/config/nginx/host.conf /etc/nginx/sites-available/host.conf
ln -s /etc/nginx/sites-available/host.conf /etc/nginx/sites-enabled/host.conf
sudo service apache2 stop
sudo php5enmod mcrypt
sudo service nginx restart
sudo service php5-fpm restart
# WP-CLI
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
# Install packages
cd /vagrant
composer install
cd /vagrant/web/app/themes/sibvaleo-tv
composer install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment