Tutorials

Autoblogging Videos Highlighing Global Settings Section of BlogSense

Part I : http://screencast.com/t/NmVkNzA5 – Intro – Global Settings
Part II : http://screencast.com/t/NGViNGNhMWI  – Global Settings
Part III : http://screencast.com/t/M2NhNzE2MT – Global Settings Concluded

 

Wordpress 3.0 MultiBlog Setup

Original Source: http://blog.mixu.net/2010/05/17/sett…erent-domains/

———————————

Setting up multisite Wordpress 3.0 with multiple different domains

Wordpress 3.0 is coming out very soon (apparently they missed their original deadline, see the schedule here) – and it has one killer feature for anyone who maintains multiple Wordpress sites: official support for multiple subdomains and (unofficial) support for multiple different domains. This means that one only has to maintain and upgrade one Wordpress installation.

Here is my guide to setting up Wordpress 3.0 with multiple different domains and subdomains – based on the experience I got from moving my own blogs to WP 3.0 beta 2 (still waiting for the final release before moving clients as well).

Installing Wordpress 3.0

The basic installation process is the same as that of WP 2.9. Download, unzip, set up the database and the set up wp-config.php. If you aren’t going to use the multi-site support, then not much will change. Brief instructions below.


Multi-site mode with Apache

You will need to separately enable the multi-site mode, as well as take care of your Apache settings. WP 3.0 will handle all the requests it gets from a single directory, which means that all your subdomains must use that directory as their DocumentRoot/VirtualDocumentRoot.

Furthermore, WP 3.0 will assume that if you are using multi-site mode with subdomains, you want the subdomains under the first site’s URL – ex. if your first WP 3.0 install is under www.domain.com, then WP 3.0 will set up subdomains in the format subdomain1.www.domain.com.

That means that if you want to use first-level subdomains (ex. blog.domain.com, subdomain2.domain.com etc.), you have to set up WP 3.0 so that your first blog is using the bare domain (ex. domain.com) and not on the www.domain.com subdomain.


0. (Optional) Bare domain setup for Apache

The way in which you setup your bare domain (and forward from the www -subdomain to the bare domain) depends a lot on how you have set up your domain originally in Apache.
I have been using virtual hosts to host multiple sites, with each subdomain having its own directory. This means that I had to add an additional Vhost directive before my original Vhost directive in httpd.conf. Here is how I did it:

<VirtualHost *:80>
ServerName domain.com
ServerAlias domain.com blog.domain.com subdomain1.domain.com
DocumentRoot /var/www/domain.com/www
</VirtualHost>

As you can see in the first Vhosts directive, I have used the ServerAlias directive to specify domain.com, blog.domain.com and subdomain1.domain.com to be served from the DocumentRoot /var/www/domain.com/www (which is where I have installed WP 3.0).

In addition, I still have the rest of my subdomains served from a VirtualDocumentRoot, and have a forward from the www.domain.com

<VirtualHost *:80>
ServerName domain.com
ServerAlias *.domain.com
VirtualDocumentRoot /var/www/domain.com/%1
# rewrite www to bare domain
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule (.*) http://domain.com$1 [R=301,L]
</VirtualHost>

Apache will use the first matching VirtualHost directive (see “An in-depth discussion of Virtual Host Matching” for more details).
If you want to test your setup – remember to restart Apache – you can use an online redirect checker such as: http://www.internetofficer.com/seo-tool/redirect-check/

1. Get the files and unzip them

2. Edit wp_config_sample.php

You can use https://api.wordpress.org/secret-key/1.1/salt/ to generate the secret keys

-subdomain to the domain.com bare domain.


3. Enable multisite

Add:
define(’WP_ALLOW_MULTISITE’, true);

to wp-config.php after the secret keys


4. Log in, go to Tools/Network

Select either the blogs-as-subdomains or blogs-as-directories option and install.


5. Make the changes detailed on the post-install page

WP 3.0 gives you a number of changes you will need to make manually to .htaccess and wp-config.php.

Adding a new subdomain

You have now set up the multisite functionality. Next, add a subdomain (see below for how to add a different domain).

1. Login in on your main site

2. Go to Super Admin (new menu at the top)

3. Use the add site form to add a new subdomain

4. Configure your DNS and add a Vhost for the subdomain

Make sure there is a DNS entry for your subdomain – if you don’t have a wildcard redirect for your domain to your server. If you did the Apache configuration, all you need to do now is to set up your DNS so that the subdomains you want are mapped to your server.

Quick tip for Windows: edit C:\Windows\System32\drivers\etc\hosts and add a temporary hosts entry for your new subdomain, such as:
123.14.15.16 subdomain.domain.com

This will allow you to test the subdomain without having to wait for DNS to propagate. Under Win7, you need to start Notepad as an Administrator (right-click) to edit the file.

5. All done!

Try navigating to your new subdomain. It should be set up now!

Adding a new (different) domain

1. Use the add site form to add a new subdomain

You will use the default tools to create all the tables, then you will make a small number of changes to make Wordpress accept a different domain. All credit for this method goes InterconnectIt – see their writeup here.

2. Configure your DNS and add a Vhost for the subdomain

The easiest way is to add another ServerAlias domain to the original domain’s VirtualHost -> ServerAlias directive.
If you try to access the site now, you will get a “Registration” page. This means the Vhost is working.


3. Edit the wp_site table to include your new domain

This table stores all the domains that can be used in WP 3.0.
Leave “id” empty (it is an autoincrement field), set “domain” to the domain name, “path” should be /.
Make a note of the id your newly inserted row gets after saving, since you will need it in the next step.


4. Edit the wp_blogs table to use the new domain

Find the row for the subdomain you added earlier. Change “site_id” to the id given to the new row in the wp_site table. Change “domain” to the domain name you want to use.


5. Edit wp_[blog_id]_options to use the new domain name

The WP 3.0 multisite database schema is sharded by having the blog id in the table names. By default these are in the form wp_[blog_id]_*, so you will need to find which set of tables contains your new blog.

Each Wordpress blog stores a small number of settings which need be changed to use the new domain name. You can use the query below to find the mentions of the domain in the options table:

SELECT * FROM `wp_[blog_id]_options` WHERE `option_value` LIKE “%subdomain.domain.com%”;
For me these are: siteurl, home, fileupload_url. Change them to use the new domain.


6. Done!

Tutorial on Floating Elements (CSS)

When using BlogSense, you might come across posts where the images hang off the side, or outside of the wordpress post container. This tutorial should help you make sure this does not happen with your custom template.

Containing Float Elements

Developers who are new to css, or those who work primarily in IE, run into a vicious “bug” in Firefox and other modern browsers. Their backgrounds disappear, or their borders do—but everything’s fine in IE. The gnashing of teeth is heard throughout the land…

Keep Reading Here