-
-
Save allenmoore/a7a231a385537285c180899b44d5e16e to your computer and use it in GitHub Desktop.
Create new VVV sites with WP CLI + wildcard hosts
This file contains 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
# create at /etc/dnsmasq.d/dev in the vagrant guest | |
address=/dev/127.0.0.1 |
This file contains 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
# 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; | |
} |
This file contains 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
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