When you have a weblog and play with it a little you will quickly gather more of them. For production, development, maybe testing and possibly various domains. Then upgrading Wordpress to a new version becomes a lot of work. It would be a lot easier if you would only need one Wordpress installation with their own database and upload folder. This is Wordpress multi user, or multi site or domain if you prefer. It is not hard to achieve. Just follow this tutorial.
Choose multi site or domain
While they may seem the same, there is an essential difference between these. Multi site would be set up as: www1.domain.com and www2.domain.com where multi domain would be setup as www.domain1.com and www.domain2.com. You could even have these types mixed but that would make it a little more complicated. For now we assume you would like to host www.domain1.com and www.domain2.com.
Install the Wordpress files
Just install Wordpress like you would for one website. The point all domains / sites to the folder where you installed it.
Create a config file, here comes the magic
In the config file you determine which domain is requested and select the database (and if needed database user, server and password) based on that. For the site version use $parts[0] instead of $parts[1].
$host = $_SERVER['HTTP_HOST'];
$parts = explode('.',$host);
if ($parts[3] = "") {
$domain = $parts[0];
} else {
$domain = $parts[1];
}
switch ($domain) {
case "domain1":
$db = "database1";
break;
case "domain2":
$db = "database2";
break;
}
define('DB_NAME', $db);
define('DB_USER', 'user');
define('DB_PASSWORD', 'password');
define('DB_HOST', 'hostname');
Create the databases
Wordpress needs you to create the empty database before you set it up. If you point to a domain of which the database is not created yet, you will be informed Wordpress can select the database. When the database is there, you get the setup screen.
Finalize
The make sure things don’t get mixed up you should change some of the default settings in the admin panel. At Options > Miscellaneous set the upload folder to wp-content/uploads/domain/ and don’t forget to create the corresponding folder.