Skip to content

Instantly share code, notes, and snippets.

@kazoo0217
Created October 30, 2014 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kazoo0217/6b64e575f0874378c947 to your computer and use it in GitHub Desktop.
Save kazoo0217/6b64e575f0874378c947 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
## Auto Install Sequence and configuration for LAMP ##
# update packages
apt-get update >/dev/null 2>&1
# edit password
MYSQL_PASSWORD="password"
# install mysql
echo "mysql-server-5.5 mysql-server/root_password password $MYSQL_PASSWORD" | debconf-set-selections
echo "mysql-server-5.5 mysql-server/root_password_again password $MYSQL_PASSWORD" | debconf-set-selections
apt-get -y install mysql-client mysql-server >/dev/null 2>&1
# install http server, php5, mysql
apt-get -y install apache2 php5 libapache2-mod-php5 php5-mysql >/dev/null 2>&1
# Enable mod_rewrite
a2enmod rewrite
# restart apache2
service apache2 restart
# Set DocumentRoot
rm -rf /var/www/html
ln -fs /vagrant /var/www/html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment