Created
June 6, 2013 18:43
-
-
Save mattkirwan/5723879 to your computer and use it in GitHub Desktop.
Vagrant bootstrap
This file contains hidden or 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
#!/bin/bash | |
# Update packages | |
yum update | |
# Add some repos | |
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm | |
# Install MySQL | |
yum -y --enablerepo=remi install mysql mysql-server | |
service mysqld start | |
/usr/bin/mysql_secure_installation < /vagrant/env/install_mysql_commands.txt | |
# Install supplies DB | |
#gzip -df /vagrant/env/tsi_e_stage.sql.gz | |
echo 'Installing Database....' | |
mysql -u root -proot < /vagrant/env/install_tsie_from_gzip.txt | |
echo 'Database successfully installed.' | |
# Nginx | |
yum -y --enablerepo=remi install nginx | |
service nginx start | |
# Git | |
yum -y --enablerepo=remi install git-core | |
# PHP | |
yum -y --enablerepo=remi install php php-cli php-fpm php-mysql php-devel php-pear | |
service php-fpm start | |
# PHP Configuration | |
cp -f /vagrant/env/support/php.ini /etc/php.ini | |
# Memcached PHP Library | |
pecl channel-update pecl.php.net | |
printf "\n" | pecl install memcached | |
# composer | |
curl -sS https://getcomposer.org/installer | php | |
mv composer.phar /usr/local/bin/composer | |
# Memcached | |
yum -y --enablerepo=remi install memcached | |
yum -y --enablerepo=remi install libmemcached-devel | |
service memcached start | |
# Configuration | |
cp -f /vagrant/env/support/nginx.conf /etc/nginx/nginx.conf | |
cp -f /vagrant/env/support/default.conf /etc/nginx/conf.d/default.conf | |
cp -f /vagrant/env/support/phpmyadmin.conf /etc/nginx/conf.d/phpmyadmin.conf | |
cp -f /vagrant/env/support/www.conf /etc/php-fpm.d/www.conf | |
cp -f /vagrant/env/support/phpfpm.conf /etc/php-fpm.d/ | |
# Start services on boot | |
chkconfig --levels 235 mysqld on | |
chkconfig --levels 235 nginx on | |
chkconfig --levels 235 php-fpm on | |
chkconfig --levels 235 memcached on | |
# Disable the default CentOS firewall | |
service iptables stop | |
chkconfig iptables off | |
# Restart our services | |
service nginx restart | |
service mysqld restart | |
service memcached restart | |
service php-fpm restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment