07 AprMultiple 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!

17 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. [...] are many guides for installing wordpress locally (official link). For Mac users, there is an official guide as well. You can [...]

  6. 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. Is there a limit to home many blogs can be moved and hosted after the changes are made?

  11. JT says:

    I went through a similar process and wrote up what I did… might be useful for others.

    http://blog.successbias.com/2010/09/18/multiple-wordpress-blogs-on-one-server/

  12. [...] התקנה מקומית תחת Debian Etch באמצעות .deb (קל מאוד) [...]

  13. [...] Install WordPress Locally on Debian Etch using .deb [...]

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

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