Installing Wordpress MU

From Eastnet
Jump to: navigation, search

Installing Wordpress MU


This is an as yet unfinished page...

There are a few pages on installing Wordpress MU and just about all of them seem to be wrong. As far as I can see there is no clear and concise guide for somebody to take an Ubuntu package and install and configure it from the command line. Some are ok, I picked up some bits from a few relative good ones but they have a tendency to say things like "Now create the database" and leave a whole swathe of configuration as though it just happens by magic. It doesn't.

In this hopefully concise and complete guide we'll run through a complete installation - I am assuming you have root access and you have a # prompt. If you don't then type "sudo bash" and get one. This is not an idiot's guide, it expects a relatively high amount of knowledge of things and only really bothers to highlight anything a little out of the ordinary as well as being a quick and easy walkthrough.

This will run you through installing Wordpress MU 2.9.2 - Shortly after I wrote this, 3.0 was released, but most of this will also cover that. There are also notes at the end about the 2.9.2 to 3.0 auto-update.


We are assuming that Apache2 and MySQL are installed and working happily.

Get Wordpress

cd /tmp
mv latest.tar.gz WordPress-MU.2.9.2.tgz

Make SQL Database

mysql -h localhost -u root -p
<type password>

   GRANT ALL PRIVILEGES ON wpblogdb.* TO "wpblogadmin"@"localhost"
   IDENTIFIED BY "welovespam";

Should you ever want to delete it, incidentally...

mysql> DROP DATABASE wpblogdb;
Query OK, 18 rows affected (0.31 sec)
mysql> EXI

Decide where you want this thing...

Mine is at /data/www/ which is within my Apache2 data scope, this is kind of important.

cd /data/www
tar vzxf /tmp/WordPress-MU.2.9.2.tgz
mv wordpress-mu

Configure DNS and Apache

Assuming we are using the domain we need to add a wildcard DNS record for this to point at our host. The zone file is roughly:

$TTL    86400   ; one day
@                       IN SOA (
                        201003312300    ; Serial
                        10800           ; Refresh 3 hrs
                        3600            ; Retry 1 hour
                        604800          ; Expire 1 week
                        86400   )       ; TTL
                        IN      NS
                        IN      NS
                        IN      NS
                        IN      NS
                        IN      MX      10 ASPMX.L.GOOGLE.COM.
                        IN      A
*                       IN      A

Also, in the apache2 configuration file for the domain It is vital you change "AllowOverride None" to "AllowOverride All" in whatever references the data directory.

Test with browser

An initial test with the browser pointing to wants me to change a permission but since we are here we may as well change ownership of all of this to the www user. So:

cd /data/www/
chown www-data.www-data .
chown -r www-data.www-data *

It is worth checking that there are no .htaccess files in there, there shouldn't be yet but check for the hell of it.

Set up the application in the Web interface

  • Use Subdomains
  • Db name wpblogdb
  • Db user wpblogadmin
  • Db pass welovespam
  • Db host localhost
  • Site: Weblogs
  • Mail:

Delete Installer

It tells me: "Now that you've installed WordPress µ, you don't need the installer any more. You can safely delete index-install.php now. It's always a good idea to remove code and scripts you don't need"

You can log in using the username "admin" and password 1234567890

  • rm /data/www/

Change password etc etc...

Domain mapping

First download the plugin WordPress MU Domain Mapping (

Copy sunrise.php into wp-content/

Copy domain_mapping.php into wp-content/mu-plugins/

Edit the main wp-config.php and uncomment the SUNRISE definition line: define( .SUNRISE., .on. );

Now go to Plugins and activate the mapping plugin for the main domain (or sitewide if needs be) After you done those login as the MU admin and go to Site Admin->Domain Mapping and set the server IP address. (you should know this from when you added the A record)

Now this is the tricky part on what I wasted a lot of hours. Go to Site Admin -> Options and scroll down at the bottom. And after where it says "Site Wide Settings" click on the check box for the Plugins and click Update Options. This activates the plugins for the sub-domains. If you don't do this you can't map domains to the specific sub-domain because you will not see the plugin on your sub-domains admin area. (First I actually edited this directly in the database until I realized this.)

Now go to Site admin -> Blogs and when you hover over the added sub-domain some link will appear. Click on "Backend". This will redirect you to that sub-domain Wordpress administration panel.

While in this panel go to Plugins and you should see the mapping plugin. Activate it.

And now go to Tools -> Domain mapping. And here is the part that we worked so hard to get to. Under "Add new domain" write the domain that you want to map to this sub-domain.

After you clicked "Add" go to the domain that you wanted to map ( and you will see the contents of

In /etc/apache2 sites available, change the main site (in this case, and add any more into the Serveraliases:

<VirtualHost *>
        ServerAlias *
        ServerAlias *
        ServerAlias *
        ServerAlias *

Final bits

Also created a user called wpftp with home if /data/www/ so I can update in the site.

Congratulations! You are done! Michael 03:44, 14 May 2010 (ADT) Michael 02:32, 27 June 2010 (ADT)

Notes on Plugins

This is a left over note - you can happily ignore it.

Useful and popular Wordpress plugins:

[d] All in One SEO Pack: Optimizes your WordPress blog for search engines.
[d] Google XML Sitemaps: Notifies search engines of updates to your site.
[d] NextGEN Gallery: Easy to use image gallery with a Flash slideshow option.
[d] Stats: Provides detailed visitor statistics, optimized for blogging.
[d] WP Super Cache: Accelerates your blog by serving 99% of your visitors via static HTML files.
[d] Contact Form 7: Provide contact forms with spam filtering, CAPTCHA, and Ajax submit.
[ ] Sociable: Promote your content by adding links to social sharing and bookmarking sites.
[ ] Viper's Video Quicktags: easily embed videos from all the major web video sites.
[ ] Simple Tags: automatically adds tags and related posts to your content.
[ ] WP-DB-Backup: easily backup your core WordPress tables.
[d] Google Analytics for WordPress: track visitors, AdSense clicks, outgoing links, and search queries.
[ ] WP-Polls: Adds an easily customizable AJAX poll system to your blog.
[ ] podPress: Adds features to make WordPress the ideal platform for hosting a podcast.
[ ] WP-PageNavi: Adds more advanced paging navigation.
[ ] Ozh admin dropdown menu: Creates a drop down menu with all admin links.
[ ] MaxBlogPress ping optimizer: Prevents blog from being tagged as a ping spammer.
[d] Askimet Spam

Upgrade from 2.9.2 MU to 3.0

Michael 01:56, 27 June 2010 (ADT)

Upgrade Links

Notes on my upgrade

Auto Upgraded - Things went mostly smoothly:

Upgrade WordPress
Downloading update from
Unpacking the update.
Verifying the unpacked files…
Installing the latest version…
Upgrading database…

WordPress upgraded successfully

Warning! WordPress encrypts user cookies, but you must add the following lines to wp-config.php for it to be more secure.
Before the line /* That's all, stop editing! Happy blogging. */ please add this code:

define( 'NONCE_SALT', 'nS+lgEDH>vi9GCKw!xf/AE(A]~{;}kjv)A(:K6P5nyL0F`H_+D&s%=56_JzOJ&mt' );    (this isn't the proper one)

Thank you for Updating! Please visit the Update Network page to update all your sites.

The wp-content/blogs.php file is deprecated. Please remove it and update your server rewrite rules to use wp-includes/ms-files.php instead.

Update Network


If your browser doesn’t start loading the next page automatically, click this link:


If your browser doesn’t start loading the next page automatically, click this link


If your browser doesn’t start loading the next page automatically, click this link:

Some things like clean-contact form seem ill - So I have globally enabled the ONW Simple Contact Form (with Captcha) - We will see how that goes. Also some site side plugins seem to be disabled. There is a new theme called twentyten which is nice but needs enabling in the network themes page. Had to re-enable Domain Mapping on, but other than that - Everything seems good.

Sunrise problem

Michael 02:34, 27 November 2010 (AST)

When upgrading some of the MU support, there was a problem with the sunrise file - The fix is easy but hardly intuitive:

root@eris:/data/www/ cp wp-content/sunrise.php wp-content/sunrise.php.OLD
root@eris:/data/www/ cp ./wp-content/plugins/wordpress-mu-domain-mapping/sunrise.php ./wp-content/sunrise.php