Re: Wordpress Multiple Blog Configuration
On 20/08/05, Chris Purves <firstname.lastname@example.org> wrote:
> I just installed Wordpress and got it running. In the README.Debian
> file there's a mention that the Debian configuration can support
> multiple blogs, but no instructions as how to accomplish that.
> From README.Debian:
> #### A little more about the (multiple blog) configuration
> The default wp-config.php searches for a (mysql) configuration filename based
> on the blog's host. This allows you to host more than one blog on a Debian
> The little more is all there is as far as I can tell. Any help would
> be appreciated. Perhaps I would be better off with the multiuser
> edition (not presently in Debian archive)?
Okay, I got it working. Here is what I did:
I renamed /etc/apache2/sites-enabled/000-default to 002-default,
commented out the NameVirtualHost line and changed the <VirtualHost *>
line to <VirtualHost *:80>. I also added a line "ServerName
www.mysite.com". First few lines:
Then I added a file /etc/apache2/sites-enabled/001-wordpress (taken
from /usr/share/doc/wordpress/examples/apache.conf), containing
Then I made sure the vhost_alias.load was included in mods-enabled.
This allowed the site to work as before at www.mysite.com (and
mysite.com), but anything of the form something.mysite.com would be
handled by the 001-wordpress file. For each blog I create a softlink
at /srv/www pointing to /usr/share/wordpress.
The /usr/share/doc/wordpress/examples/setup-mysql script was okay, but
it created a new database for every user. I decided that I wanted to
have only one database with different table name prefixes. What I
ended up doing was running the scipt once to create the initial
database, then deleting all the tables and and modifying the config
file created by the script.
/etc/wordpress/config-person1.mysite.com.php looks like this:
$table_prefix = 'wp_person1_';
$server = DB_HOST;
$loginsql = DB_USER;
$passsql = DB_PASSWORD;
$base = DB_NAME;
When I want to add a new user I need only create a new link in
/srv/www, for example /srv/www/person2.mysite.com to point to
/usr/share/wordpress, then copy config-person1.mysite.com.php to
config-person2.mysite.com.php and change $table_prefix from
wp_person1_ to wp_person2_.
Now I have a setup that allows me to create a new blog by simply
adding a softlink and copying a file and changing a single parameter.
I don't have to restart apache or run any scripts and I don't have to
worry about an endless number of databases being created.
Problems: having one database may be a bit of a security risk and
also if the database is corrupted, it will affect all users, not just
one. This is acceptable for me, as I plan to have frequent backups of
Also, allowing uploading is a bit of a problem. I can set up each
user to point to a different place on the server to store their files,
but if they know the location of someone elses files, they could
change their settings and gain access. I don't see this as a big
problem, but it's still something I would prefer to do without.
Take care, eh.