Installing WordPress MU
From InstallationWiki
| Official Page |
| Project Documentation |
| Download |
|
[edit] Tools you will need
If you have already set up your own WordPress blog, right from the beginning you will probably have the tools you need to get started with WordPress MU. All you need is a plain text editor and an FTP client. As your experience grows, you may find that you want to add to your arsenal some other tools such as browser plugins that will help you tweak and debug your site from within your browser.
[edit] Text editors
For Windows users, I recommend one of the following text editors:
* Notepad++ ([http://notepad-plus.sourceforge.net http://notepad-plus.sourceforge.net]) * Crimson Editor ([http://www.crimsoneditor.com/ http://www.crimsoneditor.com/])
Both of these are free applications. (Notepad++ is open source.)
For Mac users I recommend Aptana (http://aptana.com/). Linux users can try JEdit (http://www.jedit.org) or see if their favorite text editor has syntax highlighting capabilities.
[edit] FTP clients and other tools
For an FTP client, I recommend FileZilla (http://filezilla-project.org/). This FTP client is free and has versions available for Windows, Mac, and Linux. Another option for Windows users is Core FTP LE (http://www.coreftp.com/).
If you use the Firefox web browser (http://www.getfirefox.com), you may find the following browser plugins useful:
- Firebug: For editing and debugging HTML and CSS in your browser, available at
[https://addons.mozilla.org/en-US/firefox/addon/1843 https://addons.mozilla.org/en-US/firefox/addon/1843]
- YSlow: For determining why a page is taking long to load, available at
[https://addons.mozilla.org/en-US/firefox/addon/5369 https://addons.mozilla.org/en-US/firefox/addon/5369]
- ColorZilla: A useful color picker for your browser, available at
https://addons.mozilla.org/en-US/firefox/addon/271
[edit] Setting up a local web server
Let's start by setting up a local web server. We will use this to make a local installation of WordPress MU, which will serve as a private testing ground.
It is a good idea to have a local copy of your site. It lets you test things quickly and easily and ensures that should any of your edits go wrong, nobody else will see. Editing your site while it is live can annoy your visitors, especially if the edits don't work as expected on the first attempt. Testing on a private server minimizes the risk of any unnecessary downtime. If you don't want to run a test server, skip to the Time for action working with cPanel section.
[edit] Getting your server set up
There are lots of free web server packages available. I recommend WAMP (http://www.wampserver.com/en/) for Windows and MAMP (http://www.mamp.info/) for Mac users. Both of these packages provide Apache, MySQL, and PHP the AMP part of the acronyms WAMP and MAMP. The W stands for Windows and M for Mac. If you're on Linux, then there should be a LAMP package available for your distribution. One option is XAMPP (the final P stands for Perl), which you should be able to install through your distribution's package manager. XAMPP is also available for other platforms. This tutorial assumes you are using Windows, so the following instructions are for the WAMP package:
1. Download the appropriate server package for your operating system.
2. Run the installer. In most cases accepting the default settings is fine.
3. Set your default browser. The installer defaults to Internet Explorer.
4. Click the WAMPServer icon in the system tray and navigate to Apache | Apache Modules. Scroll through the list until you see rewrite module and click it to enable it.
5. Select WAMPServer in the system tray and go to Apache | Service | Test Port 80.
6. A window will appear telling you if anything else is using Port 80. The two most common issues I have seen are existing IIS servers and Skype. Close any applications that the server warns you about.
7. Activate the server using the WAMPServer icon in the system tray by clicking Start All Services and then Put Online.
8. Launch your browser and go to [http://localhost/ http://localhost/]. You should see something like the following:
What just happened?
Congratulations! You now have a web server running on your local machine. The server name stands for Windows (or Linux / Mac), Apache (the web server), MySQL (the database server), and PHP (the scripting language that WordPress MU uses). The rewrite module is also known as mod_rewrite. We had to enable this because WordPress MU uses it to create easy-to-read URLs for your users' blogs.
Now, let's get our local web server ready for action.
[edit] Databases with MySQL
WordPress MU needs a database to store blog posts, user information, and so on. We will be using MySQL to provide this database. The default installation of WAMPServer does not set a password for the root MySQL user. This is convenient, but could be dangerous, depending on how your computer is set up. If you are running some firewall software or using a router, you can leave the root password unset. However, if you will be allowing people outside your network to connect to your local server, then you should set the root password. You can find out how to do this by reading the phpMyAdmin documentation at
[http://www.phpmyadmin.net/home_page/docs.php http://www.phpmyadmin.net/home_page/docs.php].
[edit] Preparing for WordPress MU creating a database
Now that our MySQL server is a little more secure, let's get back to WordPress MU. When you install WordPress MU, it will ask you for connection details for a database. We will need to create this database and set up a user for it.
[edit] Creating a database for WordPress MU
1. Open phpMyAdmin in your browser.
2. Enter a simple but clear name for the database I've chosen slayerblogs. Now click Create.
|
Naming your database Some shared web hosts prepend your username to all database names. For example, if your username is "lhar1" and you chose "slayerblogs" as the database name, it would come out as "lhar1_slayerblogs". If you want to have identical setups on both the live and local servers, double-check the naming conventions of your web host before creating your local database. |
3. Now you'll need to create a user, which WordPress MU will use to access the database. To do this, click on the Home icon located on the lefthand side of the page.
4. Select the Privileges tab and click add new user.
5. Enter the username and password into the relevant field.
6. Select Localhost for the host field. Leave the other fields as default.
7. Don't set any privileges yet. Just scroll down and click Go.
8. Scroll down to Database Specific Privileges and select your database. Then click Go.
9. In the Global Privileges section, click Check All, and then click Go. You should see a confirmation screen like the following:
What just happened?
We have set up a database for WordPress MU to store the content, along with a user that WordPress MU can use to connect to this database. Remember these details, as we will need them when we start the installation of the site.
[edit] subdomains for WordPress MU
WordPress MU doesn't like running under http://localhost/. Instead of using a simple hostname, it needs a two-part Fully Qualified Domain Name. We will need to edit our Windows Hosts file so that we can use http://localhost.localdomain/ as a valid address for our local server.
1. Using your favorite text editor, open your hosts file. On most of the versions of Windows you will find this file at C:\windows\system32\drivers\etc. The hosts file is simply called hosts with no extension, so you may not be able to see it in the File | Open dialog of your text editor. Instead, navigate to the correct folder, right-click on the file, and select Open.
2. Leave any existing text alone. Add the following lines to the bottom of the file:
127.0.0.1 localhost.localdomain 127.0.0.1 slayercafe.localhost.localdomain
3. Save the file and browse to http://localhost.localdomain in your web browser. You should see your WAMPServer welcome page. Your antivirus software may warn you that your hosts file has been edited. You can safely ignore this message.
What just happened?
The hosts file is used by Windows to determine the location of network addresses. We have set it up so that our computer knows that the addresses localhost.localdomain and slayer.localhost.localdomain belong to our computer.
The localhost.localdomain address is used as the home page for WordPress MU on our local machine. The slayer address will be used by our test user. WordPress MU relies on the Apache module called mod_rewrite to interpret requests for specific URLs and to rewrite the request into something WordPress MU understands. For example, on our live server, a request to buffy.slayercafe.com will be interpreted as a request for the blog owned by the user "buffy". If there is no such user, WordPress will display a page saying that the blog does not exist and invite the visitor to sign up and create a blog.
Getting more from Apache
If your WordPress MU site is going to be a group endeavor, why not look into using a service such as http://www.dyndns.com/ to make it easy for your friends and colleagues to access it from the outside.
If you want to tinker more with the server, try setting up some custom error pages. WordPress MU handles some errors for you (for example, Error 404), but many others are handled by Apache. Open the httpd.conf file and search for ErrorDocument to see some examples. Don't change anything except the ErrorDocument lines.
[edit] Preparing your live server
Your test server is ready for WordPress MU now, but we still need to get the live server working. For the purposes of this tutorial, I will assume that your web host uses cPanel. If they use Plesk or some other form of control panel, check your host's support pages for assistance.
[edit] Working with cPanel
Just follow the steps mentioned next to configure your live server:
1. Log in to your site's cPanel. The address for this will most likely be included in the email your host sent you when you created an account.
2. Click on the MySQL Databases icon this is usually the picture of a dolphin.
3. Enter the name of the database you want to use for WordPress MU and click create database.
4. Create a new user and enter a secure password. Make a note of the password you enter, as you will need it later.
5. Scroll down to the Add Users To Your Database section and select your new user and database. Leave the All box checked and click Add User to Database.
What just happened?
Good news! That was the last preparatory step before we can get on with installing WordPress MU. cPanel makes it easy to set up users and databases. WordPress MU will need the login details that we just created so that it can connect to our MySQL server and store setup information, along with the information relating to blogs that users will create on our blog network.
[edit] User blogs with subdomains
We've already decided that we'd like to give our users attractive blog addresses. To accomplish this, we need to enable wildcard subdomains. These make sure that every time a new user creates a blog, their myblog.slayercafe.com address will work right away.
[edit] Subdomains under WHM
1. Log in to your WHM control panel. This is a feature of most good cPanel hosts and is usually found on port 2087; so, in our case that would be http://slayercafe.com:2087. (Your host may use a different port, in which case you may need to consult your host's support pages.)
2. Click on DNS Functions. Then click on Edit DNS Zone when the next screen appears.
3. Select the domain name of your WordPress MU site and select Edit. Scroll down to the section that says Add New Entries Below this Line and create a new A record with the value * . The 'IP or Hostname' box should contain the IP address of the site:
4. Click Save and then reopen the Edit Zone page to make sure the change was saved correctly. If the records are still there, great! It will take a while for the change to actually affect the site, but you can be confident it has worked.
|
Finding your site's IP If you aren't sure what the IP address of your site is, you can find it either by looking at the other records listed in the zone (the A record for the site's domain name itself will contain the IP of the site) or by opening a command prompt and typing |
What just happened?
We've just set up a hostname record, which tells the DNS server that any request to anything.slayercafe.com should go to the slayercafe.com server. This will be useful later because WordPress MU will use this functionality to offer users myname.slayercafe.com blogs.
If you're not using cPanel hosting, you may need to email your host to ask them to set up the wildcard subdomains for you.
[edit] One last thing wildcards and Apache
The wildcard subdomains feature is a nice one, but it's not much of a use if our web server doesn't know what to do with it. So, we've got one more thing to do. We can then get on with installing WordPress MU, I promise!
1. You'll need to edit your httpd.conf file. If you can't access this file (many shared hosting accounts don't allow you to edit it), then you'll need to open a support ticket with your host.
2. If you wish your httpd.conf file to look something like the following,
replace 123.123.123.123 with the IP address of your site, and replace CPANEL_USERNAME and YOURDOMAIN.com with your username
and domain name respectively.
<VirtualHost 123.123.123.123> DocumentRoot /home/CPANEL_USERNAME/public_html BytesLog domlogs/YOURDOMAIN.com-bytes_log User CPANEL_USERNAME Group CPANEL_USERNAME ServerAlias YOURDOMAIN.com *.YOURDOMAIN.com ServerName www.YOURDOMAIN.com CustomLog domlogs/YOURDOMAIN.com combined </VirtualHost>
3. If you already have subdomains set up on your site, you will need to add this new VirtualHost entry after those subdomains.
What just happened?
We've just set up a new virtual host in Apache. Virtual hosts are used so that you can run more than one site on a single web server. They can be used to host multiple domains, or in this case, subdomains. The VirtualHosts file tells Apache to accept connections from people looking for anysite.slayercafe.com and directs them to the folder where the main slayercafe.com site is stored. Apache reads the http_host header and passes that information to WordPress MU, which then serves up the correct site.
|
Not using cPanel? If you're not using cPanel and are having difficulty with any of the steps listed so far, I'd recommend you look at the documentation provided by your web host. If you choose one of the hosts mentioned in Tutorial 1, then WordPress MU should run well and features such as wildcard subdomains should be supported. However, in some cases you may need to raise a support ticket to get certain features turned on.</blockquote> |
[edit] Installing WordPress MU
Good news! We're ready to set up WordPress MU. Fortunately, the WordPress MU setup process is nice and easy. We've done the hardest part getting the server ready.
[edit] getting WordPress MU up and running
The installation process for WordPress MU has been designed to be user-friendly. Therefore, as long as you have the database connection information we created earlier in this tutorial, the installation should go quite smoothly.
1. Download the latest version of WordPress MU from http://mu.wordpress.org/download/.
2. Open the archive file and extract the contents of the wordpress-mu folder to the www folder in your WAMP directory.
3. Use your favorite FTP client to upload the contents of the www folder to the document root folder on your live server. On most servers the root folder will be called either www or public_html.
4. Browse to the live version of your site in our case slayercafe.com. You should see a page like the following:
If there are any warnings about file permissions, you can fix these using your FTP client. Right-click on the folders mentioned in the Quick fix section and select File Attributes. In the screen that appears, enter 777 in the Numeric value box. If you don't see any warnings, skip to step six.
5. Refresh the page once you're done setting attributes.
6. Enter your database connection details in the relevant boxes. In most cases, the database host will be localhost. If it is different on your web server, you will most likely have been told the name of the server when you created your database.
7. The server address on your live server will be your domain name slayercafe.com in our case. On your local server it will be localhost.localdomain.
8. Make a note of the password that appears on the next page.
9. If you had to set permissions for any folders in step four, use the same process to change those permissions to 755.
10. Click Log In and you will be presented with the WordPress MU admin page.
11. Repeat step four with the other version of your site.
So, if you've just worked through the "live" version, finish the install on the local server too.
What just happened?
You've just taken the first steps towards running your blog network empire! At the moment, there's just the main site and the admin panel, but it's a solid foundation for us to build on. However, there are a few more things we need to do. First, change the admin password to something more memorable.
[edit] Changing the admin password
The default admin password is a random set of letters and numbers, which is secure, but not very memorable. Rather than writing it down and leaving it lying around where anyone could see it, we should change it to something equally secure, but more meaningful so that we can remember it.
Follow the steps mentioned next to change the admin password.
1. Go to the Admin link at the top of the screen. Scroll to the bottom of the page and enter your new password.
2. Pay attention to the strength indicator. It can be very useful in helping you pick a good password.
3. When you've found a good password, click Update Profile at the bottom of the page.
[edit] Letting people register
You will most likely want to create some test accounts to explore the various features of WordPress MU, and get an idea of the differences between an admin account and a normal user account. Therefore, the next thing we should do is enable registrations. Once we're finished testing the site, we can turn off the registration option again until we are ready to accept new users.
[edit] Enabling registrations
Follow the steps mentioned next to enable registrations:
1. Expand the Site Admin side panel and click on options.
2. Under Allow new registrations, select the radio button that says Enabled Blogs and user accounts can be created.
3. Scroll down and click Update Options.
What just happened?
By now you should be getting a feel for the WordPress MU admin panel. It's a lot like the traditional WordPress admin panel, just with a few more options. We've temporarily turned on registrations for both new users and new blogs. We will be changing this option later, but for now this will allow us to test the registration process to make sure everything is working smoothly.
[edit] Testing your site
Let's make sure that everything is working. Go to the front page of the site; it should look something like the following:
This is the page that new users will see when they visit your domain. It doesn't look like much yet, but it is the beginning of a blog network. We will install a new theme and start adding new features as we work through the tutorial.
For now, let's try making a new user and a new blog.
1. If you're not already logged out, click Log Out on the front page of the site.
2. On the front page of the site, click create new blog.
3. Enter a username and an email address. Leave Gimme a blog! ticked, and click Next.
4. Choose the subdomain you want, give your blog a title, and click Sign Up.
5. If everything goes well, you should get an email within a few minutes, and clicking the link in the email should send you to a confirmation page showing your username and password.
|
If your signup didn't work If you don't receive the signup confirmation email, check the email settings in your WordPress MU control panel. If you get the email, but the link doesn't work, then the problem lies with the subdomains setting. A good place to look for advice when it comes to setting up WordPress MU is the official forums, which can be found at http://mu.wordpress.org/forums. |
Doing more with the thing
In this tutorial we set up a bare-bones install of WordPress MU. Before we start expanding it, why not familiarize yourself with a few of the features. Make some posts on the front page, and perhaps create a few fake users and blogs to populate the site a little. Try adding some new links to some of the blogs or uploading some videos.
[edit] Additional References
- For instructions on Troubleshooting WordPress MU 2.8, click here
- For instructions on Customizing site using WordPress MU 2.8, click here
- For instructions on Developing WordPress Themes, click here
- For instructions on Configuring WordPress Themes, click here
- For instructions on Troubleshooting WordPress Installation, click here
- For instructions on Developing WordPress 2.7 Themes, click here
- For instructions on Set Up for Word Press 2.7, click here
- For instructions on Theming Wordpress, click here
- For instructions on WordPress, click here
[edit] Source
The source of this content is Chapter 2: Installing WordPress MU of WordPress MU 2.8: Beginner's Guide by Lesley A. Harrison (Packt Publishing, 2009).
