This is a Vagrant configuration focused on development of WordPress plugins, themes, websites.
- This Vagrant configuration has many settings which you can change.
- Multisite
- Force SSL Admin
- Installed in subdirectory. (e.g. http://wordpress.local/wp/)
- Allow you to customize URL. (Default: http://wordpress.local/)
- Debug mode already enabled.
- SSL already enabled.
- It is possible to install & activate plugins automatically when provisioning.(Default: theme-check, plugin-check, hotfix)
- It is possible to install theme automatically when provisioning.(Default: none)
- Allow you to import theme unit test data.(Default: not import)
- wp-cli already installed.
- Share folders between Host and Guest OS
- Install VirtualBox.
- Install Vagrant.
- Install the vagrant-hostsupdater plugin.
vagrant plugin install vagrant-hostsupdater
- Clone the repository into a local directory
git clone https://github.com/miya0001/vagrant-chef-centos-wordpress.git vagrant-wp
- Change into the new directory.
cd vagrant-wp
- Copy the default Vagrantfile.
cp Vagrantfile.sample Vagrantfile
- Start the Vagrant environment.
vagrant up
- Visit http://wordpress.local/
- Default user.
- User Name: admin
- Password: admin
- Debug mode enabled.
- Defalut plugins.
- hotfix
- theme-check
- plugin-check
- wp-multibyte-patch (ja only)
This Vagrant configuration has many customizable constants.
WP_VERSION = 'latest'
- Set which version you want to install. (WordPress 3.4 or later)
- Default value is the
latest
. - Allow you to set Beta releases. (e.g.: 3.7-beta2)
WP_LANG = ""
- Select which language you want to download. (e.g.
ja
) - If you have an error, please set
""
. WP_HOSTNAME = "wordpress.local"
- Select which hostname for Guest OS. (e.g.
exmaple.com
、digitalcube.jp
など) WP_DIR = ''
- If you want to install WordPress in the subdirectory. Please set directory name to this constant. (e.g.
wp
or/wp
) - http:// +
WP_HOSTNAME
+WP_DIR
is your WordPress URL. WP_TITLE = "Welcome to the Vagrant"
- The title of the new site.
WP_ADMIN_USER = "admin"
- The default user name of the new site.
WP_ADMIN_PASS = "admin"
- The default user's password.
WP_DB_PREFIX = 'wp_'
- Database prefix.
WP_DEFAULT_PLUGINS = %w(theme-check plugin-check hotfix)
- Set an ARRAY of plugins.
- Allow you to set plugin slug, the path to a local zip file, or URL to a remote zip file.
WP_DEFAULT_THEME = ''
- Set a default theme.
- Allow you to set theme slug, the path to a local zip file, or URL to a remote zip file.
WP_IS_MULTISITE = false
- If set
true
then multi-site install. - The network will use subdirectories by default.
WP_FORCE_SSL_ADMIN = false
- If set
true
then enable and enforce administration over SSL. WP_DEBUG = true
- If set
true
then trigger the debug mode. (Default) WP_THEME_UNIT_TEST = false
- If set
true
then Theme unit test data will import automatically. WP_ALWAYS_RESET = true
- If set
true
then always reset database whenvagrant provision
. - You will lost all MySQL data when reset database.
WP_IP = "192.168.33.10"
- Private IP address for Guest OS.
vagrant up
- Start guest machine.- Ednit Vagrantfile. (
WP_ALWAYS_RESET
should be settrue
.) vagrant provision
- Re-Provison.vagrant reload
- Re-Start guest machine.
File under the wp-content directory will be not deleted.
- wp-cli is pre-installed in this Vagrant environments.
- If you install wp-cli in your Host OS, you can fire wp-cli commands from the Host OS.
You have to install wp-cli in Host OS.
cd vagrant-local
# Exports the database using mysqldump to Desktop.
wp db export ~/Desktop/export.sql
# Export content to a WXR file.
mkdir /Users/foo/Desktop/export
wp export --dir=/Users/foo/Desktop/export
# Activate the contect-form-7 plugin.
wp plugin install contact-form-7 --activate
# Update WordPress.
wp core update
- Allowed ports on iptables
- 22 - SSH
- 80 - HTTP
- 443 - HTTPS
- 3306 - MySQL(Allow you to operate wp-cli from the Host OS)
- CentOS 6.4.x
- PHP 5.3.x
- MySQL 5.1.x
- Apache 2.2.x
Let us have it! If you have tips that we need to know, open a new issue.