Installing WordPress On A CPanel Hosting Site

Introduction

I have installed the WordPress blogging software many times on dedicated servers for clients. Although I am not comfortable with all the possible vulnerabilities in PHP, I feel comfortable with the people developing the software.

I recently purchased a website through a hosting service and wanted WordPress as my blog software. As expected, I knew it would be different installing it using the cpanel admin interface. Below is a step-by-step, copy and paste procedure for installing WordPress on a cPanel hosted site.
Create MySQL Database
  • Login to your cpanel admin page, you should be familiar with the cpanel page and it has a number of icons on it. The one you want is the "MySQL Databases" icon. Scroll down the page until you find it, then click on it.
  • If you have created a database for something else you may need scroll down the page. Find where it says: "New Database", an empty field next to it and next to that a "Create Database" button. Here you can create a new database or use an existing one. I usually choose to create a new one. For purposes here I called mine wordpressblog, but any name you can remember will work. When you have created the new database, go back to the MySQL Databases page.
  • If you have a database username already then scroll down to where cpanel screen says "Add Users To Your Databases:" and add your current "username" to the database you just created.
  • Click on the "Add User" button. Some version of cPanel X name this button "Create User". Then go back to the MySQL Databases page.
  • If you have not created a database username for other applications then you need to create one now. This user will access the wordpress database.
  • The final and most important thing you must do next is to click on the "Add User To Database" button.
  • Access Hosts - localhost(the server you are working) is there by default. Add any other host you want in order to admin the MySQL Database. It is not necessary to add any hosts as you can manage your databases by using phpMyAdmin provided by your hosting provider.
Wordpress
  • ssh to your website to access the command line. Change directories to your DocumentRoot.
  • Download the newest version of Wordpress (currently it is 2.1). cd to your DocumentRoot. Then grab the latest version of the file using wget from the command line. For example:
# wget http://wordpress.org/latest.tar.gz
This will place the latest Wordpress software in the proper directory.
  • Gunzip and untar the latest.tar.gz for example:
# tar zxvf latest.tar.gz
This will create a directory called wordpress
  • Change directories to wordpress:
# cd wordpress

Configuring WordPress: wp-config.php
List the contents of the ./wordpress directory. You should see a file called wp-config-sample.php. Copy this to a file called wp-config.php:
# cp wp-config-sample.php wp-config.php
You next need to configure the following lines to whatever they should be based on how you set up your databases and how your website is set up. :

Change these lines in wp-config.php that you copied earlier.
// ** MySQL settings ** //
define('DB_NAME', 'myusername_wordpress'); // The name of the database
define('DB_USER', 'myusername_slacker'); // Your MySQL username
define('DB_PASSWORD', 'secret'); // ...and password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
My hosting provider tacks on my username and an underscore for the DB_NAME and DB_USER variables above. For example it would be
define('DB_NAME', 'myusername_wordpress'); // The name of the database
define('DB_USER', 'myusername_slacker'); // Your MySQL username
If you forget this when you first point to the installation script you will get an error page. You need to fix this if you get a WordPress error page.

Finally, point your browser to: http://yourWordPress.example.com/wp-admin/install.php, following the instructions and you are done.

It is as easy as what you just read.

Installing plug-ins

Probably the most important plug-in to install would be a Comment SPAM plug-in. Here are the various tools/plug-ins to combat spam.

Installing themes

Get your favorite theme and install it as you would normally install themes. Grab one, unzip/untar it in the ./wp-content/themes directories.

0 comments ::
Installing WordPress On A CPanel Hosting Site