Skip to content


WordPress 3.0 Multi-Site Installation with Existing Web Sites

Here’s how to Install WordPress 3.0 with the New Multi-Site Capabilities—Even if you Already Have a Website in public_html

WordPress multi-site features let you very easily create blogs (now called “sites”).

You could have multiple blogs in WordPress 2.x, but now you can do it with much less administration of WordPress updates, plug-in updates and settings, theme updates, etc. Multiple blogs, for each domain you are hosting, can be managed by a single installation of WordPress.

I had two web sites already in my web hosting account. I wanted to keep those web site, and add multiple blogs.

Specifically, I had http://www.lernerconsult.com in public_html/, and other web sites as add-on domains.

For you to have your existing web site, and WordPress 3.0 with multi-site, some special adjustments will have to be made, to your hosting. Multi-Site needs WordPress to be in public_html, so you’ll want to move your web site into a folder, as an add-on domain. You’ll have to turn on “wildcard DNS”, so WordPress can create subdomains and make blogs for them.

You could simply leave your existing website where it is (in public_html), and install WordPress in the same location.

WordPress requires index.php for its main file (maybe someone will come up with a hack to change this?) People browsing to your domain (i.e. www.yourdomain.com, no file name specified) would get your blog, not your web site. Your blog could have a link to the web site.

You would have to rename your index.php or index.html to something else (maybe home.php or home.html). Do This Before You Install WordPress (it would overwrite any files that have the same name)!

Other files that might conflict are .htaccess, robots.txt, license.txt, readme.html, so make copies of these. The other WordPress files and folders all start with wp- (for example, wp-config.php).

The folder would get cluttered with lots of WordPress files, and you would have to keep track of what files are for what.

Usually it’s a good idea to keep things separated, easier to troubleshoot, easier to maintain.

I recommend leaving your web site in public_html only long enough for DNS changes to propagate through the Internet, so people are finding your web site in its new location.

If You Already Have An Earlier WordPress Version Installed

If you have a prior WordPress in public_html, you can use the built-in Update feature, and then enable the multi-site features.

If the prior WordPress is in a different folder, leave it alone, so it is functioning as you set up 3.0 and learn it’s new features. Then export/import to the new version. Don’t modify the old blog until you have everything brought into the new WordPress.

Prepare Your Hosting Account for WordPress 3.0

If you don’t have a hosting account, or if your host can’t give you everything you need, the hosting provider I recommend is LunarPages, they match all the requirements for multi-site, have done it successfully (for Mine!) plus great technical support and low prices. I’ve been completely satisfied, for several years, with their Basic Hosting.

Hosting requirements:

  • If you were running WordPress 2.x, your account probably has everything you need
  • Wildcard DNS (the multi-site features require this). This is the one thing many hosts do not allow.
  • able to modify .htaccess, with mod_rewrite (so the server can modify URLs for multi-site blogs, and for better search engine links)
  • PHP (preferably PHP 5), and MySQL
  • I prefer Apache servers, they tend to cost less than Windows servers, and they are so widely used it’s easy to find answers to any questions you have.
  • Preferably allow you to host multiple domains on one account

I’m giving instructions for an Apache server. There will be some differences if you are on a different type of server, primarily your files wouldn’t be in public_html.

Installing WordPress 3.0 Multi-Site

Here’s what you’ll need to do, to have your existing web site and have multiple blogs using one WordPress installation.

DNS Changes

These take time to spread through the Internet, so make these changes right away.

Move your existing primary domain name so instead of pointing to public_html it is an add-on domain (Have your host’s technical support modify the DNS settings. They can put a place-holder domain name for your Primary Domain for your account.)

You will need a new domain name to run WordPress next to your web site. The multi-site features expect a URL like domain.com (or domain.info, domain.us, etc). It will not work with any subdomain.domain.com. Currently .info domains are very inexpensive.

Wildcard DNS is another change, see below. Unfortunately, you may not be able to do this until these DNS changes have taken effect. If you do this before other DNS changes, you will likely have to delete the wildcard subdomain, and re-install it.

Backup

Now is a great time to back up your entire site. Use CPanel, Backups.

If you have a blog using an earlier version of WordPress, use the Tools, Export feature to make a file that can easily be brought into the new WordPress. (There are also importing tools for bringing in posts from other blog software.)

Note for Version 3.0: There is a glitch with Category and Tag imports. I had, for example, a Tag “Internet Marketing” and a Category “Internet Marketing”. These had different internal names: the Tag slug was “internet-marketing”, and the Category slug was “internetmktg”. When importing, “oops, internet-marketing is taken, oops, internet-marketing-2 is taken, ah internet-marketing-3 is free. The Categories became “internet-marketing-2″, “internet-marketing-3″, “internet-marketing-4″, etc., all with the name “Internet Marketing”. Try changing the Category Name to be UNIQUE, including unique to the Tags you have, before you export, while still being descriptive for search engines (perhaps abbreviate the tag/category you use least). Then you can change the Category Name to look better, after importing.

Have a domain name for WordPress

You will need a new domain name to run WordPress next to your web site (unless you decide to have both in public_html).

The multi-site features expect a URL like domain.com (or domain.info, domain.us, etc). They will not work with any subdomain.domain.com.

The blogs will be addressed with URLs like programming.domain.com, opera.domain.com, basketball.domain.com or they can be assigned to other “Networks” that you define, like programming.otherdomain.com, opera.thirddomain.com and basketball.otherdomain.com

A place-holder name for the Primary Domain for the account, won’t work. (If you have a place-holder for the primary domain, you can Park your new domain, through CPanel, and that will work.) You have to be able to access WordPress from the Internet, even if you are using WordPress to manage blogs for other domains.

There may be a way to have a way to make .htaccess redirects to a subdomain work while having the multiple-site subdomains work, but I haven’t seen it documented anywhere. It will be easier just to install WordPress in public_html, with a new domain name.

Note: as of 6/17/2010, godaddy.com has .info domains for $0.89 ($1.07 including ICANN fees)

Move existing primary domain to add-on

The WordPress code must be installed in public_html so the multi-site features can work. So, you’ll want to move your existing web site to a new location on the server.

If you try installing WordPress in a subdomain, e.g. wordpress.mydomain.com, you will get errors like “Warning! Problem updating http://opera.wordpress.mydomain.com. Your server may not be able to connect to sites running on it. Error message: Couldn’t resolve host ‘opera.wordpress.mydomain.com’”.

Note: If your site is getting visitors, so having it be down for a while (from a few minutes, to rarely up to 3 days) won’t be acceptable, copy your files, instead of moving them. Moving them is quicker, more reliable, easier. Copying them to your computer and uploading them to the new folder lets your site function while the DNS changes are propagating through the Internet. Leave the files in the original location for several days, to make sure all users are accessing the new location, and then delete them from public_html. (Maybe someone who is great with .htaccess redirection can add a comment: How to say “if the file’s not found here, look there”?)

You may have to copy/move the files yourself (some hosting companies will move the files for you, some won’t). FileZilla, a very popular free, cross-platform (Windows, OS-X, Linux) FTP program, lets you move files on the server with by drag-and-drop. Move or copy the folders and files from public_html to the add-on domain’s folder (for example, I moved www.lernerconsult.com from public_html to public_html/lernerconsulting).

To copy the files, make a new folder on your computer, download the files there, then upload them to the new location on your hosting account.

Do not move the folders for any add-on domains, subdomains, or for your FTP users, as these must be in public_html. (Make a list, from CPanel: Addon Domains, Subdomain, and FTP Manager.) Also leave folders that are not part of your main site (for example, if you have a folder where you are just backing up some files).

After you’ve moved public_html/cgi-bin/ you should make a new cgi-bin folder in public_html (it’s expected to be there.)

Don’t move these files:

  • .htaccess since most of the settings in it belong in public_html. You can move the lines that are specific to your add-on domain (e.g. “Redirect Permanent” lines) into a .htaccess file in the add-on folder.
  • Custom error pages. Usually there will be a 404.php (could be 404.html), and maybe also 300.php, 400.php, 401.php, 403.php, 406.php, 410.php, and 500.php). Copy these instead of moving them.

Once your existing domain name is pointing to the add-on domain, test that your web site is working.

  1. Copy a test web page to the new location, with a unique name (any name that isn’t in the old location), so you can verify the DNS change to the new location, has spread through the Internet. Keep occasionally trying the test.html until you see it display (it may take up to two days for the changes to spread).
  2. You should check that all scripts work, and all files that are Included on pages (for example, your site menu, or footer, or Twitter script). Unfortunately, many scripts reference specific server locations, instead of locations relative to the Site Root; those scripts would need to have the file locations adjusted, usually in a configuration file.

Don’t delete files from public_html until your site is working normally, from the new location, or visitors will get errors about “missing” files.

Wildcard DNS working

Must be able to type in any non-existing sub-domain name, for the URL, and have it go to WordPress (public_html/index.php).

Set up wildcards for every add-on or parked domain in the account.

Don’t set up wildcards for your subdomains, even though it appears you could. A sub-subdomain maps to public_html (sanfrancisco.california.mydomain.com maps to public_html/sanfrancisco, not to public_html/california/sanfrancisco, so simply make sanfrancisco.mydomain.com). Other software can use this; WordPress doesn’t.

Make wildcard entries by going to Subdomains in CPanel, and enter * (asterisk) for the subdomain name. (If you don’t use CPanel, then in the DNS area of your web hosting account, add a subdomain with a value of *)

Then give it a few minutes for the change to make it’s way through your host’s servers. Test it works, by uploading a simple test html file to public_html, and browsing to a made-up subdomain (one that has not actually been defined), for example asdf.yourdomain.com/test.html.

If you get an error message when you try browsing to the made-up subdomain, such as “Oops! Firefox could not find asdf.lernerconsult.com“, then the wildcard DNS change hasn’t reached your host’s other servers yet.

Note: when I changed my “primary domain” on my hosting account, all my subdomain entries had to be re-done, including the wildcard subdomains. Delete them (doesn’t delete the files, just the pointer) using Subdomains in CPanel, and re-create them. You won’t be able to delete “subdomains” that are for your add-on domains, even though they show here.

Note: Some web hosting companies don’t have CPanel set up to allow Wildcard DNS through the Subdomains page. Those companies will require changes made manually, by technical support. One site that explains how to do it is http://ma.tt/2003/10/wildcard-dns-and-sub-domains/

Other hosting companies won’t allow wildcard DNS. Switch to another host, if you want multiple blogs. LunarPages is great.

If you are on a VPS or dedicated account, you also need a wildcard record in the vhost entry for that web account. This is in the etc/conf/httpd/httpd.conf file in Apache: ServerAlias *.yourdomain.com.

Single-Site Until Wildcards are Ready

Don’t try to install WordPress Multi-Site features until the domain name for it is working, and the Wildcard DNS (for at least the domain you’re using for WordPress) is working. WordPress will work for single blogs, but the multi-site features won’t work without these working.

Upgrading WordPress

(if you Do have WordPress 2.7 or higher installed)

If you are upgrading from version 2.7 or higher, you can use the automatic upgrader:

This will upgrade you to version 3.0 in single-site (one blog) mode. See below for configuring multi-site mode.

Open wp-admin/update-core.php in your browser and follow the instructions.

If you have an existing WordPress blog, you can use the same Database, but give a different table prefix than the default wp_, for example I used wp3_. Fill in the database connection information from your other blog’s wp-config.php.

Installing WordPress Files

(if you Do Not have WordPress version 2.7 or higher installed)

If your web host has WordPress 3 installation through Fantastico, or other single-click installation, do that.

If not, download WordPress 3 files. Unzip them to a folder on your computer. Edit the files shown below. Then upload the files to your web hosting account, in the the folder where you would put your main web site, the public_html folder.

Even if your web hosting provider has Fantastico or another way to automatically install WordPress 3.0, you will have to modify some of the files to enable Multi-Site.

Use the standard installation instructions, to get WordPress installed (in single site mode). These are in the readme.html file that comes with the WordPress installation files, or online there is a handy guide.

Find out your database connection information, from CPanel Databases, or from your website hosting provider.

You can install your favorite themes and plug-ins. Most themes and plug-ins for WordPress 2.9x work just fine in WordPress 3.0.

You will have to disable all plug-ins to turn on Multi-Site, so you may want to wait till later to install tons of plug-ins (Note: hopefully WordPress will have a way to automatically disable plug-ins, as you are enabling Multi-Site, and then “Restore All Enabled Plug-ins”, but not as of the last pre-release version.)

Make sure you are able to log in, add a post, configure plug-ins, (in other words, that WordPress is functioning), before trying to switch on Multi-Site.

Enable Multi-Site

Edit your public_html/wp-config.php file, adding this line:

define('WP_ALLOW_MULTISITE', true);
The recommended place is above the line: /* That's all, stop editing! Happy blogging. */

You will now see additional menu items.

Update system files

Go to the Tools menu, click Network. Follow what WordPress says to do, for editing some system files.

I picked subdomain installation, since I have several unrelated domain names. (Was not clear whether I could use subfolder installation with unrelated domains.)

Give the domain name, without “http://www” (e.g. lernerconsulting.info), the domain that is mapped to your public_html. Path to current site is / (if you type http://lernerconsulting.info/ you get my dashboard blog, which I never post to, it is for managing my network.)

Edit your .htaccess and wp-config.php files as WordPress instructs you to.

Install Multiple Domain Plugins

I used theses plugins to map domain names to WordPress:

  • WordPress MU Domain Mapping (Map any blog on a WordPress MU website to another domain.) by Donncha O Caoimh.
  • WP Multi-Network (Adds a Network Management UI for super admins in a WordPress Multisite environment) by John James Jacoby.

Other Multi-Site plugins I’m using:

  • Multipost MU (Allow a WordPress MU site administrator to duplicate posts and pages to multiple sub-blogs at once.)
  • WPMU Global Search (Adds the ability to search through blogs into your WordPress MU installation.)
  • YD WPMU Site-wide options (Makes selected WPMU plugin settings site-wide. Change to a setting of your main blog can now be automatically replicated to all sub-blogs. Centralized management of your plugin options.)
Assign Networks

You should now have a new main menu item, Super Admin.

In the Super Admin, Domain Mapping page, set the Server CNAME domain to the domain pointing to your public_html, without www (for example, lernerconsulting.info).

I have Permanent redirect\checked, and Redirect administration pages to original blog's domain unchecked (I haven’t tried it checked, you can try it both ways and see which you prefer).

In the Super Admin, Networks page, you add all the add-on domains you have, without http:// or www (for example, lernerconsult.com)

Once you have added the domain names, and have created sites, you use the Super Admin, Networks page to assign which network a site appears in. On the right side of the page, in the list of domains, click Assign Sites for that domain. The URL to access a site is displayed in the Assigned column. For example, I have a blog on workshop transcribing, and this screen shows “Workshop Transcribing (transcribing.lernerconsult.com”, so I access it with http://transcribing.lernerconsult.com (not http://www.transcribing.lernerconsult.com).

Note that the Update page for a domain only updates the sites for the network the domain is on. If you have 3 networks (3 base domain names that you use), then you will have to go to domain1.com/wp-admin/ and click Update, then go to domain2.com/wp-admin, click Update, etc.

PHP 5

Some plug-ins require PHP 5, and give errors without it.
Example: Parse error: syntax error, unexpected '=', expecting ')' in /home/username/public_html/wp-content/plugins/bubblecast-video-plugin/bubblecast_utils.php on line 264

Turn on PHP5 using CPanel, PHP, or by editing your your public_html/.htaccess :
AddHandler application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml

Importing Your Posts from Earlier Version of WordPress

This is much easier if you still have the code for WordPress 2.x installed. Simply go to that blog’s wp-admin, Tools, Export, save the file to your computer. If you uninstalled 2.x, install it to a new folder, so you can do the Tools, Export. Or, look online for how to edit the database, replacing references to the old URL to the new one.

See the comment in Backup (above) about Category and Tag names glitch in WordPress 3.0.

Then go to WordPress 3, do a Tools, Import.

Update Other System Files

Update public_html/ robots.txt, adding these lines:

# Word Perfect
Disallow: /wp-admin
Disallow: /wp-includes
Disallow: /wp-content/plugins
Disallow: /wp-content/cache
Disallow: /wp-content/themes
Disallow: /category/*/*
Disallow: /comments
Disallow: */comments
Disallow: /feed
Disallow: */feed
Disallow: /manager
Disallow: /trackback
Disallow: */trackback
Allow: /wp-content/uploads

You should now have WordPress working with multiple sites. Try picking a topic you want to blog about, and type topic.yourdomain.com in a web browser. If WordPress is working properly, you will get a screen to create a new blog. If you are managing multiple networks, assign the blog to the appropriate network, in Super Admin, Networks.

Any questions, or comments?

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Posted in Blogging, HTML, CSS, PHP, WordPress.

Tagged with , , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

You must be logged in to post a comment.