Skip to content

Instantly share code, notes, and snippets.

@allenmoore
Forked from joshlevinson/WP CLI commands.sh
Last active December 30, 2016 13:49
Show Gist options
  • Save allenmoore/a7a231a385537285c180899b44d5e16e to your computer and use it in GitHub Desktop.
Save allenmoore/a7a231a385537285c180899b44d5e16e to your computer and use it in GitHub Desktop.
Create new VVV sites with WP CLI + wildcard hosts
# create at /etc/dnsmasq.d/dev in the vagrant guest
address=/dev/127.0.0.1
# create in your vagrant directory @ config/nginx/sites/wildcard.conf
# this dir is copied during provision, if you don't want to re-provision, run this in a vagrant shell:
# sudo rsync -rvzh --delete /srv/config/nginx-config/sites/ /etc/nginx/custom-sites/
server {
listen 80;
listen 443 ssl;
server_name ~^(?<name>.*)\.dev;
root /srv/www/$name/htdocs;
include /etc/nginx/nginx-wp-common.conf;
}
vagrant ssh
cd /srv/www/
mkdir site-name && cd site-name && touch vvv-hosts && echo "site-name.dev" >> vvv-hosts && touch wp-cli.yml && echo "path: htdocs" >> wp-cli.yml && mkdir htdocs && cd htdocs
wp core download
wp core config --dbname=site-name --dbuser=root --dbpass=root
wp db create
wp core install --url=site-name.dev --title=Site --admin_user=admin --admin_password=password [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment