Created
August 6, 2015 14:25
-
-
Save jimjamdev/4e4be755aab8c4f7bb75 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
apt-get update | |
apt-get install -y apache2 libapache2-mod-php5 php5-cli php5-mysql php5-curl php5-mcrypt | |
apt-get install -y curl | |
a2enmod php5 | |
# Add ServerName to httpd.conf | |
echo "ServerName localhost" > /etc/apache2/httpd.conf | |
# Setup hosts file | |
VHOST=$(cat <<EOF | |
<VirtualHost *:80> | |
DocumentRoot "/vagrant" | |
ServerName localhost | |
<Directory "/vagrant"> | |
AllowOverride All | |
Allow from All | |
</Directory> | |
</VirtualHost> | |
EOF | |
) | |
echo "${VHOST}" > /etc/apache2/sites-enabled/000-default | |
# Enable mod_rewrite | |
a2enmod rewrite | |
# Restart apache | |
service apache2 restart | |
if ! [ -L /var/www ]; then | |
rm -rf /var/www | |
ln -fs /vagrant /var/www | |
fi | |
mkdir /home/vagrant/.ssh | |
wget --no-check-certificate -O authorized_keys 'https://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' | |
mv authorized_keys /home/vagrant/.ssh | |
chown -R vagrant /home/vagrant/.ssh | |
chmod -R go-rwsx /home/vagrant/.ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment