WSUWP Indie Development
A development environment for working with individual WordPress sites on WSUWP Indie.
Provisioning for this environment is pulled from WSU Web Provisioner and is intended to be a match with the server provisioning used in production.
- Install VirtualBox
- Install Vagrant
- Clone WSUWP Indie Development
- Add projects (see instructions below)
vagrant plugin install vagrant-hostsupdater
vagrant plugin install vagrant-hosts
Required Local Data
pillar/sites.sls file should be created with a
wsuwp-indie-sites property containing the following data structure:
wsuwp-indie-sites: site1.wsu.edu: directory: site1.wsu.edu database: site1_db_name nginx: server_name: dev.site1.wsu.edu site2.wsu.edu: directory: site2.wsu.edu database: site2_db_name nginx: server_name: dev.site2.wsu.edu
This pillar data is provided to provisioning and helps in database creation and determining where the server will look to find your project files.
Optional Local Data
In the same
pillar/sites.sls file, additional values can be specified to enable more complex setups.
wsuwp-indie-sites: site1.wsu.edu: directory: site1.wsu.edu database: site1_db_name db_user: user db_pass: password db_host: 127.0.0.1 batcache: true cache_key: site1_wsu nginx: server_name: dev.site1.wsu.edu config: manual nonces: | define('AUTH_KEY', 'uniquekeygoeshere'); define('SECURE_AUTH_KEY', 'uniquekeygoeshere'); define('LOGGED_IN_KEY', 'uniquekeygoeshere'); define('NONCE_KEY', 'uniquekeygoeshere'); define('AUTH_SALT', 'uniquekeygoeshere'); define('SECURE_AUTH_SALT', 'uniquekeygoeshere'); define('LOGGED_IN_SALT', 'uniquekeygoeshere'); define('NONCE_SALT', 'uniquekeygoeshere');
db_hostcan all be used to configure different database settings for the WordPress site.
batcacheis assumed to be false. If specified as
trueas in the example above, Batcache will be used to provide a page cache.
cache_keyshould be a short, unique value to distinguish it from other sites. An
object-cache.phpis necessary for this to be useful.
autoand does not need to be specified. If you change this to
dev.site1.wsu.edu.confNginx config should be included in
site1.wsu.edu/config/so that provisioning uses that instead of automatically configuring Nginx for your site.
- The data for
noncescan be generated here: https://api.wordpress.org/secret-key/1.1/salt/
- Note the
nonces:which allows for the multiline data to be included.
- This is most important in production and can be used to cause reauthentication to occur on a site.
- Note the
Individual Site (Project) Structure
Your WordPress project should live in a
site1.wsu.edu/wp-content/ directory in the form of plugins and themes. WordPress itself will be provided automatically by provisioning. If you do want to override the default WordPress installation, include a
site1.wsu.edu/wordpress directory as well.
An example directory and file structure:
Vagrantfile README.md ... www/ news.wsu.edu/ hosts config/ news.wsu.edu.conf dev.news.wsu.edu.conf wp-content/ plugins/ mu-plugins/ themes/ uploads/
Provisioning will parse the
hosts file and so that the VM and your local machine are aware of the domain the project is associated with.