Multiple WordPress blogs on a Debian server

This HOWTO assumes:

1. You have a server running at least Debian Etch (or are otherwise able to install the wordpress .deb).

2. Your server has Apache 2, MySQL, and PHP installed.

3. You want to use a single WordPress installation to host multiple blogs across several domains.

Ok, let’s get started.

Step 1: # sudo apt-get install wordpress

Handle a few pesky permissions problems with:

# sudo chown :www-data /etc/wordpress/*
# sudo mkdir /usr/share/wordpress/wp-content/uploads
# sudo chown www-data:www-data /usr/share/wordpress/wp-content/uploads
# sudo chown -R www-data:www-data /usr/share/wordpress/wp-content/themes

Step 2: Set up Apache 2 so that exampledomain.org points to /usr/share/wordpress —Here’s one way, and it also assumes you want www.exampledomain.org to redirect to exampledomain.org. You could modify this to have it redirect to blog.exampledomain.org if you want it to go there instead.


/etc/apache2/sites-available/exampledomain.org

<VirtualHost *:80>
ServerName www.exampledomain.org
DocumentRoot /var/www/www.exampledomain.org/
<Directory /var/www/www.exampledomain.org/>
AllowOverride All
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName exampledomain.org
DocumentRoot /var/www/exampledomain.org/
<Directory /var/www/exampledomain.org/>
AllowOverride All
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>

# sudo a2ensite exampledomain.org
# sudo /etc/init.d/apache2 reload

# sudo ln -s /usr/share/wordpress /var/www/exampledomain.org

/var/www/www.exampledomain.org/.htaccess
Redirect / http://exampledomain.org

[Go online and confirm the redirect is working—don't worry that you get a WordPress error. It's not supposed to work yet.]

# cd /usr/share/doc/wordpress/examples
# sudo sh setup-mysql -n exampleuser exampledomain.com

Note that the username "exampleuser" must be no more than 16 characters (mysql limitation).

Step 3: Do the normal web-based WordPress install (I suggest going to Options|Miscellaneous and giving each blog a unique subdirectory for its uploads otherwise they’ll all be mixed together) and then repeat step 2 for each additional domain.

You’re done! A single Debian WordPress installation is now hosting multiple blogs!

Creative Commons License
This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

12 Responses to “Multiple WordPress blogs on a Debian server”

  1. mbd Says:

    Thanks for this entry – was very helpful in getting multiple blogs setup on my site!

  2. epb Says:

    I do not understand step 2. My server has a domain name, an internal IP given by my router and an outbound IP given by my ISP. Wich one do I use and where am I supposed to put /usr/share/wordpress/ to have it redirected?

  3. BFD Says:

    hmm. What did I do wrong I followed the docs exactly and got this error:

    benkong2@peter:~$ sudo a2ensite bfdavis.org
    Site bfdavis.org installed; run /etc/init.d/apache2 reload to enable.
    benkong2@peter:~$ sudo /etc/init.d/apache2 reload
    Reloading web server config: apache2Warning: DocumentRoot [/var/www/www.bfdavis.org/] does not exist
    Warning: DocumentRoot [/var/www/bfdavis.org/] does not exist
    [Wed Feb 20 15:24:39 2008] [error] VirtualHost *:80 — mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
    [Wed Feb 20 15:24:39 2008] [error] VirtualHost *:80 — mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
    .

  4. dave Says:

    # sudo /etc/init.d/apache2 reload

    why it not run?

  5. Moving From Blogger To Wordpress - Maintaining Permalinks, Traffic & SEO Says:

    [...] are many guides for installing wordpress locally (official link). For Mac users, there is an official guide as well. You can [...]

  6. konya web tasarım Says:

    I do not understand step 2. My server has a domain name, an internal IP given by my router and an outbound IP given by my ISP. Wich one do I use and where am I supposed to put /usr/share/wordpress/ to have it redirected?

  7. Steffan Says:

    Let me know if you find something that works. I need something like this for another project.

  8. Alex Says:

    I have read it 4 times, still cant make it working well :( “NameVirtualHost address is not supported”, ideas?

  9. Lida Says:

    Thanks for this entry

  10. Installing WordPress | QHNET – WEBHOSTING SOLUTIONS – LINUX HOSTING – PHP HOSTING – MYSQL HOSTING – NUKEVIET HOSTING – JOOMLA HOSTING – MAGENTO HOSTING – VBULLETIN HOSTING – INVISIONBOARD HOSTING ̵ Says:

    [...] Install WordPress Locally on Debian Etch using .deb (easiest) [...]

  11. Movers Clendaniel Says:

    Is there a limit to home many blogs can be moved and hosted after the changes are made?

  12. Five Steps for Wordpress Preparation | RepeatGeek Says:

    [...] Debian Etch Linux [...]

Leave a Reply