<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.10" -->
<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/"
	>

<channel>
	<title>Skywatching</title>
	<link>http://blog.aeolis.org</link>
	<description>The Constellation Blog</description>
	<pubDate>Sat, 30 Jun 2007 03:19:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.10</generator>
	<language>en</language>
			<item>
		<title>Multiple Blogs on Debian Etch</title>
		<link>http://blog.aeolis.org/2007/06/29/multiple-blogs-on-debian-etch/</link>
		<comments>http://blog.aeolis.org/2007/06/29/multiple-blogs-on-debian-etch/#comments</comments>
		<pubDate>Sat, 30 Jun 2007 02:39:08 +0000</pubDate>
		<dc:creator>Wayfarer</dc:creator>
		
		<category>WordPress</category>

		<category>Code</category>

		<guid isPermaLink="false">http://blog.aeolis.org/2007/06/29/multiple-blogs-on-debian-etch/</guid>
		<description><![CDATA[I've been having problems with theming multiple blogs on WordPress using the default Debian Etch settings.  Here's how I fixed it.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been having problems with theming multiple blogs on WordPress using the default Debian Etch settings.  Those problems are gone, as of today.  Here&#8217;s how I fixed the blog.<br />
<a id="more-3"></a><br />
The setup I wanted was as follows:</p>
<ul>
<li>blog.aeolis.org goes to the main system blog.</li>
<li><em>name</em>.blogs.aeolis.org goes to an individual&#8217;s blog.</li>
<li>blogs.aeolis.org by itself gets punted to the main system blog.</li>
</ul>
<p>One note about the way things are installed on my server:  I put all the blog sites in the /srv/www hierarchy, with each unique hostname getting a separate directory.  For example, &#8216;blog.aeolis.org&#8217; would be located in &#8216;/srv/www/blog.aeolis.org&#8217;.</p>
<p>The first thing I did was to create a new site definition for WordPress:</p>
<p><a class="quickcode" title="Code" href="javascript:toggleLayer('quickcode31');">/etc/apache2/sites-available/wordpress</a></p>
<div id="quickcode31" class="quickcode"><code><br />
# WordPress blog setup.<br />
#<br />
# Wayfarer &lt;wayfarer@aeolis.org&gt;<br />
#<br />
# Blog software should be in /srv/www/blog.aeolis.org (or linked from there).<br />
# Address of blogs.aeolis.org gets redirected to blog.aeolis.org.<br />
# URLs of form:&nbsp;&nbsp;&lt;user&gt;.blogs.aeolis.org get separate blogs.<br />
&nbsp;<br />
&lt;IfModule mod_vhost_alias.c&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;VirtualHost *:80&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UseCanonicalName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Off<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ServerName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blog.aeolis.org<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ServerAlias&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; blogs.aeolis.org *.blogs.aeolis.org<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VirtualDocumentRoot&nbsp;&nbsp;&nbsp;&nbsp; /srv/www/%0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Options&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; All<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ErrorLog /var/log/apache2/error-blog.aeolis.org.log<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LogFormat &quot;%V %h %l %u %t \&quot;%r\&quot; %s %b&quot; vcommon<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CustomLog /var/log/apache2/access-blog.aeolis.org.log vcommon<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/VirtualHost&gt;<br />
&lt;/IfModule&gt;<br />
</code></div>
<p>I made a point of making this the last set of hostnames considered for the virtual hosting system by creating a symlink in /etc/apache2/sites-enabled that was at the very end of the alphabet.</p>
<p><code><br />
ln -s ../sites-available/wordpress /etc/apache2/sites-enabled/zzz-wordpress<br />
</code></p>
<p>Then I force-reloaded Apache.</p>
<p><code><br />
/etc/init.d/apache2 force-reload<br />
</code></p>
<p>After that, I ran the setup script, as recommended by the README.Debian file.</p>
<p><code><br />
sh /usr/share/doc/wordpress/examples/setup-mysql -u wp-aeolis blog.aeolis.org<br />
</code></p>
<p>Here&#8217;s where I ran into trouble.  Because the setup script simply symlinks the blog&#8217;s directory under /srv/www to /usr/share/wordpress, a user can&#8217;t generally write to important places like the .htaccess file (for pretty permalinks) or the wp-content directory (for themes and plugins and such).  Furthermore, even if I symlinked the contents of /usr/share/wordpress into the user&#8217;s directory, the wp-config.php script would still be pointing at /usr/share/wordpress for those resources.  Therefore, I needed to change some things around.</p>
<p>I started by hacking the global wp-config.php to point directly to the requested blog&#8217;s path under /srv/www.</p>
<p><a class="quickcode" title="Code" href="javascript:toggleLayer('quickcode32');">/etc/wordpress/wp-config.php</a></p>
<div id="quickcode32" class="quickcode"><code><br />
&lt;?php<br />
/** WordPress&#039;s Debianised default master config file<br />
Please do NOT edit and read about how the configuration works in the README.Debian<br />
**/<br />
&nbsp;<br />
require_once(&#039;/etc/wordpress/config-&#039;.strtolower($_SERVER[&#039;HTTP_HOST&#039;]).&#039;.php&#039;);<br />
&nbsp;<br />
define(&#039;ABSPATH&#039;, &#039;/srv/www/&#039; . strtolower($_SERVER[&#039;HTTP_HOST&#039;]) . &#039;/&#039;);<br />
&nbsp;<br />
require_once(ABSPATH.&#039;wp-settings.php&#039;);<br />
?&gt;<br />
</code></div>
<p>See what I did?  I changed the ABSPATH to reflect the particular host whose blog is being requested.  I figure that since the WordPress installation is already aware of individual host configuration files (/etc/wordpress/config-<em>hostname</em>.php), it won&#8217;t be too dangerous to make it aware of individual WordPress directories.  I probably should make it default to /usr/share/wordpress/ if the directory doesn&#8217;t exist, but that&#8217;s for round 2.</p>
<p>With that out of the way, I was free to play with some symlinks.  I removed /srv/www/blog.aeolis.org (a link to /usr/share/wordpress), and created an actual directory there.  I then changed into that directory and ran the following script.</p>
<p><a class="quickcode" title="Code" href="javascript:toggleLayer('quickcode33');">The Script of Doom</a></p>
<div id="quickcode33" class="quickcode"><code><br />
#!/bin/bash<br />
#<br />
# WordPress directory prep.<br />
#<br />
# Wayfarer &lt;wayfarer@aeolis.org&gt;<br />
#<br />
# Meant to be run in the directory you want WordPress installed to.<br />
&nbsp;<br />
WP_DIR=/usr/share/wordpress<br />
INST_DIR=.<br />
&nbsp;<br />
ln -vs ${WP_DIR}/* ${INST_DIR}<br />
&nbsp;<br />
# Create user-customizable wp-content directory.<br />
rm -f ${INST_DIR}/wp-content<br />
for d in themes plugins; do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mkdir -p ${INST_DIR}/wp-content/${d}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ln -vs ${WP_DIR}/wp-content/${d}/* ${INST_DIR}/wp-content/${d}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chown www-data:www-data ${INST_DIR}/wp-content/${d}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chmod 0775 ${INST_DIR}/wp-content/${d}<br />
done<br />
ln -vs ${WP_DIR}/wp-content/index.php ${INST_DIR}/wp-content/index.php<br />
chown www-data:www-data ${INST_DIR}/wp-content<br />
chmod 0775 ${INST_DIR}/wp-content<br />
&nbsp;<br />
# Create uploads directory.<br />
mkdir -p ${INST_DIR}/wp-content/uploads<br />
chown www-data:www-data ${INST_DIR}/wp-content/uploads<br />
chmod 0775 ${INST_DIR}/wp-content/uploads<br />
&nbsp;<br />
# Create user-customizable .htaccess file.<br />
rm -f ${INST_DIR}/.htaccess<br />
cp ${WP_DIR}/.htaccess ${INST_DIR}/.htaccess<br />
chown www-data:www-data ${INST_DIR}/.htaccess<br />
chmod 0664 ${INST_DIR}/.htaccess<br />
</code></div>
<p>Still very alpha in nature, but you get the gist.  The script symlinks each item in /usr/share/wordpress to the current directory.  The wp-content subdirectory gets special treatment, as the themes and plugins subdirectories absolutely must be user- (and probably group-) writable.  And, of course, I fixed up .htaccess so that the admin script can edit it for permalinking.</p>
<p>The result?  The admin interface is able to edit files, my plugins work, and I stop losing hair wondering why .htaccess can&#8217;t be edited even if it&#8217;s world-writable.
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aeolis.org/2007/06/29/multiple-blogs-on-debian-etch/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hello World!</title>
		<link>http://blog.aeolis.org/2007/06/26/hello-world/</link>
		<comments>http://blog.aeolis.org/2007/06/26/hello-world/#comments</comments>
		<pubDate>Tue, 26 Jun 2007 10:13:47 +0000</pubDate>
		<dc:creator>Wayfarer</dc:creator>
		
		<category>Site News</category>

		<category>Announcements</category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[After a five-year hiatus, the Constellation is back online!
Currently, we&#8217;re working on customizing WordPress.  Watch this space, and watch the skies!

]]></description>
			<content:encoded><![CDATA[<p>After a five-year hiatus, the Constellation is back online!</p>
<p>Currently, we&#8217;re working on customizing WordPress.  Watch this space, and watch the skies!
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aeolis.org/2007/06/26/hello-world/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
