|
1 |
| -# jQuery.com jquery-wp-content |
| 1 | +# jquery-wp-content |
2 | 2 |
|
3 | 3 | `jquery-wp-content` is a **custom replacement** for the `wp-content` directory which contains the plugins, themes and site configuration to run the jQuery multi-site WordPress network.
|
4 | 4 |
|
| 5 | +Although we recommend using the pre-built VM, if you would like to manually install `jquery-wp-content` you will find instructions for installing in the [INSTALL.md](INSTALL.md) file in this directory. We strongly recommend using the VM as it will provide the same environment as our production servers. |
5 | 6 |
|
6 | 7 | ## Prerequisites
|
7 | 8 |
|
8 |
| -This install guide assumes you already have certain prerequisites already configured within your environment. |
9 |
| - |
10 |
| -* Apache |
11 |
| -* Mysql |
12 |
| -* PHP |
13 |
| - |
14 |
| -## Installation |
15 |
| - |
16 |
| -1. Configure your local webserver with a virtual host that covers the relevant jQuery domains, such as `*.jquery.com` and `*.jqueryui.com`, all pointing to the same root. For example, in Apache: |
| 9 | +This setup guide assumes you have certain prerequisites installed. |
17 | 10 |
|
18 |
| - ``` |
19 |
| - <VirtualHost *:80> |
20 |
| - ServerName local.jquery.com |
21 |
| - ServerAlias *.jquery.com *.jqueryui.com *.jquery.org *.qunitjs.com *.sizzlejs.com *.jquerymobile.com |
22 |
| - DocumentRoot "/srv/www/jquery" |
23 |
| - php_value memory_limit 256M |
24 |
| - <Directory /srv/www/jquery> |
25 |
| - Options All |
26 |
| - AllowOverride All |
27 |
| - Order allow,deny |
28 |
| - Allow from all |
29 |
| - </Directory> |
30 |
| - </VirtualHost> |
31 |
| - ``` |
| 11 | +* [Virtualbox >=4.3+](https://www.virtualbox.org/) |
| 12 | +* [Vagrant >=1.4.0](http://www.vagrantup.com/) |
32 | 13 |
|
33 |
| - Make sure that virtual hosts are enabled as well: |
| 14 | +## Vagrant and Virtualbox |
34 | 15 |
|
35 |
| - ``` |
36 |
| - NameVirtualHost *:80 |
37 |
| - ``` |
| 16 | +We recommend the combination of Virtualbox and [Vagrant](http://www.vagrantup.com/about.html) for a local development environment. Vagrant simplifies download, installation, and management of the local environment VM with a few commands. |
38 | 17 |
|
39 |
| - Both blocks of code should be pasted into `extra/httpd-vhosts.conf`. |
40 |
| - Be sure to check `httpd.conf` to verify there is a line that includes |
41 |
| - `httpd-vhosts.conf`. It may already exist, but be commented out. |
| 18 | +### Setup |
42 | 19 |
|
43 |
| - Check `httpd.conf` to ensure that the PHP module is enabled as well. |
| 20 | +From the root of your `jquery-wp-content` clone run the following command: |
44 | 21 |
|
45 |
| - You do not need to configure your `/etc/hosts` file for `local.*` because `jquery.com`'s DNS handles this for you. However, if you plan to work offline, you can use the following rules: |
| 22 | +``` |
| 23 | +vagrant up |
| 24 | +``` |
46 | 25 |
|
47 |
| - ``` |
48 |
| - 127.0.0.1 local.jquery.com local.api.jquery.com local.blog.jquery.com local.books.jquery.com local.codeorigin.jquery.com local.learn.jquery.com local.plugins.jquery.com |
49 |
| - 127.0.0.1 local.jqueryui.com local.api.jqueryui.com local.blog.jqueryui.com |
50 |
| - 127.0.0.1 local.jquerymobile.com local.api.jquerymobile.com local.blog.jquerymobile.com |
51 |
| - 127.0.0.1 local.jquery.org local.brand.jquery.org local.contribute.jquery.org local.events.jquery.org local.irc.jquery.org local.meetings.jquery.org |
52 |
| - 127.0.0.1 local.qunitjs.com local.api.qunitjs.com |
53 |
| - 127.0.0.1 local.sizzlejs.com |
54 |
| - ``` |
| 26 | +This will start the VM for you, the output should look similar to what you see below. |
55 | 27 |
|
56 |
| -1. Place the WordPress core files **at** the document root you chose. For example, if you used `/srv/www/jquery`, you should unzip or clone WordPress directly into that directory, *not* a directory below it. **Do not install WordPress.** You can do this any number of ways: |
57 |
| - * Download the latest version from http://wordpress.org/latest.zip |
58 |
| - * Check out the latest tag from http://core.svn.wordpress.org/tags/ |
59 |
| - * Clone the official WordPress Github mirror at https://github.com/WordPress/WordPress |
| 28 | +``` |
| 29 | +Bringing machine 'default' up with 'virtualbox' provider... |
| 30 | +[default] Box 'jquery-wp-content' was not found. Fetching box from specified URL for |
| 31 | +the provider 'virtualbox'. Note that if the URL does not have |
| 32 | +a box for this provider, you should interrupt Vagrant now and add |
| 33 | +the box yourself. Otherwise Vagrant will attempt to download the |
| 34 | +full box prior to discovering this error. |
| 35 | +Downloading box from URL: http://boxes.jquery.com/jquery-wp-content.box |
| 36 | +Calculating and comparing box checksum...ime remaining: 0:00:01) |
| 37 | +Extracting box... |
| 38 | +Successfully added box 'jquery-wp-content' with provider 'virtualbox'! |
| 39 | +[default] Importing base box 'jquery-wp-content'... |
| 40 | +[default] Matching MAC address for NAT networking... |
| 41 | +[default] Setting the name of the VM... |
| 42 | +[default] Clearing any previously set forwarded ports... |
| 43 | +[default] Clearing any previously set network interfaces... |
| 44 | +[default] Preparing network interfaces based on configuration... |
| 45 | +[default] Forwarding ports... |
| 46 | +[default] -- 22 => 2222 (adapter 1) |
| 47 | +[default] Running 'pre-boot' VM customizations... |
| 48 | +[default] Booting VM... |
| 49 | +[default] Waiting for machine to boot. This may take a few minutes... |
| 50 | +[default] Machine booted and ready! |
| 51 | +[default] Setting hostname... |
| 52 | +[default] Configuring and enabling network interfaces... |
| 53 | +[default] Mounting shared folders... |
| 54 | +[default] -- /vagrant |
| 55 | +[default] -- /var/www/wordpress/jquery-wp-content |
| 56 | +``` |
60 | 57 |
|
61 |
| -1. Clone `jquery-wp-content` inside of the directory where you put WordPress, so you have a file tree that looks like this: |
| 58 | +Complete the installation process by pointing your browser at http://vagrant.jquery.com/. Feel free to use any username/password/email combination that you choose, though keep note of the username and password as you will need them to deploy to your local VM. |
62 | 59 |
|
63 |
| - ``` |
64 |
| - ├── jquery |
65 |
| - │ ├── gw-resources |
66 |
| - │ ├── index.php |
67 |
| - │ ├── jquery-wp-content |
68 |
| - │ ├── license.txt |
69 |
| - │ ├── readme.html |
70 |
| - │ ├── wp-activate.php |
71 |
| - │ ├── wp-admin |
72 |
| - │ ├── wp-blog-header.php |
73 |
| - │ ├── wp-comments-post.php |
74 |
| - │ ├── wp-config-sample.php |
75 |
| - │ ├── wp-content |
76 |
| - │ ├── ... |
77 |
| - │ └── xmlrpc.php |
78 |
| - ``` |
| 60 | +You do not need to configure your `/etc/hosts` file for `vagrant.*` because `jquery.com`'s DNS handles this for you. However, if you plan to work offline, you can use the following rules: |
79 | 61 |
|
80 |
| -1. Create a MySQL database and user. You can choose any name you want for both. Follow the [WordPress instructions](http://codex.wordpress.org/Installing_WordPress#Step_2:_Create_the_Database_and_a_User) for a step by step guide. |
| 62 | +``` |
| 63 | +172.27.72.27 vagrant.jquery.com vagrant.api.jquery.com vagrant.blog.jquery.com vagrant.books.jquery.com vagrant.codeorigin.jquery.com vagrant.learn.jquery.com vagrant.plugins.jquery.com |
| 64 | +172.27.72.27 vagrant.jqueryui.com vagrant.api.jqueryui.com vagrant.blog.jqueryui.com |
| 65 | +172.27.72.27 vagrant.jquerymobile.com vagrant.api.jquerymobile.com vagrant.blog.jquerymobile.com |
| 66 | +172.27.72.27 vagrant.jquery.org vagrant.brand.jquery.org vagrant.contribute.jquery.org vagrant.events.jquery.org vagrant.irc.jquery.org vagrant.meetings.jquery.org |
| 67 | +172.27.72.27 vagrant.qunitjs.com vagrant.api.qunitjs.com |
| 68 | +172.27.72.27 vagrant.sizzlejs.com |
| 69 | +``` |
81 | 70 |
|
82 |
| -1. Copy `jquery-wp-content/wp-config-sample.php` and move it up one directory, to `wp-config.php`. Fill in your database credentials. |
| 71 | +### Stopping and Restarting the Virtual Machine |
83 | 72 |
|
84 |
| -1. Create an .htaccess file with the following content into that same document root: |
| 73 | +When you're not working on `jquery-wp-content` you'll probably want to run `vagrant halt` to turn off the VM to save yourself some system resources. Alternatively you can suspend the VM by using `vagrant suspend`. You can always start the VM by running `vagrant up`. |
85 | 74 |
|
86 |
| - ``` |
87 |
| - RewriteEngine On |
88 |
| - RewriteBase / |
89 |
| - RewriteRule ^index\.php$ - [L] |
| 75 | +### Clean up |
90 | 76 |
|
91 |
| - RewriteRule ^resources/?$ index.php [L] |
92 |
| - RewriteRule ^resources/(.+) gw-resources/%{HTTP_HOST}/$1 [L] |
93 |
| - |
94 |
| - # Add a trailing slash to the wp-admin of a subsite. |
95 |
| - RewriteRule ^([_0-9a-zA-Z\.-]+/)?wp-admin$ $1wp-admin/ [R=301,L] |
96 |
| - |
97 |
| - RewriteCond %{REQUEST_FILENAME} -f [OR] |
98 |
| - RewriteCond %{REQUEST_FILENAME} -d |
99 |
| - RewriteRule ^ - [L] |
100 |
| - |
101 |
| - # Handle wp-admin, wp-includes, and root PHP files for subsites. |
102 |
| - RewriteRule ^[_0-9a-zA-Z\.-]+/((wp-admin|wp-includes).*) $1 [L] |
103 |
| - RewriteRule ^[_0-9a-zA-Z\.-]+/(.*\.php)$ $1 [L] |
104 |
| - |
105 |
| - RewriteRule . index.php [L] |
106 |
| - ``` |
107 |
| - |
108 |
| -1. Make sure that you have assigned your WordPress files and directories the correct permissions. |
109 |
| -For example, if your WordPress files are in the directory ```wordpress```, and you are running Apache under Mac OS X with the ```_www``` user: |
110 |
| - |
111 |
| - ``` |
112 |
| - sudo chown -R _www wordpress |
113 |
| - sudo chmod -R g+w wordpress |
114 |
| - ``` |
115 |
| - |
116 |
| -1. Restart your web server so the changes above are in use. |
117 |
| - |
118 |
| -1. Go to `http://local.jquery.com` and walk through the standard WordPress installation. `jquery-wp-content` includes a special install script that will initialize the entire network. |
119 |
| - |
120 |
| -1. Be sure to have node >= 0.8 installed on your system. Some sites, such as download.jqueryui.com, require that version or greater. |
| 77 | +Should you need to recover some harddrive space you can safely run the `vagrant destroy` command from within your `jquery-wp-content` clone. This will delete the VM image from your hard drive. **You will not lose any work by doing this.** |
121 | 78 |
|
122 | 79 | ## Auto-Updates
|
123 |
| -Changes pushed to master will be pulled onto the stage domain. |
| 80 | + |
| 81 | +Changes pushed to master are automatically pulled onto the stage domain. |
124 | 82 |
|
125 | 83 | ## Copyright
|
126 | 84 |
|
|
0 commit comments