skip to main content

TAMU Webmaster's Blog


Information and insight from the A&M Webmasters

blog

WordPress 3.0 Multi-Site Installation on the Campus Network

Most of you know by now that WordPress 3.0 has merged the multi site capabilities of WordPress-mu into the mainstream release.  One of the biggest problems we have faced on campus is that the multi domain capabilities built into WordPress were never intended for a large domain such as .tamu.edu. It was instead designed for the myriad of hosting services that allow individuals to have their own private domain on a hosted service.  As such their methodology of requiring DNS wildcard entries to manage multiple subdomains was not terribly unbearable.  For a network like ours, though, it would be inconceivable.  No matter how kind our friends over in Networking may be, nobody is going to get *.tamu.edu assigned to their blog server.

That doesn’t mean that multisite won’t work, though.  After a day searching Google and some experimentation on my own I was able to figure out how to get it working.  The process isn’t that difficult, and is in fact only a slight modification from the default installation. The difficulty was largely in the terminology used by the WordPress documentation

The following instructions assume you have access to NIM to manage your DNS entries, a basic understanding of Apache configuration, and are the web root and WordPress administrator. I will use the terminology myblogs.tamu.edu to refer to the primary server name and blog-1.tamu.edu, blog-2.tamu.edu … blog-x.tamu.edu to refer to content blogs managed by the system.  Substitute your names in your configuration as appropriate.

Pre-installation setup

  1. Log into NIM and claim a name/IP address for your server (e.g, myblogs.tamu.edu)  This can be the name of one of your blogs, but I prefer to make it separate and have each one of the individual blogs be its own virtual host. This then gives you an administrative site to log into that won’t affect any of your content blogs.
  2. While in NIM, associate a CNAME with the new server for each blog that you want managed by WordPress (blog-1.tamu.edu, blog-2.tamu.edu, etc.)
  3. Download WordPress into your server’s web root directory. I prefer to do this through SVN, but if you prefer to download the .zip file that’s fine.
  4. Configure Apache.  You have two options. I prefer to create separate virtual hosts for each blog so that you can easily give and manage customizations (log files, etc.) for each one.  All of the config files should set the DocumentRoot to be the same directory in which you installed WordPress, otherwise configure as you would for any other website.  If you prefer not to manage multiple virtual host configurations you can use one config file and simply use the ServerAlias directive to specify all of the CNAMES that you want managed by WordPress.

Install WordPress

  1. Temporarily chown your web root to www (or whatever your Apache’s user is named.) WordPress will need to make some file changes, and it’s easier to let it make the changes than do them all by hand. Just remember to reset the ownership once you’re done!
  2. Create an empty database in mysql –  “wordpress” is the default, which is generally fine.
  3. Go to your server’s webroot (i.e, http://myblogs.tamu.edu, not one of your content blogs) in a web browser and follow the creation wizard.
  4. Edit wp-config.php and add define('WP_ALLOW_MULTISITE', true); right before the comment /* That's all, stop editing! Happy blogging. */
  5. Add the WordPress MU Domain Mapping plugin to the /wp-content/plugins directory. This page actually has much better technical explanation of the networking changes than the default WordPress guide.
  6. Log out and back in.  Go to the Network link under Tools.  Select Subdomains and enter your contact information.
  7. Copy the code and create the directories as indicated on the resultant web page.
  8. Log out and back in, and then activate the domain mapping plugin.
  9. Copy sunrise.php from the domain mapping plugin directory to wp-content/
  10. Add define( 'SUNRISE', 'on' ); to wp-config.php with the other code additions you’ve made. Be sure not to put it at the very bottom of the page!
  11. In the Super Admin box, under Domain Mapping, add IP address or domain name of your server.
  12. Under Admin, go to Create New Site and fill in the requested information.  The subdomain will be wrong – it will give you the option of putting in a name but have .myblogs.tamu.edu hard coded.  That’s ok, fill in the name and we’ll change that next.
  13. Edit the site that you just created and remove all of the .myblogs domain references (scroll down, there are several) to blog-x.tamu.edu
  14. Go to the Domains link and add the information for the blog you just created.
  15. Add users and associate them with the proper blogs.
  16. The wpCAS plugin will allow you to do campus CAS authentication, much better than the default and it means you won’t have to install SSL onto your blog server just to handle logins.
  17. This should finish the installation process.  Each of your blogs should show up on their own subdomains.  If you are able to see the blog but have problems logging in that typically signifies a problem with the domain mapping plugin.

Tags: ,

Monday, August 9th, 2010 Ongoing Projects 4 Comments

Blog Migration

After much wailing and gnashing of teeth I finally got WordPress 3 working in multi-domain mode with campus addresses.  If anybody is interested I can post the instructions.  The process is pretty simple once you throw away their documentation and look to the Google forums instead.

This is the first of our blogs to be moved over to the new platform.  The migration process is far from comprehensive so please forgive any quirks that we missed.  We will be moving most of our other blog sites over to this platform over the next few weeks.

Tags: ,

Thursday, August 5th, 2010 Ongoing Projects 3 Comments

WordPress Lessons Learned

I got a problem ticket yesterday saying that the RSS feeds for this and all of our other blogs had quit working, the error stating that the XML was invalid because there was a blank line at the top of the file where the xml declaration was expected to be.  A Google search showed that this same problem ws affecting lots of bloggers out there, but there did not seem to be one bug consistently causing the same problem for everyone.

Finally I tracked it down to an upgrade I made a few weeks ago. As we are updating our hardware architecture we are also upgrading things like access control and password policy.  I had therefore moved the WordPress database login information into a file outside the web root and called the information as variables rather than hard-coded strings.  Unfortunately this php include file had a line break after the final closing ?>  and because of the multiple include calls WordPress makes before it ever prints a line, this space got stuck at the top of the RSS feed and invalidated it. So lesson to be learned — when modifying WordPress files be very careful about hitting that “enter” key.

(Note, because we publish through Feedburner, which is not real time, you may still be getting the error on the feed. This should resolve itself as Feedburner refreshes itself.)

Tags: ,

Friday, September 18th, 2009 Miscellaneous No Comments

Please excuse our mess…

For those of you who might have visited the blog earlier this morning, you caught us in the middle of an upgrade that didn’t go as smoothly as expected.  But we’re back now, and better than ever.  We have made a few tweaks and added a few plugins. The changes are subtle but should help us create a better service for the camups community.

Tags: , ,

Tuesday, July 7th, 2009 Miscellaneous No Comments

Categories

Archives