Installing Wordpress MU

From Eastnet
Jump to navigationJump to search

Installing Wordpress MU

Introduction

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.

Preparation

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


Get Wordpress

cd /tmp
wget http://mu.wordpress.org/latest.tar.gz
mv latest.tar.gz WordPress-MU.2.9.2.tgz

Make SQL Database

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

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

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/phatic.org 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 phatic.org

Configure DNS and Apache

Assuming we are using the domain phatic.org 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  ns0.eastnet.ca. hostmaster.eastnet.ca. (
                        201003312300    ; Serial
                        10800           ; Refresh 3 hrs
                        3600            ; Retry 1 hour
                        604800          ; Expire 1 week
                        86400   )       ; TTL
                        IN      NS      ns0.eastnet.ca.
                        IN      NS      ns0.uknet.net.
                        IN      NS      ns0.hicom.org.
                        IN      NS      ns.scramworks.net.
$ORIGIN phatic.org.
                        IN      MX      10 ASPMX.L.GOOGLE.COM.
;
                        IN      A       78.47.217.147
*                       IN      A       78.47.217.147
;

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 http://phatic.org 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/phatic.org
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: Eastnet.ca Weblogs
  • Mail: michael@eastnet.ca

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/phatic.org/index-install.php

Change password etc etc...

Domain mapping

First download the plugin WordPress MU Domain Mapping (http://wordpress.org/extend/plugins/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 (addon-example.com) and you will see the contents of subdomain.master-example.com

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

<VirtualHost *>
        ServerName phatic.org
        ServerAlias phatic.org *.phatic.org
        ServerAlias carbootsale.org *.carbootsale.org
        ServerAlias phoneshop.com *.phoneshop.com
        ServerAlias pageoftheday.com *.pageoftheday.com

Final bits

Also created a user called wpftp with home if /data/www/phatic.org 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] WordPress.com 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 http://wordpress.org/wordpress-mu-3.0.zip.
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

    * http://superhighwayman.phatic.org
    * http://drjess.phatic.org
    * http://brassfeathers.phatic.org
    * http://techiegirls.phatic.org
    * http://misrepresent.phatic.org

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

    * http://meikdo.phatic.org
    * http://kinkybridal.phatic.org
    * http://freecycle.phatic.org
    * http://staffsafe.phatic.org
    * http://senika.phatic.org

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

    * http://phonetext.phatic.org
    * http://park-pictures.phatic.org
    * http://pageoftheday.phatic.org
    * http://dumdede.phatic.org
    * http://carbootsale.phatic.org

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 phatic.org, but other than that - Everything seems good.

Sunrise problem

Michael 02:34, 27 November 2010 (AST)

http://wordpress.org/support/topic/plugin-wordpress-mu-domain-mapping-define-sunrise-problem-resurrection

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/phatic.org# cp wp-content/sunrise.php wp-content/sunrise.php.OLD
root@eris:/data/www/phatic.org# cp ./wp-content/plugins/wordpress-mu-domain-mapping/sunrise.php ./wp-content/sunrise.php