Created
October 3, 2014 08:32
-
-
Save mtharrison/daa1e4bcccb31b388eaf 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
#!/bin/bash | |
export DEBIAN_FRONTEND=noninteractive | |
echo mysql-server mysql-server/root_password password strangehat | sudo debconf-set-selections | |
echo mysql-server mysql-server/root_password_again password strangehat | sudo debconf-set-selections | |
# Install required packages | |
sudo apt-get install make | |
sudo apt-get -y install autoconf | |
sudo apt-get -f -y update | |
sudo apt-get install -y php5-common libapache2-mod-php5 php5-cli php5-mysql php5-curl | |
sudo apt-get -y install vim | |
sudo apt-get -f -y install curl | |
sudo apt-get -f -y -q install mysql-server | |
sudo apt-get -f -y install git | |
sudo rm -rf /var/www | |
sudo ln -s /vagrant /var/www | |
# Enable mod rewrite and restart the server | |
sudo a2enmod rewrite | |
sed -i.bak 's/AllowOverride\ None/AllowOverride\ All/g' /etc/apache2/sites-enabled/000-default | |
sudo chown vagrant /var/lock/apache2 | |
sudo /bin/sh -c 'echo "export APACHE_RUN_USER=vagrant" >> /etc/apache2/envvars' | |
sudo /bin/sh -c 'echo "export APACHE_RUN_GROUP=vagrant" >> /etc/apache2/envvars' | |
sudo service apache2 restart | |
#Set webserver to run as vagrant user | |
echo "User vagrant" >> "/etc/apache2/httpd.conf" | |
echo "Group vagrant" >> "/etc/apache2/httpd.conf" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment