Last active
January 8, 2016 19:41
-
-
Save kevindees/c70fd2418f9bca5d721c to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
apt-get update | |
apt-get -y upgrade | |
apt-get install -y debconf-utils | |
export DEBIAN_FRONTEND="noninteractive" | |
# tools | |
apt-get -y install git | |
# apt-get install -y build-essential | |
# apt-get install -y zlib1g-dev sqlite3 | |
# LAMP | |
apt-get install -y apache2 | |
# install mysql and give password to installer | |
debconf-set-selections <<< "mysql-server mysql-server/root_password password password" | |
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password password" | |
apt-get -y install mysql-server | |
apt-get install -y mysql-client | |
apt-get install -y php5 | |
apt-get install -y php5-mysql | |
apt-get install -y php5-curl | |
apt-get install -y php5-xdebug | |
# set | |
if ! [ -L /var/www ]; then | |
rm -rf /var/www/html | |
ln -fs /vagrant /var/www/html | |
fi | |
sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf | |
sed -i 's/www.example.com/\n<Directory \"\/var\/www\/html">\nAllowOverride All\n<\/Directory>/' /etc/apache2/sites-available/000-default.conf | |
cat <<EOT >> /etc/php5/apache2/conf.d/20-xdebug.ini | |
xdebug.remote_enable = on | |
xdebug.remote_connect_back = on | |
xdebug.idekey ="vagrant" | |
EOT | |
# enable mod_rewrite | |
a2enmod rewrite | |
# config | |
sudo echo "AllowTcpForwarding yes" >> /etc/ssh/sshd_config | |
# restart | |
service apache2 restart | |
service mysql stop | |
service mysql start | |
# install Composer | |
curl -s https://getcomposer.org/installer | php | |
mv composer.phar /usr/local/bin/composer | |
# import database | |
echo "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password'; create database test; exit;" | mysql -u root -ppassword |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment