Posts Tagged ‘wordpress mu’

Multiple domain names on WordPress MU

Polish class EN57 EMUs waiting for service in ...
Image via Wikipedia

We’ve been getting up close and personal with WordPress MU for a while now here at Gazette Communications.  To say the least – it has been nice, and painful.  We tested the product for use on one of our two flag ship products for about a month and then went to use it and ran into a bit of a brick wall.

WordPress MU doesn’t support multiple domain names out of the virtual box.  Yup, just sub-domains or domain.com/foldername.  I think we over looked that part in the “testing phase”.

Luckly – we did some searching and our intern at the time (Chaz Beck) found a post by a guy who had accomplished the same task – here is a rundown of what we did to ge tit working.  Not for the faint at heart – and by all means, please make a backup before you try.

For setting up the multiple domains under one WordPress MU installation, credit must be given to Richard Bui @ http://bui4ever.com/ for his excellent step by step guide. His guide helped create these instructions.

Warning: Manual database manipulation ahead.  :)

Prerequisites

Sub-Domains, Not Sub-Directories.
You need Subdomains being used instead of subdirectories for WordPress MU (We tried to use subdirectories but the login ability failed).

To turn on subdomains go to: http://welcome.totheinter.net/2009/05/06/changing-wordpress-mu-from-subdomains-to-subdirectories/ for instructions.

The main thing is setting:

define(‘VHOST’, ‘yes’);

->inside wp-config.php – this will make the switch from sub-directories to sub-domains

Domain Names:
It is assumed that you have setup the domains that are to be used, Richard Bui has some instructions on some of this [steps 1-11].

The Steps

  1. Create the blogs that you want use if you haven’t done so already (Site Admin >Blogs > Add Blog).
  2. Access your database that WordPress MU uses through PhpMyAdmin (or other tool).
  3. Navigate to wp_#_option where # is the id for the blog you want to use with a different domain (hint: the siteurl in the table will say the name of the blog).
  4. Change the siteurl, home, and fileupload url to your new domain, for the fileupload url keep the /file at the end of the url. Also make sure you put a forward slash (/) at the end of siteurl and home.
  5. Navigate to wp_blogs, click on the domain you are changing. Edit the blogs you are switching to a domain. Put in the following changes:
    • site_id = blog_id
    • domain = yournewdomain.com
    • path = /

    Write down the blog_id for later use

  6. Navigate to wp_sitemeta, copy the meta_value for site_admins meta_key. The stuff you need to copy looks something like this:a:1:{i:0;s:5:”admin”;}
  7. Inside the wp_sitemeta table, copy the meta_value for illegal_names.
  8. Navigate back to wp_sitemeta and go to the last page, copy the last meta_id value
  9. Insert a new entry into the wp_sitemeta table with these values:
    • meta_id = step 8’s value + 1
    • site_id = step 5’s value
    • meta_key = site_admins
    • meta_value = step 6’s value
  10. Insert a new entryinto wp_sitemeta table with these values:
    • meta_id = step 8’s value +
    • site_id = step 5’s value
    • meta_key = yournewdomain.com
    • meta_value = NULL
  11. Insert a new entryinto wp_sitemeta table with these values:
    • meta_id = step 8’s value + 3
    • site_id = step 5’s value
    • meta_key = illegal_names
    • meta_value = step 7’s value
  12. Go to your new domain to test out if the site worked
  13. Test out the wp-admin of the new domain.Example, http://yournewdomain.com/wp-admin/ <- notice the forward slash at the end, this is important to include otherwise your database won’t be populated correctly (first time accessing wp-admin only, after that you can forget about the last forward slash)
  14. Look at the wp_sitemeta table and make sure a bunch of new entries were created in the database, this means everything worked.
  15. Lastly, update your database with the url of the new domain:
    • UPDATE wp_#_posts SET guid = REPLACE (
      guid,
      ‘http://exampleoldsiteurl.com’,
      ‘http://examplenewsiteurl.com’;|
      and
      UPDATE wp_#_posts SET post_content = REPLACE (
      post_content,
      ‘http://oldsiteurl.com’,
      ‘http:// newsiteurl.com’;

    Where # is the blog_id value from step 5

Again – this is not for the faint at heart, or one that is scare of manually manipulating the database.  But I will tell you we have three different domain names running all under one install of MU.  So – that is a real time saver.

References:

http://bui4ever.com/2007/06/wordpress_mu_with_domain_mapping/

http://bavatuesdays.com/multiple-domains-on-wpmu-mission-accomplished/

http://welcome.totheinter.net/2009/05/06/changing-wordpress-mu-from-subdomains-to-subdirectories/

http://codex.wordpress.org/Changing_The_Site_URL#Domain_Name_Change

Enhanced by Zemanta

Rolling the WP 2.7

Category:Wikipedians who use WordPress
Image via Wikipedia

After a few hours of wraslin’ – I was able to move my blog to WordPress 2.7.  Yes, I did say hours – but I’ll admit…it wasn’t WordPress’s fault.  I was moving from WordPress MU and a nice, but not overly friendly host.

All in all – it is worth it.  WP 2.7 is smokin’ hot and is definetly a revolution, not an evolution.

Enhanced by Zemanta

Wordpress "blogs.dir" permission issue solution

Computer Data Output

Image by Joshua Davis (jdavis.info) via Flickr

Not that it is a hard find, butwe had a problem crop up yesterday with a wordpress mu installation that was causing a permission error when media was attempting to be uploaded to the blog.  Here is a nifty solution which seems to be a common issue  (link to thread):

This worked for me, using a Plesk environment:

Make sure the web server user (apache in my case) is a member of the group owner of the blogs.dir folder (psacln in my case.) Doing this enabled me to keep the blogs.dir and subfolders 775.

usermod -G psacln apache

We were also working under Plesk – so it was a double bonus.

Enhanced by Zemanta
Twitter Delicious Facebook Stumbleupon