Giter VIP home page Giter VIP logo

wplib-box's Introduction

Latest Stable Version Latest Testing Version License

WPLib-Box

We are in the middle of updating our documentation.

If you are interested in our progress you can find it here.

WANT TO CONTRIBUTE?

Help us write tests for WPLib Box. (It is actually really easy, assuming you know Bash.)

wplib-box's People

Contributors

andreasnrb avatar johncrumpton avatar keesiemeijer avatar mickmake avatar mikeschinkel avatar royatl avatar shelob9 avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wplib-box's Issues

Put files needing for provisioning into /srv/provision

Put files needing for provisioning into /srv/provision to have a standard place and to remove the .tar files from the /srv/sites directory.

Also, I'd like to figure out a way that we can get users to be able to easily add things to their own repo that would a influence a reprovision, such as files for adding sites to nginx. This idea of fuzzy thus far, so just thinking "out loud."

Support Parallels

This ticket is here to collect up requests for supporting this feature. If you are interested in seeing WPLib Box support Parallels please add a comment with a +1 and any comments you'd like to share about about why WPLib Box needs to support Parallels. Thanks!

Setup a WordPress-based Site inside the VM at wplib.box

The idea will be to have a WordPress website running in the Vagrant box that will show what websites are currently installed and what the status of their vagrants VMs are and the ability to control the VMs from the website as well as add and delete new websites. So the dashboard may simply be replaced with a (post) list of sites.

From there we can grow what it does (like keep track of things related to the deployment of the sites, etc.) but to start just having a list of sites, their Vagrant and Git statuses and ability to add or delete new sites will be a great thing.

We have one box image that can have everything installed on it so this admin console should also be able to start-stop the various services and switch between Apache and Nginx, MySQL and Maria DB and the various versions of PHP.

Eliminate need to run `composer.install` before `vagrant up` but still have a working initial site

Some of the goals for WPLib box are:

  1. It should provision as fast as possible
  2. Failure of provisioning should not be possible, or at least greatly eliminated.

Running anything complicated for provisioning, or running anything that could potentially fail during provision then goes counter to these goals. Examples of things that could fail:

  1. Any script that needs to download software from the internet to be able to install it.
  2. Any script that might download newer versions of software that has not been testing to work in the box.

That means we cannot run anything more complex than a simple Bash script that downloads nothing for provisioning.

Thus to eliminate the need to run composer install -- inside the box or out -- we should copy a ZIP file containing the WordPress website for wplib.box from an /opt/provision directory inside the box to the box's /var/www directory (which maps to www/ in our host's directory) and then unzip it.

This will have the same effect as running composer install as if composer install was run at the time of box image creation instead of at time of first vagrant up. That will give us a known working wplib.box website and on that website we can provide instructions for the user that would include one of:

  1. Run composer update after running vagrant ssh, or
  2. Run composer update on the host machine after ensuring that composer is installed.

Future Plans for WPLib Box as of Jan 2016

WPLib Box is still pre-alpha and we have decided to change direction from what is online right now. Not sure how soon we can update it, but it is a top priority for us.

What we plan to move to is a pre-built collection of base boxes that include memcached, Redis, And Vagrant with a combinations of LAMP vs. LEMP (using MariaDB) and choice of PHP5.5, PHP5.6 and PHP7.0. The goal will be to create a box that will "up" and "reload" as quickly as possible and will have the fewest potential issues when getting to to work. And we will listen to users to see if we need to add any other base box configurations.

Further we plan to add a "box" command to a near future version of WPLib CLI for adding sites to the box and other admin task rather than requiring editing of the Vagrantfile and reprovisioning through Vagrant because that can be very time consuming and rather brittle.

With this we will de-emphasize constantly working with Vagrant and instead allow you to up when you start your day and halt when you end your day. Further, you would only need to use as many different boxes as you need different configurations; if you only ever need one configuration you could use one box for all your sites. But since you would not be having Vagrant process each of your sites it would not become more time consuming to bring up the new site because you would not have to reprovision.

This will allow the developer to pick the base box that best fits their needs. We can do this in the WodPress world because the best practices patterns for WordPress are so constrained vs. Ruby and Node projects, for example.

Instead the idea will be to use Vagrant to do what it alone currently does best; linking local development directories to the web home directories in the running boxes.

But we will do in a way that everything can be committed to version control because that is core to the vision for the WPLib platform.

Note, if anyone wants access to our WPLib Slack just ping team @ wplib.org me with your email address and we will add you.

Strange (empty) file in /var/www folder

While looking at the contents of /var to see if /var/www/content was there (result of #43 ), I ssh-ed into the VM:

vagrant@wplib:/var/www$ ll
total 16
-rw-r--r--  1 vagrant vagrant    0 Apr 20 02:14 =
drwxr-xr-x  1 vagrant vagrant  238 Apr 20 02:14 ./
drwxr-xr-x 12 root    root    4096 Apr 20 02:08 ../
-rw-r--r--  1 vagrant vagrant    0 Apr 20 02:14 default:
-rw-r--r--  1 vagrant vagrant   85 Apr 20 02:02 index.php
-rw-r--r--  1 vagrant vagrant  128 Apr 20 02:02 wp-config-local.php
-rw-r--r--  1 vagrant vagrant 2558 Apr 20 02:02 wp-config.php

The result of a cat is that it is empty

vagrant@wplib:/var/www$ cat default\: 
vagrant@wplib:/var/www$

Upgrade to WordPress 4.5

Change composer to pull latest stable WordPress and when you get the ZIP file ready on provision have it use 4.5.

Add optional Blackfire integration

I like Blackfire and use it a bit. Im thinking this might be a candidate for some cli integration though.
wpbox add blackfire --provision and it adds it and provisions server. or it can be flag in the vagrantfile or something.
Adding support for Blackfire I think would make a nice addition. However it can according to docs conflict with XDebug and XPerf. I haven't noticed anything.

Put the WordPress Starter Site for the Box in a Repo

Per a question on Facebook asking it we are going to open source the "WP-specific config of the built box" I think we should create a repo for the starter site, such as:

  • wplib/site-box-single

Then we can manage this separately from the box packer?

PHP Notice output breaking nginx proxy

I installed the Layers theme and attempted to load it's Customization screen, and the site crashed. Checking the nginx error.log, it's throwing the below error. Granted, this appears to be an issue with the third-party code and I can try to fix that. But in the interests of making wplib-box the "Least Problematic" way to get a dev site up, it would be nice to make sure any errors can pass back up to the user's browser instead of having to dig into the VM and it's logs. I tried messing with fastcgi buffer sizes, but that didn't seem to help.

2016/04/13 21:00:36 [error] 1079#0: *91 FastCGI sent in stderr: "PHP message: PHP Notice:  register_sidebar was called <strong>incorrectly</strong>. No <code>id</code> was set in the arguments array for the "Sidebar" sidebar. Defaulting to "sidebar-1". Manually set the <code>id</code> to "sidebar-1" to silence this notice and keep existing sidebar content. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 4.2.0.) in /usr/share/nginx/html/wp/wp-includes/functions.php on line 3901
PHP message: PHP Stack trace:
PHP message: PHP   1. {main}() /usr/share/nginx/html/wp/wp-admin/customize.php:0
PHP message: PHP   2. require_once() /usr/share/nginx/html/wp/wp-admin/customize.php:13
PHP message: PHP   3. require_once() /usr/share/nginx/html/wp/wp-admin/admin.php:31
PHP message: PHP   4. require_once() /usr/share/nginx/html/wp/wp-load.php:42
PHP message: PHP   5. require_once() /usr/share/nginx/html/wp-config.php:83
PHP message: PHP   6. do_action() /usr/share/nginx/html/wp/wp-settings.php:393
PHP message: PHP   7. call_user_func_array:{/usr/share/nginx/html/wp/wp-includes/plugin.php:525}() /usr/share/nginx/html/wp/wp-includes/plugin.php:525
PHP message: PHP   8. wp_widgets_init() /usr/share/nginx/html/wp/wp-includes/plugin.php:525
PHP message: PHP   9. do_action() /usr/share/nginx/html/wp/wp-includes/widgets.php:1475
PHP message: PHP  10. call_user_func_array:{/usr/share/nginx/html/wp/wp-includes/plugin.php:525}() /usr/share/nginx/html/wp/wp-includes/plugin.php:525
PHP message: PHP  11. layers_add_sidebars() /usr/share/nginx/html/wp/wp-includes/plugin.php:525
PHP message: PHP  12. register_sidebar() /usr/share/nginx/html/content/themes/layers/functions.php:17
PHP message: PHP  13. _doing_it_wrong() /usr/share/nginx/html/wp/wp-includes/widgets.php:258
PHP message: PHP  14. trigger_error() /usr/share/nginx/html/wp/wp-includes/functions.php:3901
PHP message: PHP Notice:  register_sidebar was called <strong>incorrectly</
2016/04/13 21:00:36 [error] 1079#0: *91 upstream sent too big header while reading response header from upstream, client: 192.168.33.1, server: localhost, request: "GET /wp/wp-admin/customize.php?url=http%3A%2F%2Fwplib.box%2F HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "wplib.box", referrer: "http://wplib.box/"

Vagrant Can Fail to Symlink the Object Cache Drop-in on Windows 10

After Jayzanarak ProgrammerLoso got past issue #42 he then saw the symlinking of wp-redis/object-cache.php fail, on Windows 10. See screenshot.

win10-symlink-fail

wpli.box still loaded in his browser but the object cache won't work, obviously.

I know that @sarutole tested it on Windows 10 but I assume that he had already made a modification to his Windows box to enable this to work. That said, I have no idea why it was failing.

In order to be true to our (my?) claims that WPLib Box is the EASIEST way to setup a professional WordPress local development environment we need to solve this problem or at least change the documentation so that anyone who follows our QuickStart will not run into this problem.

Add "Phone Home" functionality

As we evangelize WPLib box it would be helpful to elicit support from 3rd party services like Pantheon.io and Blackfire.io if we can show them how many people are actually using WPLib Box, and how often.

I am proposing that we add an on-by-default feature that would periodically send a JSON file with non-confidential data representing various actions such as a reload or a provision so that we can keep track of how active our users are.

We should make it clear that we are doing this, show exactly what we are sending, and ask for people to not turn if off in order to support us. With that data I think we might be able to get sponsors to support the box.

Need a favicon.ico

For some reasons some times nginx returns 404 for the main page when favicon.icois requested but not found. This happened in both Chrome and Safari and was pretty crazy to try and debug.

When you ssh you should land in site root

When you ssh into vagrant I think that the directory you land in should be the default synced folder, site root. Currently you end up in the home directory. When directory matters thats where I usually want to go.

WP Lib error

Class name must be a valid object or a string in /var/www/underscores4wplib/www/content/mu-plugins/wplib/modules/users/users.php on line 190

Vagrant Can Fail to Update Hosts on Windows 10

Jayzanarak ProgrammerLoso contacted me via Facebook Messenger with Vagrant Box install problem where Hosts Updater could not update the hosts file on Windows 10. See screenshot.

win10-hosts-update-fail

I provided him these links and they gave him enough info to solve his problem, but he did not explain to me how he solved it (he had to leave for work that moment):

I know that @sarutole tested it on Windows 10 but I assume that he had already made a modification to his Windows box to enable editing of his hosts file long before testing our box.

In order to be true to our (my?) claims that WPLib Box is the EASIEST way to setup a professional WordPress local development environment we need to solve this problem or at least change the documentation so that anyone who follows our quickstart will not run into this problem.

Don't Throw Errors when Developing Offline

I get the following message in WP Admin on plugins page when I run 0.10.5 on MacOS.
( ! ) Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /var/www/wp/wp-includes/update.php on line 306

Causes seem to differ. VVV and others have this in their Vagrantfile to handle timeouts if I understand correctly.

    config.vm.provider :virtualbox do |vb|
        vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
        vb.customize ['modifyvm', :id, '--natdnsproxy1', 'on']
    end

I also added define('WP_HTTP_BLOCK_EXTERNAL', true); seem to have gone away then.

Enable Support for Multi-Domains/Sites on One Box

Many people have asked to be able to run one VM to serve many different WordPress sites.

Since one of our core goals for WPLib Box is to provide a success experience as soon as possible once someone tries to install and use WPLib Box.

However, once someone has gotten initial success with WPLib Box we are happy to see them use it in more complex ways, and we want to fully support as much complexity as we can without compromising our core goals.

To that end we recommend Multi-Tenancy however we expect to support a symlink-free approach and embrace Composer instead. Consider the following planned directory structure on your Host Computer:

sites/site1.dev/www
sites/site2.dev/www
sites/site3.dev/www
sites/wp/4.4/
sites/wp/4.5/
sites/wp/4.6-beta/

This ticket is here as a TODO for us to do a proof-of-concept then write documentation for exactly how you would set this up as well as the pros and cons to our approach.

Later we will add commands in WPLib CLI to manage this all for you, such as:

wplib box expand [to multi-domain]  
wplib box domain add <new_domain>
wplib box domain delete <new_domain>

How to dump the database?

I'm using wplib-box without MySQL installed locally. When I use wp-cli db export command, I get sh: mysqldump: command not found.

I suspect that installing mysql client won't help much cause the DB is inside of the VM.

What's the recommended way of dumping the DB with the current setup?

Implement PHPUnit as a (PHP) ScriptComponent

Since you need to run phpunit in the VM for the WP integration test to work adding it either to box or during provision would be good. If provision probably some check if installed should be added so it doesn't get redownloaded or anything like that unless there is update.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.