Created
June 23, 2015 09:31
-
-
Save bonsi/184aad905c814e499c20 to your computer and use it in GitHub Desktop.
Vagrant - Debian / MySQL / Dotdeb / PHP bootstrap
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
| print_header () | |
| { | |
| echo "." | |
| echo "###################################################################" | |
| echo "### $1 ..." | |
| echo "###################################################################" | |
| } | |
| ############################################################################ | |
| print_header "updating + upgrading debian packages" | |
| sudo apt-get update -y | |
| print_header "!!!! DISABLED apt-get upgrade for now" | |
| #sudo apt-get upgrade -y | |
| ### install some standard packages | |
| #------------------------------------------------------------------------------------------------- | |
| print_header "installing standard debian packages" | |
| sudo apt-get install -y vim curl python-software-properties | |
| # sudo add-apt-repository -y ppa:ondrejphp5 | |
| # sudo apt-get update | |
| ### MySQL | |
| #------------------------------------------------------------------------------------------------- | |
| print_header "setting MySQL credentials" | |
| 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' | |
| ### adding the Dotdeb repository | |
| #------------------------------------------------------------------------------------------------- | |
| print_header "adding dotdeb repository" | |
| #### SKIPPING dotdeb php 5.6 for now since it lacks php-xdebug | |
| # cat << EOT | sudo tee /etc/apt/sources.list.d/dotdeb.list | |
| # deb http://packages.dotdeb.org wheezy all | |
| # deb-src http://packages.dotdeb.org wheezy all | |
| # deb http://packages.dotdeb.org wheezy-php56 all | |
| #deb-src http://packages.dotdeb.org wheezy-php56 all | |
| #EOT | |
| cat << EOT | sudo tee /etc/apt/sources.list.d/dotdeb.list | |
| deb http://packages.dotdeb.org wheezy all | |
| deb-src http://packages.dotdeb.org wheezy all | |
| deb http://packages.dotdeb.org wheezy-php55 all | |
| deb-src http://packages.dotdeb.org wheezy-php55 all | |
| EOT | |
| sudo wget -O ~/dotdeb.gpg http://www.dotdeb.org/dotdeb.gpg | |
| sudo apt-key add ~/dotdeb.gpg | |
| sudo rm ~/dotdeb.gpg | |
| print_header "running apt-get update" | |
| sudo apt-get update | |
| ### Apache / PHP (dotdeb) | |
| #------------------------------------------------------------------------------------------------- | |
| print_header "installing Apache + dotdeb PHP" | |
| sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt php5-readline mysql-server-5.5 php5-mysql git-core php5-xdebug | |
| cat << EOF | sudo tee -a /etc/php5/mods-available/xdebug.ini | |
| xdebug.scream=1 | |
| xdebug.cli_color=1 | |
| xdebug.show_local_vars=1 | |
| EOF | |
| sudo a2enmod rewrite | |
| sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php5/apache2/php.ini | |
| sed -i "s/display_errors = .*/display_errors = On/" /etc/php5/apache2/php.ini | |
| sed -i "s/disable_functions = .*/disable_functions = /" /etc/php5/cli/php.ini | |
| sudo service apache2 restart | |
| ### PHP Composer install | |
| #------------------------------------------------------------------------------------------------- | |
| print_header "installing PHP Composer" | |
| curl -sS https://getcomposer.org/installer | php | |
| sudo mv composer.phar /usr/local/bin/composer | |
| ### Webmin install | |
| #------------------------------------------------------------------------------------------------- | |
| print_header "installing Webmin" | |
| cat << EOT | sudo tee /etc/apt/sources.list.d/webmin.list | |
| deb http://download.webmin.com/download/repository sarge contrib | |
| deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib | |
| EOT | |
| sudo wget -O ~/jcameron-key.asc http://www.webmin.com/jcameron-key.asc | |
| sudo apt-key add ~/jcameron-key.asc | |
| sudo rm ~/jcameron-key.asc | |
| sudo apt-get update -y | |
| sudo apt-get install -y webmin | |
| ### Aliases | |
| #------------------------------------------------------------------------------------------------- | |
| print_header "creating aliases" | |
| cat << EOT >> /home/vagrant/.profile | |
| alias la='ls -hal' | |
| EOT | |
| cat << EOT | sudo tee -a ~/.profile | |
| alias la='ls -hal' | |
| EOT | |
| print_header " ---=> DONE!" | |
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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
| VAGRANTFILE_API_VERSION = "2" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| config.vm.box = "chef/debian-7.4" | |
| config.vm.box_url = "https://vagrantcloud.com/chef/boxes/debian-7.4/versions/1/providers/virtualbox.box" | |
| config.vm.network :private_network, ip: "192.168.56.10" | |
| config.vm.provision :shell, :path => "bootstrap.sh" | |
| config.vm.synced_folder "./wwwsites", "/var/www" | |
| config.vm.provider "virtualbox" do |v| | |
| v.customize ["modifyvm", :id, "--vram", "15"] | |
| end | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment