Created
December 31, 2015 14:36
-
-
Save stoppert/d8e343c336cae339ff0c to your computer and use it in GitHub Desktop.
Simple Vagrant setup, install.sh installs php, mysql db and apache
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 | |
| echo "--- Good morning, master. Let's get to work. Installing now. ---" | |
| echo "--- Updating packages list ---" | |
| sudo apt-get update | |
| echo "--- MySQL time ---" | |
| 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' | |
| echo "--- Installing base packages ---" | |
| sudo apt-get install -y vim curl python-software-properties | |
| echo "--- We want the bleeding edge of PHP, right master? ---" | |
| sudo add-apt-repository -y ppa:ondrej/php5 | |
| echo "--- Updating packages list ---" | |
| sudo apt-get update | |
| echo "--- Installing PHP-specific packages ---" | |
| sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt mysql-server-5.5 php5-mysql git-core | |
| echo "--- Installing and configuring Xdebug ---" | |
| sudo apt-get install -y 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 | |
| echo "--- Enabling mod-rewrite ---" | |
| sudo a2enmod rewrite | |
| echo "--- Setting document root ---" | |
| sudo sed -i "s/html/public/" /etc/apache2/sites-available/000-default.conf | |
| echo "--- What developer codes without errors turned on? Not you, master. ---" | |
| sudo sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php5/apache2/php.ini | |
| sudo sed -i "s/display_errors = .*/display_errors = On/" /etc/php5/apache2/php.ini | |
| sudo sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf | |
| echo "--- Restarting Apache ---" | |
| sudo service apache2 restart | |
| echo "--- Composer is the future. But you knew that, did you master? Nice job. ---" | |
| curl -sS https://getcomposer.org/installer | php | |
| sudo mv composer.phar /usr/local/bin/composer | |
| # Laravel stuff here, if you want | |
| echo "--- All set to go! Would you like to play a game? ---" |
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 = "precise64" | |
| config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
| config.vm.network :private_network, ip: "192.168.33.21" | |
| config.vm.provision :shell, :path => "install.sh" | |
| config.vm.synced_folder ".", "/var/www", | |
| owner: "vagrant", | |
| group: "www-data", | |
| mount_options: ["dmode=775,fmode=664"] | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment