Wordpress

WordPress 3.0 Multisite With Multiple Domains Setup

WordPress 3.0 multisites lets you easily publish multiple sites, on multiple domains, within one installation.  This is a time-saving option for those of us who need to manage multiple separate domains running WordPress, but it does take a little knowledge and file access to set up, and at the moment isn’t for anyone who doesn’t consider themselves technically proficient.

You will need to be able to modify your vhosts file in order to do this, but once done you will have a very flexible and powerful server.

This article is written for 3.0 alpha, as of the current build on 19th March 2010.

Multi sites mode

  1. Install Wordpress 3.0 and install as a normal Wordpress.
  2. Add define(’WP_ALLOW_MULTISITE’, true); near the top of wp-config.php
  3. Log into the admin go to the tools/Nertwork menu.
  4. If it asks you to deactivate all plug-ins do so otherwise go straight ahead and set up multi sites as sub-domains and fill in the other details as needed as needed.
  5. Make a note of the changes needed to wp-config.php and .htaccess and make the changes.
  6. You should now be in multi-site mode.

Adding a new domain

  1. Now we’re in multisite mode login as admin go to super admin/sites
  2. Add a new site – the address can be anything you like just make it unique and make it something you can remember so we can find it easier in the db.
  3. Make sure your domain is pointing at the server if not do so and wait for it to propagate.
  4. Add Vhost alias to the root domain. So if in the Vhost file you have ServerName mywordpres3root.com you would add ServerAlias mynewwordpress.com beneath it.  Alternatively, you can use a wildcard here, but in our implementations there are good reasons why we prefer to specify the host aliases.
  5. Open up the db for editing and add a new row to wp_site table
    1. site_id, domain and path.
      1. i.      site_id, will be a new unique id, remember it
      2. ii.      domain, should be set to the new domain name added above.
      3. iii.      path should be /
  6. Change the row in wp_blogs that matches your new site and make a note of the blog_id.
    1. Change site_id to the new site_id created above.
    2. Change domain to our new domain name.
  7. Open up wp_[blog_id]_options table.
    1. Change siteurl to the new domain name.
    2. Change home to match the new domain name.
    3. Change the fileupload_url to match the new domain.
  8. Your new site should now be ready, you’ll need to go in and set all the options for the domain now. If you wanted a clone of the root sites options you could copy all the rows in wp_sitemeta with a site_id matching the site you wanted to clone and just change the site_id to the new site.

The instructions above are obviously given without any guarantee – use at your own risk, especially if converting your site from single site to multisites.  If you have any feedback or better approaches then do let us know in the comments below.

Wordpress 3.0 with multiple domains.
Multi sites mode
1.
Install Wordpress 3.0 and install as a normal Wordpress.
2.
Add define(’WP_ALLOW_MULTISITE’, true); near the top of wp-config.php
3.
Log into the admin go to the tools/Nertwork menu.
4.
If it asks you to deactivate all plug-ins do so otherwise go straight ahead and set up
multi sites as sub-domains and fill in the other details as needed as needed.
5. Make a note of the changes needed to wp-config.php and .htaccess and make the
changes.
6. You should now be in multi-site mode.
Adding a new domain
1. Now we’re in multisite mode login as admin go to super admin/sites
2. Add a new site the address can be anything you like just make it unique and make it
something you can remember so we can find it easier in the db.
3. Make sure your domain is pointing at the server if not do so and wait for it to
replicate.
4. Add Vhost alias to the root domain. So if in the Vhost file you have ServerName
mywordpres3root.com you would add ServerAlias mynewwordpress.com beneath it.
5. Open up the db for editing and add a new row to wp_site table
a. site_id, domain and path.
i. site_id, will be a new unique id, remember it
ii.domain, should be set to the new domain name added above.
iii.
path should be /
6. Change the row in wp_blogs that matches your new site and make a note of the
blog_id.
a. Change site_id to the new site_id created above.
b. Change domain to our new domain name.
7. Open up wp_[blog_id]_options table.
a. Change siteurl to the new domain name.
b. Change home to match the new domain name.
c. Change the fileupload_url to match the new domain.
8. Your new site should now be ready, you’ll need to go in and set all the options for
the domain now. If you wanted a clone of the root sites options you’d could copy all
the rows in wp_sitemeta with a site_id matching the site you wanted to clone and just
change the site_id to the new site.
Categorised as: Wordpress

Using MySQL Workbench with XAMPP

Please Note, it’s been pointed out that I need to make it clear that this covers version 5.2, the developer release, of MySQL Workbench.  The principles still apply to 5.1, but it’s a different process that I’ve not documented at all.  Apologies for any confusion.

This is a slight departure from our usual posts as it’s not about WordPress. However, if you’re developing with WordPress on a Windows PC there’s a good chance you’re using XAMPP as your platform.

I always liked the MySQL Administrator and MySQL Query Browser tools, but these have recently been deprecated and will not be updated any more. Read more

Categorised as: Wordpress, mySQL

WordPress Distributions are the Future

If you’ve been involved in WordPress over the past few years you’ll have seen it change from being an excellent but limited blogging platform into something on which you can build much more complex websites.  We ourselves have been involved in some pretty sophisticated uses of the system – for example, over at Telecoms.com which makes extensive use of various elements of WP functionality as well as having quite a lot of custom code bolted in. Read more

Categorised as: Wordpress

Migrating a WordPress/WPMU/BuddyPress Website

Migrating a WordPress site can be something of a scary challenge, but we do it a lot, and we’ve become used to it. There are many good reasons to move a site – for example, you might set one up in a subfolder, and decide to move WP to the root. Or perhaps you’ve built a site on localhost and now need to put it on a live server. Read more
Categorised as: Wordpress

A Common-Sense WordPress Security Primer

This is a real-life burglar... still easier to identify than a hacker, sadly.  Creative Commons Share-Alike Attribution Picture by Jofus.

This is a real-life burglar... still easier to identify than a hacker, sadly. Creative Commons Share-Alike Attribution Picture by Jofus.

There’s been a big fuss lately over the latest WordPress hacks that have targetted older versions of WordPress.

And in my view, they show the less pretty side of WordPress and some people in the community… but not all of them.  The attitude has been a straight “upgrade your blog and you’ll be secure.”

Well, I have news for you.  They’re wrong. Read more

Categorised as: Wordpress

Running a WordPress Plugin, always…

As seen on my local WP development environment

As seen on my local WP development environment

Sometimes you’ve created a site with WordPress standard (not single user), but have had allow the site owners or users to have full admin access to it.  You have plugin and theme dependencies, and if the site owner disables that plugin, you have problems.

For example, you’ve written a plugin that carries out a certain range of syndication functions for your client.  If the client accidentally disables it he will lose money, and you will have a call-out, potentially an angry one, when he finds out.  He wants admin access, but you know he’s dangerous with it.

So, since WordPress 2.8 you’ve had the facility to create a folder in wp-content called mu-plugins.  It will work just like the mu-plugins folder in WordPress MU – as in, any plugin placed there, will run automatically.  Activation code won’t fire off, but apart from that, so long as the plugin is correctly written, everything will work.

I’m not sure if this change is a part of allowing ‘must-use’ plugins support, as suggested in http://core.trac.wordpress.org/changeset/10737 or if it’s also planned as part of the move towards merging WP single user and WP-MU.  Either way, it’s an incredibly useful tool for those of us who set up and configure sites for clients who are a little prone to fiddling.

Watch out for plugin updates – you can’t auto-update anything in mu-plugins, and you won’t receive any notifications.  Be aware that you have to stay on top of this by yourself, just like in the old days!

Categorised as: Wordpress

WordPress 2.8.4 Released

wpbug

Slightly broken code, now fixed.

Those who follow WordPress closely will understand that a vulnerability has been found that, whilst not being especially dangerous, could be very annoying for some – especially for high-profile blogs.

By using a specially crafted URL, it’s possible for an attacker to force a reset of the admin password.  The attacker can’t know this admin password, it will be a random string, and this password will be e-mailed to the administrator of the blog.  However, there’s no denying that this could be annoying to the administrator.  More specifically, an administrator could be locked out of a block while some other exploits are tried, simply by resetting the password at short intervals.

So, it’s not the end of the world, but it’s an annoyance and in a few rare cases a potentially dangerous one.

To fix this vulnerability in older versions of WordPress, such as 2.7, you can manually change wp-login.php using the code shown in the Changeset on the WordPress Trac: http://core.trac.wordpress.org/changeset/11798 – ideally, you should upgrade to the just released WordPress 2.8.4 but if you have legacy reasons for staying with 2.7 (and many have, for example problems with widgets) then you may need to delay this.

Categorised as: Wordpress

WordPress in News & Media Presentation

This is the presentation given by David Coveney at WordCamp UK 2009 in Cardiff. It covers the advantages, problems and implementations of WordPress as used by the News & Media sectors.

If you need to view the slide notes (primarily for me, to be honest, but you may see some points that got cut during the presentation) you’ll have to visit the Slideshare site.

Categorised as: Wordpress

WordPress in the Enterprise Presentation

This is the presentation given by David Coveney at WordCamp UK 2009 in Cardiff. It covers the advantages, problems and opportunities of WordPress within the Enterprise space.

If you need to view the slide notes you’ll have to visit the Slideshare site. But the notes are really for me, so they’re a little messy.

Categorised as: Wordpress

We’re Presenting at WordCamp UK 2009

Be there to get the latest news and network with the leading lights of WordPress in the UK

Be there to get the latest news and network with the leading lights of WordPress in the UK

Last year we decided to keep quiet at WordCamp UK, on the whole, beyond a spot of sponsorship – simply because we didn’t have that much to talk about that we felt could be exciting.  But a year has changed a lot – WordPress is becoming popular for large scale blogging platforms such as The Telegraph Blogs, and for use as a news platform such as at Telecoms.com. Read more

Categorised as: Wordpress
Next Page »