Installation Wiki

WordPress

From InstallationWiki

Jump to: navigation, search
WordPress
Official Page
Project Documentation
Download
Source Book
WordPress Complete
WordPress Complete
ISBN 978-1-904811-89-3
Publisher Packt Publishing
Author(s) Hasin Hayder

This tutorial will guide you through the process of setting up WordPress and customizing the basic features. WordPress is very small in size, easy to install, and easy to administer. This article will show you the different processes for installing WordPress and for setting it up.

WordPress is available in easily-downloadable formats from its website at http://wordpress.org/download/. Currently, WordPress version 2.3 is available for download. WordPress is a free open ‘source application, which means you need not pay a single penny for whatever purpose you use it. WordPress is released under the GNU General Public License (GPL). If you are not familiar with the popularity statistics of WordPress, here is an exciting piece of news for you. The previous stable version of WordPress (version 1.5) had been downloaded more than 900,000 times. The recent version 2.0 has already been downloaded more than 1,316,092 times till the time of writing.

There is also a different version of WordPress with a multi-user blogging flavor, i.e. several users can maintain their blog separately with a single installation of WordPress. They can register and maintain their blogs independently of one another. This special version of WordPress is neither stable nor mature enough. Moreover, it is not officially supported. This version of WordPress is known as WordPress MU or WordPress multi user. In this article, we will only cover the installation of WordPress.

Contents

Installing WordPress Manually

As I said before, WordPress can be downloaded for a manual installation, which is extremely easy and requires no previous programming skills or advanced blog-user experience. It's simply some kind of ready-set-go type of blogging engine where you can easily start even if you are blogging for the first time. For the automatic installation, we will discuss how to set it up with the different administration tools available in cPanel.

First of all, download WordPress from its website at http://wordpress.org/download/. It is available in both Gzip (tar.gz) and ZIP (.zip) format. Take a look at the following screenshot in which the download links are available on the right side; you may download either of them. If you are using Windows XP or Linux operating systems, you don't need to have any unzipping utility for extracting. Windows XP and later versions can directly extract files from compressed ZIP files. You will also get a built-in extraction facility if you are using Linux.

Before installing WordPress, please check the minimal requirements. You must have a web server that supports PHP. The best web server that you can count on is Apache. For PHP, you must have at least version 4.2 or later installed on your machine. WordPress will also run with PHP 5.x.x series without any problem. Besides, you require a MySQL database server; you must have at least MySQL version 3.23.23 or later installed on your machine. You may also have a local or remote MySQL server with complete privileges to create tables required for WordPress. If your web server meets all these requirements, it is surely ready to proceed further. Let us take a look at these minimum requirements once again. Apache mod_rewrite is also required for a user-friendly URL.

Apache mod_rewrite is installed 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.

Let us download the archive (either in .zip or .tar.gz format) of WordPress. Besides the remote installation of WordPress, I strongly suggest installing a local version as well. If you plan to develop themes or plug-ins, testing and deploying them directly to the remote server may require more time than testing and deploying them locally. Let us try the remote installation. If you extract the WordPress ZIP file, it will look something like this:

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

Now we need to upload all these files to our website using any FTP client. There are several FTP clients available on the Internet for free usage (or as a shareware). Here we will use Filezilla (http://filezilla.sourceforge.net/) as an FTP client to connect to our FTP server and then upload these files. Following is a step-by-step guide to the installation process.

You can also use the popular web-based FTP applications Net2FTP at http://www.net2ftp.com or Web2FTP at http://web2ftp.com. Using these packages, you can upload archives from the Internet and they will automatically uncompress the archive. I found it really useful, because now I can always stay in touch with my FTP server without installing any desktop application.

Step 1: Connect to your FTP Server

Using any FTP client, just connect to your FTP server and open the folder where you want to upload these files. I am using Filezilla as an FTP client here. After connecting to your FTP server, you will see the following window. (I am uploading my file in phpxperts.com in the testwp folder.)

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

Step 2: Upload the Files

Just locate the extracted WordPress files on your local machine from the left pane and drag all of them onto the right pane. You will see that all these files have been queued to be uploaded.

File transfer will then start automatically.

Step 3: Install

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

It says that you need to configure a file named wp-config.php before proceeding further. Open the WordPress folder and find the file named wp-config-sample.php. You have to rename this file as wp-config.php and modify its content. However, keep a backup of the original wp-config- sample.php file somewhere else for in case of problems. Don't worry; you need not be a PHP programmer for editing this file. Just open this file with a simple editor like VI or Notepad. The following is an example of the original wp-config.php file:

<?php
// ** MySQL settings ** //
define('DB_NAME', 'WordPress'); // The name of the database
define('DB_USER', 'username'); // Your MySQL username
define('DB_PASSWORD', 'password'); // and password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value

// 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-includes/languages.
// For example, install demo to wp-includes/languages and set WPLANG to 'de' to enable German language support.
define ('WPLANG', );

/* That's all, stop editing! Happy blogging. */

define('ABSPATH', dirname(__FILE__).'/');
require_once(ABSPATH.'wp-settings.php');
?>

There are several parameters for setting up a successful connection to the MySQL database. You now have to modify them so that they match the original settings of your MySQL database. If you already have a web hosting account, then you probably know the MySQL database details (i.e. database name, username, and password) for your account. If you don't have this data, please contact your web host providers for it. If you have cPanel in your web hosting account, you may create databases from the MySQL administration panel (depending on how many databases you can create for your hosting account). We will now discuss how to create a database from cPanel.

Well, it's not mandatory that you need cPanel in your hosting account to create databases. Sometimes it is also possible to create databases using Ensim, HSphere, or Plesk. If you have shell or secured shell access, you can achieve this functionality by giving commands.

To create a database from cPanel, log into cPanel and click on the "MySQL database" icon. You will get a page showing the details of your database entries. In this page, you will see a portion where you can create new databases as shown in the following screenshot:

Just enter the name of your database and click on the Add Db button; it will be created instantly. If database creation is successful, you will get the following confirmation:

If you click on the Go Back link, you will reach the previous page where your database is listed in the available Db drop-down box. Now the next task is to create a user and assign that user to your database.

Enter a username and password into the text field and click on the Add User button. You will get a confirmation after successfully creating a user.

Let us assign full privilege to this newly created user of the database that you just created. Select the newly created user from the User drop-down list and the database from the Db list. Please ensure that you have marked the checkbox for All. Finally, click on the Add User to Db button, and that's it!

You can use this data for a custom WordPress installation.

If you are testing a WordPress installation on your local PHP, Apache, and MySQL installation, please log into your MySQL client and execute the following command to create a database:

mysql> create database wp;

After creating the database, modify the wp-config.php file with the proper parameters. Actually, all we change here are the database parameters. For my machine, the wp-config.php file after modification looks like this:

 <?php
 // ** MySQL settings ** //

 <code>define('DB_NAME', 'wp'); // The name of the database

 define('DB_USER', 'hasin'); // Your MySQL username

 define('DB_PASSWORD', 'WordPress!@#$%'); // ...and password
 define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
 
 // 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-includes/languages.
 // For example, install demo to wp-includes/languages and set WPLANG to 'de' to enable German language support.
 
 define ('WPLANG', '');
 
 /* That's all, stop editing! Happy blogging. */
 
 define('ABSPATH', dirname(__FILE__).'/');
 require_once(ABSPATH.'wp-settings.php');
 ?>
If you have only one MySQL database in your web-hosting account and you don't have permission to create more, then the $table_prefix setting in wp-config.php is extremely helpful. For WordPress installation, this setting is used as a prefix for each table name; so there are no conflicts in between the existing tables and the newly created tables. By changing this setting, you can install as many WordPress installations as you want using a single MySQL database.

Note that I did not make any changes after the fifth line. Now again locate the WordPress URL via your browser. It now looks something like the following screenshot. Here, you will get a link to install.php.

Click on this install.php hyperlink. It will redirect you to the following installation page:

Proceed further by clicking on First Step. This will redirect you to a page where you have to insert some basic settings about your blog.

Fill out the Webl'og' title and Your e-mail fields properly. The weblog title will be the title of your blog, and for all communication purposes WordPress will use this email address to communicate with you. So you must provide a valid email address. Now it's time to click and go to the second step. Do it and you will see something like the following screenshot:

If you reach the page above, you have installed WordPress successfully in your hosting account. Just note that this page gives you an auto-generated password for your admin account. For my installation, it is 3564ff as you can see in the screenshot. This page also contains the link to the admin panel of your WordPress installation as wp-login.php. For later use, just note that you can get access to the admin panel via the URL http://your_WordPress_installation_path/wp-login.php.

Installing WordPress from the cPanel

We will now learn how to install WordPress automatically via Fantastico in cPanel and then log into the WordPress admin panel. There is no guarantee that you have Fantastico in your cPanel because it is a value-added service. Just log into your cPanel, and search for the word Fantastico. If you have it, you will find it. Follow these steps to get WordPress automatically installed on your hosting account.

Firstly, click on Fantastico. The following screenshot is a typical view of Fantastico after you get in. Note that you will find WordPress in the Blogs section of Fantastico. To start the automated installation, click on WordPress.

Next, click on New Installation.

The screenshot opposite shows the page filled with sample data. If you want to enable blogging by email, then you have to fill out the email parameters with valid data. Please note that the data you give here as Site name will be the title of your blog. After entering the necessary data, click on Install WordPress.

This is the final screen. Just click on Finish Installation to be redirected to the next page.

In the following page, you have to enter a valid email address. The details of your WordPress installation will be mailed to that address.

That's all for installing WordPress from cPanel.

Upgrading WordPress from Older Installations

If you have an older version of WordPress installed and want to upgrade it instead of making an entirely new installation, the following steps will guide you through:

As a first step, you must do the following for the security of your databases and files:

  1. You must back up your WordPress database. If anything goes wrong while upgrading (there is a greater chance that everything will go fine), you may lose your database content.
  2. You must back up all your WordPress files in the WordPress directory, even including the .htaccess file, if present.
  3. Verify that these backups are not corrupted and you can use them later when required. If your Internet connection breaks during the download, you may have a corrupted file. So always try to check the backups to see whether you can unzip them.
  4. Deactivate all your plug-ins. Deactivating plug-ins is a must, since some plug-ins may not work with the new coding structure of WordPress and these plug-ins may cause instability to your new WordPress installation. So before proceeding further, please ensure that you have already disabled all your plug-ins from your WordPress admin panel plug-ins section. Warning: Do not start the upgrade process unless you have ensured that the preceding four steps are completed.

    To upgrade completely, the following steps have to be performed:

  5. Delete your old WordPress files except the following: wp-config.php file wp-content folder wp-images folder wp-includes/languages folder .htaccess file, if you used custom mod_rewrite rules for your previous WordPress site
  6. Upload the new WordPress files to your previous WordPress folder. Some of the files may be automatically re-written. For now, just allow overwriting your files.
  7. Run the WordPress upgrade and follow the necessary instructions from that page. You can access the upgrade page from this URL: http://example.com/wp-admin/upgrade.php.
  8. Upgrade your permalink setup to what it was before. If you wrote it in the .htaccess file, upgrade the .htaccess file according to the previous one. You have not yet been introduced to managing permalinks; that is covered in the later chapters of the source book. You will then understand the importance of this step.
  9. Upgrade your plug-ins and themes. The new WordPress installation may break backward compatibility for some plug-ins. So plug-in developers may release new versions of their plug-ins that are compatible with this new version of WordPress. Just check the plug-ins that work with this version of WordPress from http://codex.WordPress.org/User:Matt/2.0_Plugin_Compatibility.
  10. Log in to the admin panel and activate your necessary plug-ins.
  11. Finally, just ensure that all the features are working well.

We hope that you now have an upgraded version of WordPress running in your machine.

Basic Troubleshooting during Installation

After the completion of the WordPress installation, you may come across some basic problems. If there were some problems during installation, you may not have a proper output. You can visit the Codex site at http://codex.WordPress.org for some basic troubleshooting FAQ.

Logging into the Admin Panel

After a successful installation, it's time to get started. Let us log into the admin panel of WordPress to make some basic configurations. You must do it to get your blog up and running properly.

You can always log into the WordPress admin panel via the URL http://your_WordPress_installation_path/wp-login.php (for example, www.phpxperts.com/testwp/wp-login.php). You will see the following page:

On this page, you also get an option to retrieve your lost password. For now, just enter your username that is by default "admin" and the password that you got during installation.

The WordPress admin panel displays tons of interesting features in a very structured way. We will get familiar with them with the passage of time. For now, we will only stick with those features that are necessary after a successful installation. Following is a screenshot of the WordPress admin panel that I see just after logging into my personal blog:

By default, the screen that you see just after login is called Dashboard. Here, you get some necessary and important information. From the dashboard, you can start basic things, start comment moderation, and see your recent posts and comments. The dashboard is a very important feature of WordPress.

Just below your blog title, notice a menu bar with different options like Dashboard, Write, Manage, and so forth.

If you remember, during the final stage of manual installation (not from cPanel), you got a password with the help of which you logged into the admin panel just now. To keep such a password in mind would be a difficult task for many. So the first thing we are going to do is change that password into something more easy and readable.

Changing the Password

You can change your login information and password from the Users menu. Clicking on it, you will get a page where you can change your credentials and basic information. To change the password, locate the rectangle outlined in the following screenshot:

You can change a lot of information from here. Enter your desired new password and update by clicking the Update Profile button at the bottom-right corner. If you are successful, you will get a notice saying Profile Updated.

You need to change another important feature in this page. This is how other people see you in your blog. You can change this setting from the drop-down box named Display name publicly as. Select admin or your name from it. Just don't let others see you as your email address, which is the default. This may cause you to get a lot of spam in your mail box.

Changing General Blog Information

You may need to change some general blog information like blog title, blog slogan, and so forth after a successful installation to kick-start blogging. For this, you can head towards General Options by clicking on the Options menu.

There are many options to play with, but we will only look at those options that are necessary as basic blog information. Here, you can enter your Weblog title, blog slogan as Tagline, E-mail address, Membership, New User Default Role, and Date and Time data. Most of these options are familiar to you except membership and new user role. WordPress is a blog engine where many users can blog at a single place if you allow them to write, after being registered. This means that they don't get a separate blog for themselves, but rather a single place where they can all contribute. They may have roles and privileges, and they can do a lot of things according to their roles. So be careful about these two settings.

There are two options available under Membership: one is Anyone Can Register and another one is Users must be registered and logged in to comment. The first one indicates that anyone can register in your blog and start having some fun. They can register themselves into your blog via the URL http://your_WordPress_installation_path/wp-register.php. If you turn the first option on, you will see something like the following when you visit that URL:

If you don't allow public registration, you will get the following page:

If you don't need multiple users in your blog, it is suggested to turn this feature off because of possible security breaches. Moreover, this feature is not needed when you are maintaining your blog by yourself.

There is another setting that works in conjunction with the previous setting. This is the New User Default Role option, which means what should be the role when a user registers in your blog. If you allow public registration, just keep the setting as is, i.e. subscriber. Users as subscribers have minimal control over your blog unless you promote them to "Administrator", "Editor", "Author", or "Contributor". So by making them a subscriber when they register in your blog for the first time, you have less possibility of security breaches. Please ensure that you don't set them as an administrator, by default, else it might prove disastrous.

You can also change the date and time settings from the General Options page. Here UTC time means "Universal Time Coordinated". This is same as GMT or Greenwich Mean Time. You can set it appropriately according to your time zone. For example, I live in Bangladesh and it's a +6 GMT timezone. So I would set the time in the Times in the weblog should differ by field to 6. If you are living in Canada, your timezone is GMT -6. So you will use -6 for this setting.

Posting your First Post

We have made a lot of settings and gone through several options. Now it's time to starting blogging. The core of any blog is a post, so you are going to make your first post. To post content, you can start by going to the dashboard and clicking on Write a post or you may directly click on Write from the menu bar. Here is what you see after you get in.

Every post should have a title and some content. There are many other options on this page, which are discussed in more detail in Chapter 4 of the source book. For now, we will just write a sample article and post it. Write the title as you want and click on the Publish button once you are done. Don't worry about the sample post. You can manage your posts, edit them, or delete them anytime you want. So for now just make a post to start.

After posting, you can view your blog by clicking on View site in the top bar of the admin panel, just right after your blog title. You should see something like this:

The WordPress post page features a rich WYSIWYG (What You See Is What You Get) editor through which you can post contents in your blog.

Making a Comment

When you read your blog, you may see many outsiders making comments on your posts. You may also need to post comment on some of your posts in other blogs. Here we will discuss how we can make a comment on a specific post. We will comment on the post we just made.

You will notice a link saying No Comments just below your post. You can post comments by clicking on it, which will take you to the following page:

Write anything here and submit your comment. If you make a successful comment, you will see something like this just under the content of your post.

Retrieving a Lost Password

If you have lost your password and can't get into your admin panel, you can easily retrieve your password by clicking on the lost your password? button on the login page. A newly generated password will be instantly mailed to you at the email address given by you during or after installing WordPress via the General Options page. So always enter a valid email address; otherwise, it will be a big problem to retrieve lost passwords.

Summary

You have learned a lot of things from this tutorial. Now you are able to install WordPress, make posts and comment on those posts totally by yourself. You have also learned how to change different administrative options for your blog.

Additional References

  • 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 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

Source

The source of this content is Chapter 1: Getting Started With WordPress of WordPress Complete by Hasin Hayder (Packt Publishing, 2006).

Relevant Links

BitNami Wordpress Stack - Wordpress easy installer with Apache, MySQL and PHP.

Personal tools