Tuesday, 2 December 2008

Wordpress- Ummm!

Seeing as blogger exists and how simple it is to set up a blog, I do wonder why Wordpress is so popular when the installation instructions are as follows!

Detailed Instructions

Step 1: Download and Extract

Download and unzip the WordPress package from http://wordpress.org/download/.

  • If you will be uploading WordPress to a remote web server, download the WordPress package to your computer with your favorite web browser and unzip the package.
  • If you have shell access to your web server, and are comfortable using console-based tools, you may wish to download WordPress directly to your web server using wget (or lynx or another console-based web browser) if you want to avoid FTPing:
    • wget http://wordpress.org/latest.tar.gz
    • Then unzip the package using:
      tar -xzvf latest.tar.gz

      The WordPress package will extract into a folder called wordpress in the same directory that you downloaded latest.tar.gz.
  • If you do not have shell access to your web server, or you are not comfortable using console-based tools, you may wish to deploy WordPress directly to your web server using ZipDeploy.

Step 2: Create the Database and a User

If you are using a hosting provider, you may already have a WordPress database set up for you, or there may be an automated setup solution to do so. Check your hosting provider's support pages or your control panel for clues about whether or not you'll need to create one manually.

If you determine that you'll need to create one manually, follow the instructions for accessing phpMyAdmin on various servers, or follow the instructions for Using cPanel or Using phpMyAdmin below.

If you are installing WordPress on your own web server, follow the Using phpMyAdmin or Using the MySQL Client instructions below to create your WordPress username and database.

If you have only one database and it is already in use, you can install WordPress in it - just make sure to have a distinctive prefix for your tables, to avoid over-writing any existing database table.

Using cPanel

Main article: Using cPanel

If your hosting provider uses cPanel, you may follow these instructions to create your WordPress username and database.

  1. Log in to your cPanel.
  2. Click MySQL Databases.
  3. If a user relating to WordPress does not already exist under the Users section, create one:
    1. Chose a username for WordPress ('wordpress' is good) and enter it in the UserName field.
    2. Choose a difficult-to-guess password (ideally containing a combination of upper- and lower-case letters, numbers, and symbols), and enter it in the Password field.
    3. Write down the username and password you chose.
    4. Click Add User.
  4. If a database relating to WordPress does not already exist under the Databases section, create one:
    1. Choose a name for your WordPress database ('wordpress' or 'blog' are good), enter it in the Db field, and click Add Db.
  5. Under Databases, select your WordPress username from the User dropdown, then select your WordPress database from the Db dropdown. Make sure All is checked under Privileges, then click Add User to Db.
  6. When you return to the main MySQL Account Maintenance screen, cPanel will list information about the database you just created. You should see the username you just added to the database (with ALL PRIVILEGES), as well as a few sample Connection Strings for you to use in Perl or PHP scripts to connect to the database. The PHP code will have the following format:
$dbh = mysql_connect("hostname", "username", "") or die ("message");
mysql_select_db("databasename");
Write down the values of hostname, username, databasename, and the password you chose. (Note that hostname will usually be localhost.)

Using phpMyAdmin

If your web server has phpMyAdmin installed, you may follow these instructions to create your WordPress username and database.

Note: These instructions are written for phpMyAdmin 2.6.0; the phpMyAdmin user interface can vary slightly between versions.

  1. If a database relating to WordPress does not already exist in the Database dropdown on the left, create one:
    1. Choose a name for your WordPress database ('wordpress' or 'blog' are good), enter it in the Create new database field, and click Create.
  2. Click the Home icon in the upper left to return to the main page, then click Privileges. If a user relating to WordPress does not already exist in the list of users, create one:
    1. Click Add a new User.
    2. Chose a username for WordPress ('wordpress' is good) and enter it in the User name field. (Be sure Use text field: is selected from the dropdown.)
    3. Choose a difficult-to-guess password (ideally containing a combination of upper- and lower-case letters, numbers, and symbols), and enter it in the Password field. (Be sure Use text field: is selected from the dropdown.) Re-enter the password in the Re-type field.
    4. Write down the username and password you chose.
    5. Leave all options under Global privileges at their defaults.
    6. Click Go.
  3. Return to the Privileges screen and click the Check privileges icon on the user you've just created for WordPress. In the Database-specific privileges section, select the database you've just created for WordPress under the Add privileges to the following database dropdown. The page will refresh with privileges for that database. Click Check All to select all privileges, and click Go.
  4. On the resulting page, make note of the host name listed after Server: at the top of the page. (This will usually be localhost.)

Using the MySQL Client

You can create MySQL users and databases quickly and easily by running mysql from the shell. The syntax is shown below and the dollar sign is the command prompt:

$ mysql -u adminusername -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5340 to server version: 3.23.54

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE databasename;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON databasename.* TO "wordpressusername"@"hostname"
-> IDENTIFIED BY "password";
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

mysql> EXIT
Bye
$

The example shows:

  • that root is also the adminusername. It is a safer practice to choose a so-called "mortal" account as your mysql admin, so that you are not entering the command "mysql" as the root user on your system. (Any time you can avoid doing work as root you decrease your chance of being exploited). The name you use depends on the name you assigned as the database administrator using mysqladmin.
  • wordpress or blog are good values for databasename.
  • wordpress is a good value for wordpressusername but you should realize that, since it is used here, the entire world will know it too.
  • hostname will usually be localhost. If you don't know what this value should be, check with your system administrator if you are not the admin for your Wordpress host. If you are the system admin, consider using a non-root account to administer your database.
  • password should be a difficult-to-guess password, ideally containing a combination of upper- and lower-case letters, numbers, and symbols. One good way of avoiding the use of a word found in a distionary, uses the first letter of each word in a phrase that you find easy to remember.

If you need to write these values somewhere, avoid writing them in the system that contains the things protected by them. You need to remember the value used for databasename, wordpressusername, hostname, and password. Of course, since they are already in ) or will be, shortly) your wp-config.php file, there is no need to put them somewhere else, too.

Using Plesk

See: Plesk 7 at tamba2.org

Step 3: Set up wp-config.php

For the next part, the code you will be looking to change is as follows:

// ** 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 SECRET_KEY to a unique phrase. You won't have to remember it later,
// so make it long and complicated. You can visit https://www.grc.com/passwords.htm
// to get a phrase generated for you, or just make something up.
define('SECRET_KEY', 'put your unique phrase here'); // Change this to a unique phrase.
  1. Returning to where you extracted the WordPress package in Step 1, rename the file wp-config-sample.php to wp-config.php.
  2. Open the renamed wp-config.php file in your favorite text editor and fill in the following information, per the example above:
    DB_NAME
    The name of the database you created for WordPress in Step 2 .
    DB_USER
    The username you created for WordPress in Step 2.
    DB_PASSWORD
    The password you chose for the WordPress username in Step 2.
    DB_HOST
    The hostname you determined in Step 2 (usually localhost, but not always. See some possible DB_HOST values).
    DB_CHARSET
    The database character set, normally should not be changed. See Editing wp-config.php for details.
    DB_COLLATE
    The database collation should normally be left blank. See Editing wp-config.php for details.
  3. Save the file.
  • For more extensive details, and step by step instructions for creating the configuration file, refer to Editing wp-config.php.

For information on enabling SSL in WordPress 2.6, see SSL and Cookies in WordPress 2.6.

Step 4: Upload the files

Now you will need to decide where on your web site you'd like your blog to appear:

  • In the root directory of your web site. (For example, http://example.com/)
  • In a subdirectory of your web site. (For example, http://example.com/blog/)

Note: The location of your root web directory in the filesystem on your web server will vary across hosting providers and operating systems. Check with your hosting provider or system administrator if you do not know where this is.

In the Root Directory

  • If you need to upload your files to your web server, use your favorite FTP client to upload all the contents of the wordpress directory (but not the directory itself) into the root directory of your web site.
  • If your files are already on your web server, and you are using shell access to install WordPress, move all of the contents of the wordpress directory (but not the directory itself) into the root directory of your web site.

In a Subdirectory

  • If you need to upload your files to your web server, rename the wordpress directory to your desired name, then use your favorite FTP client to upload the directory to your desired location within the root directory of your web site.
  • If your files are already on your web server, and you are using shell access to install WordPress, move the wordpress directory to your desired location within the root directory of your web site, and rename the directory to your desired name.

Step 5: Run the Install Script

Point your favorite web browser to start the installation script.

  • If you placed the WordPress files in the root directory, you should visit: http://example.com/wp-admin/install.php
  • If you placed the WordPress files in a subdirectory called blog, for example, you should visit: http://example.com/blog/wp-admin/install.php

The following screenshots show how the installation progresses. Notice in the screen, Entering the details, you enter your Weblog title and your e-mail address. Also displayed is a check-box asking if you would like your blog to appear in search engines like Google and Technorati. Leave the box checked if you would like your blog to be visible to everyone, including search engines, and uncheck the box if you want to block search engines, but allow normal visitors. Note all this information can be changed later in your Administration Panels.

Version 2.3

Even the following famous install procedure would be beyond many!

Famous 5-Minute Install

Here's the quick version of the instructions, for those that are already comfortable with performing such installations. More detailed instructions follow.

  1. Download and unzip the WordPress package, if you haven't already.
  2. Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and modifying it.
  3. Rename the wp-config-sample.php file to wp-config.php.
  4. Open wp-config.php in your favorite text editor and fill in your database details.
  5. Place the WordPress files in the desired location on your web server:
    • If you want to integrate WordPress into the root of your domain (e.g. http://example.com/), move or upload all contents of the unzipped WordPress directory (but excluding the directory itself) into the root directory of your web server.
    • If you want to have your WordPress installation in its own subdirectory on your web site (e.g. http://example.com/blog/), rename the directory wordpress to the name you'd like the subdirectory to have and move or upload it to your web server. For example if you want the WordPress installation in a subdirectory called "blog", you should rename the directory called "wordpress" to "blog" and upload it to the root directory of your web server.

      Hint: If your FTP transfer is too slow read how to avoid FTPing at : Step 1: Download and Extract.
  6. Run the WordPress installation script by accessing wp-admin/install.php in your favorite web browser.
    • If you installed WordPress in the root directory, you should visit: http://example.com/wp-admin/install.php
    • If you installed WordPress in its own subdirectory called blog, for example, you should visit: http://example.com/blog/wp-admin/install.php

That's it! WordPress should now be installed.

1 comment:

  1. Far out robin! Is it really that hard? Why do we have to be so smart to use wordpress. I'm sticking with blogger. One of Mark's blog friends changed over to wordpress and she seems to have found it to be more creative and less obstinate. but reading those instruction is the best anti advert I've ever seen!

    ReplyDelete