Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Commit bc902ba

Browse files
authored
Initial index.md
1 parent ab73c8e commit bc902ba

File tree

1 file changed

+295
-0
lines changed

1 file changed

+295
-0
lines changed

docs/index.md

Lines changed: 295 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,295 @@
1+
# WPLib Box
2+
3+
**The EASIEST way to get a local WordPress development environment**, using Vagrant.
4+
5+
----
6+
7+
**We are slowly moving our documentation [to the wiki](https://github.com/wplib/wplib-box/wiki)** here on GitHub. The wiki contains information not found here, while this document still contains lost of information not found on the wiki.
8+
9+
----
10+
11+
## [CLICK HERE](https://slackpass.io/wplib) for **quick help** via [`wplib.slack.com# box`](FAQ.md#slack).
12+
## [CLICK HERE](FAQ.md#troubleshooting) for **troubleshooting** and other [FAQs](FAQ.md).
13+
14+
----
15+
16+
- [Why Use WPLib Box?](#why-wplib-box)
17+
- [Services & Software Included](#whats-included)
18+
- [Required Hardware](#required-hw)
19+
- [Required Software](#required-sw)
20+
- [Quickstart](#quickstart)
21+
- [Setting the Domain Name](#setting-domain)
22+
- [Changing the Local IP Address](#change-ip)
23+
- [Default PHP Version](#default-php)
24+
- [Switching PHP Versions](#switching-php)
25+
- [Logging into the WordPress Admin](#wp-admin)
26+
- [The WordPress Database Credentials](#wpdb)
27+
- [The MySQL Credentials](#mysql-credentials)
28+
- [Connecting to MySQL in Terminal](#mysql-terminal)
29+
- [The SSH Credentials](#ssh-credentials)
30+
- [Logging into SSH as root](#ssh-root)
31+
- [Debugging PHP with XDEBUG and PhpStorm](#xdebug)
32+
- [Internet Sharing](#internet-sharing)
33+
- [Troubleshooting](#troubleshooting)
34+
- [How are we the Best?](#how-best)
35+
- [3rd Party WPLib Box Projects](#3rd-party)
36+
- [Status of Issues](#issues-status)
37+
- [Future Plans](#future-plans)
38+
39+
---
40+
41+
<a id="why-wplib-box"></a>
42+
## Why Use WPLib Box?
43+
44+
Why Use WPLib Box for WordPress local development instead of one of the other Vagrant boxes for WordPress such as [VVV](https://github.com/Varying-Vagrant-Vagrants/VVV), [VIP QuickStart](https://github.com/Automattic/vip-quickstart), [Trellis](https://github.com/roots/trellis) or [one of the others](http://wptavern.com/13-vagrant-resources-for-wordpress-development)?
45+
46+
Our **GOAL** is to be:
47+
48+
1. The **Easiest Box to Get Working Initially**,
49+
2. The **Fastest Box to** `vagrant up`
50+
3. The **Least Problematic Box in Day-to-Day Usage**; especially when re-provisioning, which you rarely need to do with WPLib Box.
51+
52+
And one more goal we achieved is that our box supports **PhpStorm+XDEBUG debugging** with the least effort required on your part.
53+
54+
We think that once you try WPLib Box you will agree that we have succeeded. Want to know [**how**](#how) we did it?
55+
56+
<a id="whats-included"></a>
57+
## Services & Software Included
58+
59+
Service/Software|Version
60+
-------|----------
61+
PHP/PHP-FPM|7.1.4, 7.0.16, & 5.6.30
62+
MySQL|5.7.17
63+
MariaDB|10.1.22
64+
Nginx|1.11.0
65+
Apache|2.4.25
66+
XDEBUG|2.5.0
67+
Redis|3.0.7
68+
Memcached|1.4.36
69+
WP CLI|1.1.0
70+
Nodejs|7.8.0
71+
localtunnel.me|
72+
73+
## Supported Host/Development Computers
74+
This box was developed using Mac OS/X and tested using Linux and Windows with [git-bash](https://git-for-windows.github.io/). Thus we believe it currently works with:
75+
76+
O/S|Notes
77+
---|-----
78+
Mac OS X|Latest 3 releases of OS X, at least
79+
Linux|Most (all?) distros of Linux
80+
Windows 7 thru 10|With PowerShell or [git-bash](https://git-for-windows.github.io/)
81+
82+
We assume this will work on all these platforms but we have not tested it thoroughly yet so we welcome your bug reports if you have issues with it.
83+
84+
<a id="required-hw"></a>
85+
## Required Hardware
86+
87+
Since WPLib Box is distributed as a virtual machine image of a 64-bit distribution of Ubuntu Linux, a 64-bit Intel or AMD CPU is required, along with support for either Intel or AMD virtualization technologies: VT-x or AMD-v. You will need to enable VT-x/AMD-v in the host PC BIOS.
88+
89+
<a id="required-sw"></a>
90+
## Required Software
91+
92+
<a id="for-mac"></a>
93+
<a id="for-linux"></a>
94+
### For Mac & Linux Users
95+
96+
To run WPLib Box requires the following software be installed:
97+
98+
- Install [VirtualBox](https://www.virtualbox.org/)
99+
- Install [Vagrant](https://www.vagrantup.com/)
100+
- Install the [Vagrant Hosts Updater](https://github.com/cogitatio/vagrant-hostsupdater) plugin by running `vagrant plugin install vagrant-hostsupdater`
101+
- Install the [Vagrant Triggers](https://github.com/emyl/vagrant-triggers) plugin by running `vagrant plugin install vagrant-triggers`
102+
103+
<a id="for-windows"></a>
104+
### For Windows Users
105+
106+
- Install everything from the Mac & Linux Users list above
107+
- Ensure that no other VM platform is running (either VMware or Hyper-V) as they will prevent VirtualBox from operating.
108+
- Install [Git](https://git-scm.com/downloads) version 2 or greater **OR** download the `.ZIP` file and unzip instead.
109+
110+
<a id="quickstart"></a>
111+
## Quickstart
112+
After making sure you have the necessary software, run the following commands
113+
114+
### For Mac or Linux users:
115+
116+
# cd ~/Sites, or cd into whichever directory you store your website projects in
117+
cd ~/Sites
118+
git clone https://github.com/wplib/wplib-box.git
119+
cd wplib-box
120+
vagrant up
121+
open "http://wplib.box"
122+
123+
### For Windows users:
124+
125+
# cd into whichever directory you store your website projects in.
126+
# For example, your user profile: C:\Users\{current user}\Sites
127+
c:
128+
cd %userprofile%\Sites
129+
#
130+
# You can run the next command, or just download from the web and unzip into the wplib-box directory
131+
#
132+
git clone https://github.com/wplib/wplib-box.git
133+
cd wplib-box
134+
vagrant up
135+
explorer "http://wplib.box"
136+
137+
After this you should have a running WPLib Box via Vagrant and VirtualBox and a website loaded at the local `wplib.box` domain.
138+
139+
<a id="setting-domain"></a>
140+
## Setting the Domain Name
141+
142+
To use WPLib Box for a local domain name other than `wplib.box` edit the `HOSTNAME` file _(with no extension)_
143+
and replace the text `"wplib.box"` with your preferred local domain name _(we recommend `"your-production-2nd-level-domain.dev"` e.g. if `google.com` then use `google.dev`):_
144+
145+
In other words, change the **entire contents** of the `HOSTNAME` file from this:
146+
147+
wplib.box
148+
149+
To _(something like)_ this:
150+
151+
example.dev
152+
153+
Save the changes to `HOSTNAME` and then run the following commands to reload the Vagrant configuration, and then open in your browser. _(Be sure you replaced the domain name in the 2nd command with your own local domain name):_
154+
155+
vagrant reload
156+
open "http://example.dev"
157+
158+
<a id="change-ip"></a>
159+
## Changing the Local IP Address
160+
161+
The default local IP address used by this box is `10.10.10.{octet}` where `{octet}` is a number between 10 to 250.
162+
163+
If you need to change that for any reason simply **edit the file named just `IP`** _(with no extension)_ found in the project root. It is created during `vagrant up` and a random `{octet}` is generated. Just edit this file and change the IP address it contains.
164+
165+
166+
<a id="default-php"></a>
167+
## Default PHP Version
168+
The default version for the box is `7.0.x`. Instructions to [switch to PHP 5.6 or 7.1](FAQ.md#switch-php) are on our FAQ.
169+
170+
<a id="switching-php"></a>
171+
## Switching PHP Versions
172+
173+
The box has both PHP-FPM 5.6, 7.0, and 7.1. Instructions on how to select which version to use can be found in the [FAQ](https://github.com/wplib/wplib-box/blob/master/FAQ.md).
174+
175+
<a id="wp-admin"></a>
176+
## Logging into the WordPress Admin
177+
178+
To login to [wplib.box/wp-admin/](http://wplib.box/wp-admin) use the following credentials:
179+
180+
Credential|Value
181+
---------|------
182+
Username:|`admin`
183+
Password:| `password`
184+
185+
We will probably change to using different username and password in the future.
186+
187+
<a id="wpdb"></a>
188+
## The WordPress Database Credentials
189+
190+
If you want to access the database using a tool such as Sequel Pro the MySQL database name, username and password are all `wordpress`.
191+
192+
In other words:
193+
194+
define( 'DB_NAME', 'wordpress' );
195+
define( 'DB_USER', 'wordpress' );
196+
define( 'DB_PASSWORD', 'wordpress' );
197+
198+
We may change to using different MySQL credentials in the future.
199+
200+
<a id="mysql-credentials"></a>
201+
## The MySQL Credentials
202+
203+
Here are the credentials you can use for accessing the MySQL database using a GUI such as Sequel Pro, Navicat, et al:
204+
205+
Credential|Value
206+
----------|----------
207+
Host Name | `wplib.box` _(or `example.dev`)_
208+
Port | `3306`
209+
Username | `wordpress`
210+
Password | `wordpress`
211+
212+
<a id="mysql-terminal"></a>
213+
## Connecting to MySQL in Terminal
214+
215+
The MySQL server listens on all interfaces on port 3306. If you have the MySQL command-line client installed on your host machine, you can simply `mysql --host wplib.box -u wordpress -pwordpress` (assuming you are using the `wplib.box` hostname).
216+
217+
<a id="ssh-credentials"></a>
218+
## The SSH Credentials
219+
220+
Here are the credentials you can use for the SSH tunnel:
221+
222+
Credential|Value
223+
----------|----------
224+
Host Name | `wplib.box` _(or` example.dev`)_
225+
Port | `22`
226+
Authentication Method | Password
227+
Username | `vagrant`
228+
Password | `vagrant`
229+
230+
<a id="ssh-root"></a>
231+
## Logging into SSH as root
232+
233+
There is no `root` user _per-se_ in WPLib Box, only the `vagrant` user. You have to use either `sudo` for one-off commands, or you can [use the following command to switch to root](https://www.server-world.info/en/note?os=Ubuntu_14.04&p=initial_conf&f=2):
234+
235+
sudo -s
236+
237+
<a id="xdebug"></a>
238+
## Debugging PHP with XDEBUG and PhpStorm
239+
240+
See instructions [**here**](https://github.com/wplib/connect.tech-atlanta-2016/blob/master/debugging-with-phpstorm-xdebug.md#debugging-with-phpstorm-and-xdebug).
241+
242+
<a id="internet-sharing"></a>
243+
## Internet Sharing
244+
245+
Internet sharing is implemented with [localtunnel.me](https://localtunnel.me), which is pre-installed in the box image.
246+
247+
<a id="troubleshooting"></a>
248+
## Troubleshooting
249+
250+
If you are having trouble with WPLib Box please check out our Troubleshooting section of our [**FAQ**](FAQ.md# troubleshooting) and/or you can also [reach out to our support team](FAQ.md# support) for **quick help** on Slack and via other channels.
251+
252+
253+
<a id="how-best"></a>
254+
## How are we the Best?
255+
256+
How have we been able to make **WPLib Box** the:
257+
258+
1. **Easiest**,
259+
2. **Fastest** and
260+
3. **Least Problematic** Vagrant box for local WordPress development
261+
4. Plus **No-Fuss PhpStorm+XDEBUG Debugging**?
262+
263+
Because **we took the blinders off**. We ignored the lead of everyone else who has created a Vagrant box for WordPress development and we rethought how a Vagrant box should be designed, using a blank canvas.
264+
265+
Instead of starting with a standard Linux distribution image as a base box &mdash; such as [provided by Ubuntu](https://vagrantcloud.com/ubuntu) &mdash; and then using Puppet, Chef or Ansible to provision the box _**on your computer while running inside**_ of your `Vagrantfile` **we provision and test the box IN ADVANCE**.
266+
267+
Our **Provision-in-Advance** approach practically eliminates all the hair-pulling and infuriatingly unproductive time you frequently have to spend to solve an obscure provisioning issue in a script that you did not develop and thus know almost nothing about when you use one of the other boxes for local WordPress development. WPLib Box bypasses all those headaches for you and saves you tons of time!
268+
269+
What this means for you is that the only thing your `Vagrantfile` must do is:
270+
271+
1. Specify [**our base box**](https://atlas.hashicorp.com/wplib/boxes/wplib/),
272+
2. Set your local domain name and local IP address,
273+
3. Mount your source code directory into the VM, and
274+
4. Extract WordPress core files from a ZIP file _(but we only run this step on (re-)provisioning.)_
275+
276+
Badda-bing, badda-bang; as Steve Jobs would say: **It Just Works!**
277+
278+
Give it a try and see if you don't agree.
279+
280+
<a id="3rd-party"></a>
281+
## 3rd Party WPLib Box Projects
282+
283+
- [**WPLib Box Maker**](https://github.com/ArtOfWP/generator-wplibbox) from [ArtOfWP](https://github.com/ArtOfWP): _Generates a custom WPLib Box setup using [Yeoman](http://yeoman.io/)._
284+
285+
<a id="issues-status"></a>
286+
## Status of Issues
287+
We are using Waffle.io to help us manage our GitHub issue queue:
288+
289+
[![Stories in Ready](https://badge.waffle.io/wplib/wplib-box.png?label=ready&title=Ready)](https://waffle.io/wplib/wplib-box)
290+
[![Stories In Progress](https://badge.waffle.io/wplib/wplib-box.svg?label=in+progress&title=In+Progress)](http://waffle.io/wplib/wplib-box)
291+
292+
<a id="future-plans"></a>
293+
## Future Plans
294+
295+
We have many plans for the WPLib platform. This is just a start. Watch this repo to keep up to date.

0 commit comments

Comments
 (0)