Fetching contributors…
Cannot retrieve contributors at this time
124 lines (91 sloc) 4.93 KB


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.


Configuring your own services can result in different configurations from the prodution environment. It is strongly encouraged to use the virtual machine environment as described in


This install guide assumes you have certain prerequisites already configured within your environment.

  • Apache
  • Mysql
  • PHP


  1. Configure your local webserver with a virtual host that covers the relevant jQuery domains, such as * and *, all pointing to the same root. For example, in Apache:
<VirtualHost *:80>
    ServerAlias * * * * * *
    DocumentRoot "/srv/www/jquery"
    php_value memory_limit 256M
    <Directory /srv/www/jquery>
        Options All
        AllowOverride All
        Order allow,deny
        Allow from all

Make sure that virtual hosts are enabled as well:

NameVirtualHost *:80

Both blocks of code should be pasted into extra/httpd-vhosts.conf. Be sure to check httpd.conf to verify there is a line that includes httpd-vhosts.conf. It may already exist, but be commented out.

Check httpd.conf to ensure that the PHP module is enabled as well.

You do not need to configure your /etc/hosts file for local.* because's DNS handles this for you. However, if you plan to work offline, you can use the following rules:
  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:

  2. Clone jquery-wp-content inside of the directory where you put WordPress, so you have a file tree that looks like this:

├── jquery
│   ├── gw-resources
│   ├── index.php
│   ├── jquery-wp-content
│   ├── license.txt
│   ├── readme.html
│   ├── wp-activate.php
│   ├── wp-admin
│   ├── wp-blog-header.php
│   ├── wp-comments-post.php
│   ├── wp-config-sample.php
│   ├── wp-content
│   ├── ...
│   └── xmlrpc.php
  1. Create a MySQL database and user. You can choose any name you want for both. Follow the WordPress instructions for a step by step guide.

  2. Copy jquery-wp-content/wp-config-sample.php and move it up one directory, to wp-config.php. Fill in your database credentials.

  3. Create an .htaccess file with the following content into that same document root:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

RewriteRule ^resources/?$ index.php [L]
RewriteRule ^resources/(.+) gw-resources/%{HTTP_HOST}/$1 [L]

# Add a trailing slash to the wp-admin of a subsite.
RewriteRule ^([_0-9a-zA-Z\.-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Handle wp-admin, wp-includes, and root PHP files for subsites.
RewriteRule  ^[_0-9a-zA-Z\.-]+/((wp-admin|wp-includes).*) $1 [L]
RewriteRule  ^[_0-9a-zA-Z\.-]+/(.*\.php)$ $1 [L]

RewriteRule . index.php [L]
  1. Make sure that you have assigned your WordPress files and directories the correct permissions. For example, if your WordPress files are in the directory wordpress, and you are running Apache under Mac OS X with the _www user:
sudo chown -R _www wordpress
sudo chmod -R g+w wordpress
  1. Restart your web server so the changes above are in use.

  2. Go to and walk through the standard WordPress installation. jquery-wp-content includes a special install script that will initialize the entire network.

  3. Be sure to have node >= 0.8 installed on your system. Some sites, such as, require that version or greater.