Hosting multiple wordpress instances
March 29, 2007 on 5:06 pm | In Needs more info |I set up three wordpress blogs (including this one) in the course of about twelve hours last weekend. It started out as an interest in setting up some sort of photoblog for my guinea pigs on their website (on whose webhosting this blog is vhosted on). A buddy suggested wordpress so I gave it a spin. One concern I had was to have a single software install if at all possible both to reduce disk usage (while not at all a significant cost factor on my hosting account, just on princple why waste disk space) and to eliminate having to cascade changes. So I set forth at trying to share a wordpress install on my hosting account.
After extracting the wordpress files, it came time to set up directories that would be viewable by the web server as called by web browsers. I put the wordpress archive in the same directory I wanted two photo blogs to be homed, for lack of anywhere better to put it. It wouldn’t matter since I could later set it to not be readable to the web server and would not be exposing an unconfigured blog install to the net. Next, the directory structure for the live blog trees:
mkdir blogs
cd blogs
gzcat ~/wordpress/wordpress-2.1.tar.gz | tar -xf -
chmod og-rw wordpress
mkdir blogdir
cd blogdir
(cd ../wordpress ; find . -type d) | xargs mkdir -p
for i in `(cd ../wordpress ; find . \! -type d)`
do
ln ../wordpress/$i $i
done
That gets me one functional wordpress blog directory whose contents are all unix file system hard links to my archive. Lather rinse and repeat for the second blog. I now had two vanilla blog installs each separately viewable from the web server without the need for any mod_rewrite or .htaccess trickery. The chmod command keeps the web server from exposing the original source extraction (which won’t have a config file) from prying web browsers.
Following the wordpress install instructions - namely copying the example confg file (which is a hardlink to the source extraction) to the wp-config.php production name in each blog’s directory creates separate config files that can be customized accordingly. A little clicking on the hosting provider’s click-and-drool mysql admin interface and I’ve got a mysql database instance named wordpress and some editing of the config files puts each blog on that database with a table prefix identifying which blog the data belongs to.
After initializing the two blogs and adding some different templates so I can visually tell them apart, the only big tricks to keep this uniform were adding the downloaded plugins and then creating matching hardlinks in the sibling blog - using the same set of find operations described above adjusted for the deeper path to wp-content/plugins/pluginname
No Comments yet »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Entries and comments feeds.
Valid XHTML and CSS. ^Top^
23 queries. 0.471 seconds.
Powered by WordPress with jd-nebula theme design by John Doe.