Skip to content

Instantly share code, notes, and snippets.

@chrisyip
Created May 8, 2013 11:58
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save chrisyip/5539984 to your computer and use it in GitHub Desktop.
Save chrisyip/5539984 to your computer and use it in GitHub Desktop.
Vagrant shell script for LAMP.
#!/usr/bin/env bash
apt-get update
echo mysql-server-5.5 mysql-server/root_password password PASSWORD | debconf-set-selections
echo mysql-server-5.5 mysql-server/root_password_again password PASSWORD | debconf-set-selections
apt-get install -y mysql-common mysql-server mysql-client
apt-get install -y apache2
apt-get install -y php5 libapache2-mod-php5
apt-get install -y php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
apt-get install -y vim
/etc/init.d/apache2 restart
rm -rf /var/www
ln -fs /vagrant /var/www
@rgegriff
Copy link

Hey, I this is exactly what I need, awesome! Glad to see I was 80% there. Can you elaborate on lines 5 and 6?

@lvnilesh
Copy link

lvnilesh commented Sep 5, 2013

Lines 5,6 are passing default password value "PASSWORD" beforehand so mysql does not prompt during setup.

Read more at http://serverfault.com/questions/407317/passing-default-answers-to-apt-get-package-install-questions

@smitty1eGH
Copy link

I think you mis-spelled emacs on line 15. :-)

@smitty1eGH
Copy link

Thanks. For the barest-bones LAMP install, I just can't see dealing with Chef or Puppet.

@simonardejr
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment