Skip to content

Instantly share code, notes, and snippets.

@danielpataki
Last active February 23, 2019 21:40
Show Gist options
  • Save danielpataki/0861bf91430bf2be73da to your computer and use it in GitHub Desktop.
Save danielpataki/0861bf91430bf2be73da to your computer and use it in GitHub Desktop.
WordPress On Vagrant
User vagrant
Group vagrant
<VirtualHost *:80>
ServerName blog.local
DocumentRoot /var/www/blog
<Directory /var/www/blog>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
192.168.99.99 blog.local
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
sudo apt-get update
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'
sudo apt-get install -y vim curl python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
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
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
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
# -*- 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.99.99"
config.vm.provision :shell, :path => "install.sh"
config.vm.synced_folder ".", "/var/www"
end
curl -L -o 'install.sh' http://bit.ly/1hBfq57 && curl -L -o 'Vagrantfile' http://bit.ly/1mE3Qt9 && vagrant up
wp core config --dbuser=root --dbpass=root --dbname=blog
wp db create
wp core install --url=blog.local --title=Blog --admin_user=danielpataki --admin_password=secretpass [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment