Using Vagrant for customizable WordPress Multi-sites [closed]

Background:

My partner and I have a goal to create a customizable vagrant project that uses WordPress multi site, as a local development environment.


Ideal Use Case: Various developers on our team (of varying skill levels) will be provided with a vagrant package. When they “vagrant-up” they should be provided a standard lamp stack containing a multi-site wordpress instance. Any resources they need are included in the process of provisioning, including the database, plugins, themes, uploads-file’s. Support for grunt.js task-running is available. They can proceed to develop, and have an easy option for Version Control.


The Reality (our challenges):

While there are many options available for using vagrant and a standard wordpress.org installation, we have not yet found a workable solution or adaptation. We have encountered these problems:

1. WordPress Mult-site needs to be on port 80. so rather than using Port forwarding (vagrant docs), we opted for private network, in addition to synced folders.

2. Hosts files. There are several nice plugins that we have experimented with that allow us to edit the hosts file on the host-machine side Vagrant hosts manager and vagrant host updater. In windows host machines, it was necessary for permissions to be changed to prevent UAC from preventing the the updating.

3. The database We have used options that exist in puphpet to experiment using SQL import as part of the provisioning process. Also, we have tried using a wordpress plugin that we are familiar with, migrate DB Pro.Our purpose with Migrate DB PRo was just to make the database connection work. Both my partner and myself are not able access sub-directories (rather we receive a file not found error)

These are some of our major hurdles, there may be more details, but for the moment I would like to focus on the question at hand.



The Question:

There is no single question to capture what I hope to convey, but please consider the following:

Do you have any successful experiences in implementing a WordPress multi-site? If so, how did you overcome some of the common pitfalls? Did you rely upon an existing source or process model? Where do I seem to be failing in my approach?

2 Answers
2

You can try using the Genesis-Wordpress(Note: not the framework) project for this. It does more or less what you have described above including,

  • Provisioning (with Ansible)
  • Deployment (with Capistrano)
  • Database Synchronization (with custom Capistrano tasks)

It also uses the Vagrant Host Manager to workaround the /etc/hosts issue. So the site is served over port 80.

Adding WP_ALLOW_MULTISITE to your wp-config.php should give you multisite support.


define( 'WP_ALLOW_MULTISITE', true );

Leave a Comment