<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Penguin Dreams &#187; wordpressMu</title>
	<atom:link href="http://penguindreams.org/tag/wordpressmu/feed/" rel="self" type="application/rss+xml" />
	<link>http://penguindreams.org</link>
	<description></description>
	<lastBuildDate>Thu, 24 Jun 2010 19:50:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Guide for New WordPressMu Administrators</title>
		<link>http://penguindreams.org/blog/guide-for-new-wordpressmu-administrators/</link>
		<comments>http://penguindreams.org/blog/guide-for-new-wordpressmu-administrators/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 15:27:22 +0000</pubDate>
		<dc:creator>sumdog</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpressMu]]></category>

		<guid isPermaLink="false">http://penguindreams.org/?p=162</guid>
		<description><![CDATA[Recently I migrated several websites from various web applications and frameworks onto a common WordPress base. I chose WordPress because it has a large adoption audience, a massive range of plug-ins and a good release cycle. I decided to use WordPressMu (multi-user) to handle several websites from one base install. I ran into a couple [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I migrated several websites from various web applications and frameworks onto a common WordPress base. I chose WordPress because it has a large adoption audience, a massive range of plug-ins and a good release cycle. I decided to use WordPressMu (multi-user) to handle several websites from one base install. I ran into a couple of interesting caveats and unique gotchas I&#8217;ve decided to document here in hopes of assisting other WordPressMu administrators. </p>

<p><span id="more-162"></span></p>

<p><br /></p>

<h3>Introduction</h3>

<p>This guide is intended for administrators who are familiar with their operating system (Windows, Linux, Mac), MySQL and, to a lesser extent, <span class="caps">PHP.</span> It does have a lot of assumed knowledge, such as that you have successfully installed WordPressMu and know how to access a MySQL console to the database. You may want to read the documentation on <a href="http://mu.wordpress.org/">WordPressMu</a> website for installation guides and additional assistance. </p>

<p><br /></p>

<h3>Installation and Quick Upgrades</h3>

<p>If you&#8217;re running a dedicated server and have control over the virtual host configuration, you&#8217;ll probably point your <code>DocumentRoot</code> of each domain to your WordPressMu installation. For those of you on shared hosting or cloud hosting solutions, you&#8217;ll most likely symbolically link the predetermined document root to your WordPressMu install. In either case, it&#8217;s good practice to include the version number with the installation directory and use a symbolic link to point to the current version as shown below. </p>

<p><img src="http://penguindreams.org/files/2008/12/wp_installation_screen.png" alt="WP Install Dir" title="WordPressMu Installation Directories"  class="size-full wp-image-176" /></p>

<p>It may seem redundant to have a symbolic link called <code>wordpress</code> which points to the specific production version. Why not just point to the directory with the version number directly? Using the <code>wordpress</code> link allows an administrator to switch over from one one version of WordPressMu to another quickly without having to change a series of other symbolic links or <code>DocumentRoot</code> directives. It also allows for an administrator to test a new version of WordPressMu on just one or two domains. You may even consider setting up a <code>wordpress-dev</code> symbolic link to use for development environments if they happen to be hosted on the same server. </p>

<p><br /></p>

<h3>Setting up Multiple Domains</h3>

<p>By default the base WordPressMu is intended to allow users to register new blogs and place them in subdomains of the domain for the base blog. I wanted to use WordPressMu for multiple websites each on their own domain. Two plug-ins are offered specifically for domain management in WordPressMu which can be confusing. There is the <a href="http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/">Domain Mapping</a> plugin and the <a href="http://wpmudev.org/project/Multi-Site-Manager">Multi-Site Manager</a> plugin. </p>

<p>The Domain Mapping plugin is more designed for wrapping subdomains and subdirectories.. For the purpose of having several independent websites, the Multi-Site Manager seemed more appropriate. The Multi-Site Manager still allows for multiple blogs per domain (in subdomains) as well. Explore both plugins in your development environment as your mileage with each may vary. For the purpose of this guide, the Multi-Site Manager will be examined. </p>

<p>With the Multi Domain Plugin, one blog is automatically created when a site is created. It&#8217;s a WordPressMu specific plugin and must be installed in the <code>mu-plugins</code> directory. Additional blogs for subdomains and subdirectories can be added later in addition to the base blog. Sites can be created by navigating to Site Admin&gt;Sites from within the administration console. It is important to note when you create new sites you should, at the very least, clone the <code>site_admins</code> and <code>admin_user_id attributes</code> from the base blog. Failure to do so will result in the Site Admin tab not appearing on the new site when logged in as admin. </p>

<p><img src="http://penguindreams.org/files/2008/12/wp-new-site.png" alt="Create a New Site Screen" title="Create a New Site" class="size-full wp-image-179" /></p>

<p>Forgot to close those essential site variables? That can easily be remedied by issuing the following <span class="caps">SQL </span>statement on the WordPressMu database with <em>x</em> being replaced by the appropriate <code>blog_id</code>.</p>



<pre class="sh_sourceCode sh_sql">
INSERT INTO wp_sitemeta VALUES(NULL,x,'site_admins','a:1:{i:0;s:5:&quot;admin&quot;;}');
</pre>

<p> </p>

<p>The value to the key <code>site_admins</code> is a serialized <span class="caps">PHP </span>object contain the array of site administrators for the given blog.</p>

<p><br /></p>

<h3>Setting up a Development Environment</h3>

<p>One of the more trickier tasks is creating a separate and independent development environment that&#8217;s setup similar or exactly like production. One would think you could just copy the install and the database to a local server, change the database settings, and the site would run locally. The trouble arises because one install is used by multiple domains and settings about each of those domains is stored directly in the database.</p>



<pre class="sh_sourceCode sh_sql" >
mysql&gt; SELECT option_id,blog_id,option_name,LEFT(option_value,100) as name
    -&gt;  ,autoload FROM wp_5_options HAVING name like '%penguindreams.org%' LIMIT 3;
+-----------+---------+----------------+--------------------------------+----------+
| option_id | blog_id | option_name    | name                           | autoload |
+-----------+---------+----------------+--------------------------------+----------+
|         1 |       0 | siteurl        | http://penguindreams.org/      | yes      |
|        40 |       0 | home           | http://penguindreams.org/      | yes      |
|        80 |       0 | fileupload_url | http://penguindreams.org/files | yes      |
+-----------+---------+----------------+--------------------------------+----------+
3 rows in set (0.01 sec)
</pre>



<p>In addition, other plugins may also store the site&#8217;s domain name for their own purposes. To run the site locally, it would be necessary to creates scripts that would be able to pull a production copy of the site&#8217;s database and also change all appropriate fields within each sites <code>wp_n_options</code> table. </p>

<p>One may be tempted to download a FireFox plugin that allows you to modify the <code>Host</code> header transmitted the web browser. This would work to display a single page, but many if not all of the links on the site would direct back to the full address of the production install.</p>

<p>One of the best solutions I have found is to simply modify the <code>hosts</code> file to direct traffic bound for the production install to another machine. This fine can be located in <code>/etc/hosts</code> on Linux/UNIX/Mac and in <code>C:\WINDOWS\system32\drivers\etc</code> on Windows. </p>



<pre class="sh_sh sh_sourceCode">
# /etc/hosts: Local Host Database
#
# This file describes a number of aliases-to-address mappings for the for
# local hosts that share this file.
#
# In the presence of the domain name service or NIS, this file may not be
# consulted at all; see /etc/host.conf for the resolution order.
#

# IPv4 and IPv6 localhost aliases
127.0.0.1       localhost mycomputer
::1             localhost
192.168.12.12   penguindreams.org
</pre>



<p>In the above example, all requests to penguindreams.org are now forwarded to a server on the local network. It may be necessary to close and reopen the web browser as it may have cached the previous <span class="caps">DNS </span>request. There are plugins available for FireFox to clear the <span class="caps">DNS </span>cache without restarting the browser. </p>

<p><br /></p>

<h3>Unsafe <span class="caps">HTML</span></h3>

<p>In a normal WordPress install there is an option to enable unsafe <span class="caps">HTML </span>including <code>&lt;iframe&gt;</code> and <code>&lt;embed&gt;</code> tags which are used by some video sites. Typically you don&#8217;t want anyone to use such unsafe <span class="caps">HTML </span>unless they really know what they&#8217;re doing, but the option was available to administrators in WordPress, an option that is entirely missing in WordPressMu. If a writer tries to add an <code>&lt;iframe&gt;</code>, it disappears immediately after saving the post. The solution? </p>

<p>The <a href="http://wordpress.org/extend/plugins/unfiltered-mu/">Unfiltered MU</a> plugin allows anyone with the rights of editor or above or use unsafe <span class="caps">HTML.</span> It can be placed in the <code>mu-plugins</code> directory to give every blog this capability. If you don&#8217;t trust all your end users, placing it in the regular <code>plugins</code> directory will work, even for this WordPressMu specific plugin, to enable it on a per-blog basis. </p>

<p><br /></p>

<h3>Closing Notes</h3>

<p>During the migration process, I was forced to deal with a lot of the <span class="caps">SQL </span>and became quite familiar with many of the table schemas. Although it isn&#8217;t an absolute requirement to be familiar with the underlying tables to administrator a WordPressMu installation, it certainly does help in understanding the underlying system, migrating content and diagnosing problems.</p>

<p>Two other major challenges not covered in this article were migration, both from a standard WordPress install and various other content management systems (outdated versions of Drupal and custom Rails applications) as well as converting existing layouts into WordPress themes. </p>

<p>This isn&#8217;t an exhaustive list of all the challenges I faced with installing and maintaining WordPressMu, but these were some of the most frustrating. Overall, I have been very impressed with WordPressMu engine and it&#8217;s a welcome change from the other content management systems I&#8217;ve either used or created. </p>

<p><br /><br /><br /></p>]]></content:encoded>
			<wfw:commentRss>http://penguindreams.org/blog/guide-for-new-wordpressmu-administrators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
