Last active
August 29, 2015 14:17
-
-
Save shadyvb/0f6255196b414650a046 to your computer and use it in GitHub Desktop.
Adding a custom NEW site in VVV
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
# navigate to VVV/www folder | |
cd /path/to/vvv/www | |
# ssh into vagrant | |
vagrant ssh | |
# cd to www directory | |
cd /srv/www | |
# create a directory for the new site | |
mkdir -p mysite/www | |
cd mysite/www | |
# create database and necessary permissions | |
sudo su | |
mysqladmin create mysite; | |
echo "grant all on mysite.* to mysite@% identified by 'mysite';" | mysql | |
exit | |
# install the new site, with the version you need, or omit the --version for the latest one | |
wp core download --version=3.5.2 | |
wp core config --dbname=mysite --dbuser=mysite --dbpass=mysite | |
wp core install --url=vvv.mysite.com --title=MySite --admin_user=me --admin_password=mysitesimplepassword [email protected] | |
# install vvv files to use with vagrant | |
echo 'vvv.mysite.com' > ../vvv-hosts | |
echo 'server {| listen 80;| listen 443 ssl;| server_name vvv.mysite.com;| root /srv/www/mysite/www;| include /etc/nginx/nginx-wp-common.conf;|}' | tr "|" "\n" | sudo tee /etc/nginx/custom-sites/vvv.mysite.com.conf | |
# exit vagrant ssh | |
exit | |
# install vagrant-hostsupdater if you haven't already | |
vagrant plugin install vagrant-hostsupdater | |
# reload vagrant so the site would work and vvv would acknowledge the custom domain | |
vagrant reload --provision | |
# visit the site in your browser, and if it does not resolve still: | |
echo '192.168.50.4 vvv.mysite.com' | sudo tee -a /etc/hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment