Installation Wiki

Set Up for Word Press 2.7

From InstallationWiki

Jump to: navigation, search
Set Up for Word Press 2.7
Official Page
Project Documentation
Download
Source Book
200px-184719656X.jpg
ISBN 978-1-847196-56-9
Publisher Packt Publishing
Author(s) April Hodge Silver

WordPress is available in easily downloadable formats from its website at http://wordpress.org/download/. Currently, WordPress Version 2.7.1 is available for download. WordPress is a free, open source application, and is released under the GNU General Public License (GPL). Anyone who produces a modified version of software released under the GPL is required to keep those same freedoms attached to his or her modified version. This way, WordPress and other software released under GPL are kept free and open source.

There is a slightly different version of WordPress that is capable of supporting multiuser blogging. This means several users can maintain separate blogs within a single installation of WordPress. They can log into and maintain their blogs independently of one another. This version of WordPress is known as WordPress MU or WordPress Multi-User. In this tutorial, we will only cover the installation and use of WordPress.

Contents

[edit] Where to build your WordPress website

The first decision you have to make is where your blog is going to live. You have two basic options for the location where you can create (or build) your site. They are:

  • Build on WordPress.com
  • Build on your own server

The advantage of building on WordPress.com is that they take care of all of the technical details for you. The software is already installed; they'll upgrade it for you whenever there's an upgrade, and you're not responsible for anything else. The big disadvantage is that you lose almost all of the theme and plugin control you'd have otherwise. WordPress.com will not let you upload or edit your own theme, and will only let you edit the CSS of your theme if you pay a fee ($15/year currently). WordPress.com will not let you upload or manage plugins at all. Some plugins are installed by default (most notably Akismet, for spam blocking and a fancy statistics plugin), but you can neither uninstall them nor install others. This tutorial will cover creating a blog on WordPress.com, and you can learn about navigating around the WP Admin in the next tutorial. However, much of what this tutorial covers will be impossible on WordPress.com.

The huge advantage of building on your own server (which probably means a server that belongs to the web host that you signed up with) is that you have control over everything. You can add and edit themes, add and remove plugins, and even edit the WordPress application files yourself. You'll have to keep your own WordPress software up-to-date, but that's relatively simple and we'll cover it in this tutorial.

As I said, we'll discuss building on WordPress.com in this tutorial. But you will have to build on your own server if you want to accomplish any of the more advanced topics from this tutorial.

The following table is a brief overview of the essential differences between building on WordPress.com versus your own server:

WordPress.com


Your Own Server


Installation


You don't have to install anything, but just sign up


Install WordPress yourself, either manually or via your host's control panel (if offered)


Themes


Use any theme made available by WordPress.com


Use any theme available anywhere, written by anyone (including yourself)


Plugins Limited plugin availability


Use any plugin available anywhere, written by anyone (including yourself)


Upgrades WordPress.com provides automatic upgrade


You have to upgrade it yourself when upgrades are available


Widgets Widget availability depends on available themes


You can widgetize any theme yourself


Maintenance You don't have to do any maintenance


You're responsible for the maintenance of your site


Advertising


No advertising allowed


Advertise anything and in any amount you like


[edit] Building on WordPress.com

WordPress.com (http://www.wordpress.com) is a free service provided by the WordPress developers where you can register a blog easily and quickly with no hassle. However, because it is a hosted service, your control over some things will be more limited than it would be if you hosted your own blog. As mentioned before, WordPress.com will not let you edit or upload your own theme. Aside from this, WordPress.com is a great place to maintain your personal blog if you don't need to do anything fancy with a theme.


To register your free blog, click on the loud blue-and-white Sign Up Now! button. You will be redirected to the signup page. In the following screenshot, I've entered my username (what I'll sign in with) and a password (note that the password measurement tool will tell you if your password is strong or weak), as well as my email address. Be sure to check the Legal flotsam box and leave the Gimme a blog! radio button checked. Without it, you won't get a blog.

After providing this information and clicking on the Next button, WordPress will ask for other choices (Blog Domain, Blog Title, Language, and Privacy), as shown in following screenshot. You can also check if it's a private blog or not. Note that you cannot change the blog domain later! So be sure it's right.

After providing this information and clicking on Signup, you will be sent to a page where you can enter some basic profile information. This page will also tell you that your account is set up, but your email ID needs to be verified. Be sure to check your inbox for the mail with the link and click on it. Then you'll be truly done with the installation.


Now you can skip the next section, which is about installing WordPress manually. You can go directly to the section on the WP Admin panel to start learning about it.

[edit] Installing WordPress manually

The WordPress application files can be downloaded for free if you want to do a manual installation. If you've got a website host, this process is extremely easy and requires no previous programming skills or advanced blog user experience. It's a simple ready-set-go blogging engine, where you can easily start even if you are blogging for the first time. Some web hosts even offer automatic installation through the host's online control panel. However, be a little wary of this because some hosts offer automatic installation, but they do it in a way that makes updating your WordPress difficult or awkward.

[edit] Preparing the environment

A good first step is to make sure you have an environment set up that is ready for WordPress. This means two things: being sure to verify that the server meets the minimum requirements, and being sure that your database is ready.

As far as web servers go, Apache is the best. But WordPress will also run on a server running the Microsoft server (though you won't be able to use permalinks).

Enabling mod_rewrite to use permalinks

If you want to use permalinks, your server must be Unix and Apache's mod_rewrite option must be enabled. Apache's mod_rewrite is enabled by default in most web hosting accounts. If you are hosting your own account, you can enable mod_rewrite by modifying the Apache web server configuration file. You can check the URL http://www.tutorio.com/tutorial/enable-mod-rewrite-on-apache to know how to enable mod_rewrite on your web server. If you are running on shared hosting, then ask your system administrator to install it for you. However, it is more likely that you already have it installed on your hosting account.

For WordPress to work, your web host must provide you with a server that does the following two things:

  • Support PHP, which must be at least Version 4.3.
  • Provide you with write access to a MySQL database. MySQL has to be at least Version 4.0.

You can find out if your host meets these two requirements by contacting your web host. If your web server meets these two basic requirements, you're ready to move on to the next step.

[edit] Downloading WordPress

First, you need to download WordPress from http://wordpress.org/download/. Take a look at the following screenshot in which the download links are available on the right side:


The .zip file is shown as a big blue button as most people will need it. If you are using Windows, Mac, or Linux operating systems, your computer will be able to unzip that downloaded file automatically. (The .tar.gz file is provided because some Unix users prefer it.)

A further note on location

We're going to cover installing WordPress remotely. However, if you plan to develop themes or plugins, I suggest that you also install a local version. Testing and deploying themes and plugins directly to the remote server will be much more time-consuming than working locally. If you look at the screenshots I'm taking of my own WordPress installation throughout the tutorial, you'll notice that I'm working locally (for example, http://packt1:8888/ is a local URL).

After you download the WordPress ZIP file, extract the files and you'll get a folder called wordpress. This is what it will look like:


Notice that there is a readme.html file inside this folder, which gives you a very good introduction to many different features of WordPress.

[edit] Uploading the files

Now we need to upload all these files to our web server using any FTP client. There are several FTP clients available on the Internet, which are available either free or as shareware (for a small fee). Take a look at these possibilities if you don't already have an FTP software:

You can also use the popular web-based FTP application net2ftp at http://www.net2ftp.com. These services are useful if you don't want to install a desktop application on your computer. You can also check if your host provides browser-based FTP software.

In my screenshots you'll see that I'm using Transmit, which is the professional FTP software I use on my Mac. It works the same way as the examples above.

Using your FTP client or service, connect to your FTP server using the server, username, and password provided to you by your host. Next, open the folder where you want WordPress to live. You may want to install WordPress in your root folder, which will mean that visitors will see your WordPress website's home page when they go to your main URL for example, http://yoursite.com. Or, you may want to install WordPress in a subfolder; for example: http://yoursite.com/blog/.

On the left side you will see the files from your local folder, and on the right side you will see your remote folder.


Now select all of the WordPress files on your local machine from the left pane, and drag all of them to the right pane. You can watch as your FTP client uploads the files one at a time and they appear in the right panel.

Once all of the files are done uploading, you're ready to do the installation.

[edit] Installing WordPress

Now it's time to install WordPress. For example, I just uploaded all my files to the root of my local website at http://packt:8888/. So, this is going to be the URL of my WordPress website. If you access your WordPress URL via your browser, it will look like this:


It says that you need to create a file named wp-config.php before proceeding further. You can click on the Create a Configuration File if you want, but it may not work. Your other option, as WordPress recommends, is to do it manually. If you decide to try Create a Configuration File, you'll need the information we will soon discuss.

Open the wordpress folder and find the file named wp-config-sample.php. Make a copy of this file and name it wp-config.php. We'll modify this file together. Don't worry; you need not be a PHP programmer. Just open this file with a simple editor such as Notepad. The following is the copied text from the original wp-config.php file:

 <?php
 // ** MySQL settings ** //
 define('DB_NAME', 'putyourdbnamehere'); // The name of the database
 define('DB_USER', 'usernamehere'); // Your MySQL username
 define('DB_PASSWORD', 'yourpasswordhere'); // ...and password
 define('DB_HOST', 'localhost'); // 99% chance you won't need to // change this value
 define('DB_CHARSET', 'utf8');
 define('DB_COLLATE', '');
 
 // Change each KEY to a different unique phrase. You won't have to remember the phrases later,
 // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/
 // to get keys generated for you, or just make something up. Each key should have a different phrase.
 define('AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase.
 define('SECURE_AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase.
 define('LOGGED_IN_KEY', 'put your unique phrase here'); // Change this to a unique phrase.
 
 // You can have multiple installations in one database if you give each a unique prefix
 $table_prefix = 'wp_'; // Only numbers, letters, and underscores please!
 
 // Change this to localize WordPress. A corresponding MO file for the
 // chosen language must be installed to wp-content/languages.
 // For example, install de.mo to wp-content/languages and set WPLANG to 'de'
 // to enable German language support.
 define ('WPLANG', '');
 
 /* That's all, stop editing! Happy blogging. */
 
 if ( !defined('ABSPATH') )
  define('ABSPATH', dirname(__FILE__) . '/');
 require_once(ABSPATH . 'wp-settings.php');
 ?>

One thing to know about PHP is that any text that comes after a double slash (//), or between a slash-star and star-slash (/* */), is a comment. It's not actual PHP code. Its purpose is to inform you what that line or that section is about.

As you can see from the previous code, there are a number of settings and parameters that you can set here. However, we'll only worry about the most important ones: the database details.

As I mentioned in an earlier section, you need to have write access to a database. Most large web hosts offer you a way to create your own databases, with usernames and passwords, via an online control panel. If you're not sure how to do this, just email or call your hosting provider for this information. You'll need four pieces of information about your database for the WordPress configuration file. They are:

  • Database server for example, mysql.yoursite.com
  • Username for example, aprilsdbuser
  • Password for example, 62dcx0hnm
  • Database name for example, wptestdb

Once you have those four things, you can fill them into your wp-config.php file. For example, see how mine is filled out here:

 // ** MySQL settings ** //
 define('DB_NAME', 'wptestdb'); // The name of the database
 define('DB_USER', 'aprilsdbuser'); // Your MySQL username
 define('DB_PASSWORD', '62dcx0hnm'); // ...and password
 define('DB_HOST', 'mysql.yoursite.com'); // 99% chance you won't need to change this value

The only other thing you really need to consider is the table prefix. I strongly recommend using a prefix. If you want to install WordPress more than once, you'll need to use different prefixes in your different installations. If you are using this same database for other things, it'll be handy if the tables are grouped based on what they're being used for. So either leave this line as it is, or choose another prefix:

 // You can have multiple installations in one database if you give each a unique prefix
 $table_prefix = 'wp_'; // Only numbers, letters, and underscores please!

You may also want to enter three unique phrases for the three keys. This will help to keep your WordPress installation uniquely protected. No one else is likely to choose the same unique keys that you chose, and these will be used when encrypting the passwords for your WordPress users.

Now go back to your browser and re-load the page that's pointing to your WordPress installation. If your configuration file makes sense to WordPress, you'll be taken to the installation page immediately.


Just fill in the name of your blog and your email address, and click on Install WordPress. (You can change these later, so don't feel locked into your choices now.) The next page you see will be the last page of the installation!

This page shows you the default Username, which is always admin, and a randomly generated Password.


I suggest you copy that password and paste it into a temporary file on your computer. You'll also need to paste it again in a few minutes when you log in to your WordPress website for the first time.

You can click on Log In to get to the login page. Or you can always enter your WordPress Admin panel (also known as the WP Admin) by pointing your browser to http://yoursite.com/wp-admin. If you're not already logged in, this URL will re-direct you to the login page.

If you'd like to see an even more detailed step-by-step guide for manual installation, take a look at this page in the WordPress Codex: http://codex.wordpress.org/Installing_WordPress.

[edit] Additional References

  • For instructions on installing and setting up WordPress, click here
  • For instructions on Developing 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 Theming Wordpress, click here
  • For instructions on Troubleshooting WordPress MU 2.8, click here
  • For instructions on Installing WordPress MU, click here
  • For instructions on Customizing site using WordPress MU 2.8, click here
  • For instructions on Configuring WordPress Themes, click here

[edit] Source

The source of this content is Chapter 2: Set Up for Word Press 2.7 of WordPress 2.7 Complete by April Hodge Silver (Packt Publishing, 2009).

Personal tools