-
Create a customer folder (optional)
mkdir vagrant && cd vagrant
-
Clone Vagrant into this folder:
git clone https://github.com/drivdigital/driv-vagrant .
-
Create a new subfolder for vagrant folder, this folder should have the same name as a dev URL (eg website.dev)
mkdir website.dev
-
Make sure /etc/hosts is writeable
sudo chmod 777 /etc/hosts
4.1 (Alternative) Enter the host file via terminal command:sudo vim /etc/hosts
- Entering the Insert mode, command:
i
- Add dev URL for customer list that appears
127.0.0.1 website.dev
- Exiting the insert-mode by pressing
ESC
- Save and exit the host file, command:
:wq!
- Entering the Insert mode, command:
-
Start Vagrant, command:
vagrant up
-
Go to browser and visit the URL with the dev port 8080:
http://website.dev:8080
-
Install WordPress site as usual.
-
At the end of the working day, save the database if you want to take care of this, the command:
vagrant ssh -c "cd /vagrant && ./save-db"
-
To stop the vagrant, use
vagrant halt
. If you don't stop it, the next time your usevagrant up
you should provision withvagrant up --provision
Note: If using
wp-cli
to manage this wordpress install, you must do so by runningvagrant ssh
,cd website.dev
then runwp
commands
-
Create a customer folder (optional)
mkdir vagrant && cd vagrant
-
Clone Vagrant into this folder:
git clone https://github.com/drivdigital/driv-vagrant
-
Clone into the Vagrant folder, remember to rename the folder to the same name as a dev URL (eg website.dev)
-
Get
wp-config.php
and put it in the root of newly created customer folder or create new. -
Open
wp-config
and give the correctdb-name
, Changedb_user
toroot
and setdb_password
as empty. -
Create a subfolder for vagrant folder and name it
config
.- Copy database file in this folder
- Make sure the database file's name is the same as the vagrant URL, eg:
website.sql
-
Change Site URL and home to correct dev URL by creating
dev.sql
file. Enter update statement in dev.sql file URL. For example:USE database_name; UPDATE wp_options SET option_value = 'http://website_name:8080' WHERE option_name in ('home', 'siteurl'); UPDATE wp_users SET user_pass = MD5( 'vagrant' );
-
Make sure /etc/hosts is writeable
sudo chmod 777 /etc/hosts
8.1 (Alternative) Enter the host file via terminal command:sudo vim /etc/hosts
- Entering the Insert mode, command:
i
- Add dev URL for customer list that appears
127.0.0.1 website.dev
- Exiting the insert-mode by pressing
ESC
- Save and exit the host file, command:
:wq!
- Entering the Insert mode, command:
-
Start Vagrant, command:
vagrant up
-
Go to browser and visit the URL with the dev port 8080:
http://website.dev:8080
-
Visit
wp-admin -> settings -> permalinks
to flush permalinks -
At the end of the working day, save the database if you want to take care of this, the command:
vagrant ssh -c "cd /vagrant && ./save-db"
-
To stop the vagrant, use
vagrant halt
. If you don't stop it, the next time your usevagrant up
you should provision withvagrant up --provision
Note: If using
wp-cli
to manage this wordpress install, you must do so by runningvagrant ssh
,cd your folder.dev
then runwp
commands