Last active
August 29, 2015 14:22
-
-
Save zolem/c0a565bc4efd7c43268a to your computer and use it in GitHub Desktop.
Install LAMP server and enable needed mods
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
echo "Installing a LAMP server and php5-dev..." | |
##### Preseed options to ignore prompt ##### | |
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password root" | |
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password root" | |
##### Easiest was to use the tasksel lamp server option ##### | |
sudo apt-get install lamp-server^ php5-dev -y | |
##### Enable any mods for the environment ##### | |
sudo a2enmod expires | |
sudo a2enmod rewrite | |
sudo a2enmod headers | |
sudo a2enmod ssl | |
sudo sh -c "echo 'SetEnv ENVIRONMENT test' >> /etc/apache2/apache2.conf" | |
sudo sh -c "echo 'ServerName localhost' >> /etc/apache2/apache2.conf" | |
sudo ln -s /vagrant /var/www/vagrant | |
echo "Updating VHOSTS" | |
if [ -d /vagrant/vhosts ] ; then | |
for f in /vagrant/vhosts/*.conf | |
do | |
b=$(basename $f) | |
sudo cp -v $f /etc/apache2/sites-available/$b | |
sudo a2ensite $b | |
echo "Added vhost $b" | |
done | |
fi | |
sudo service apache2 restart | |
echo "LAMP Server installation complete!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment