Setup a WordPress Website
Posted on August 15, 2007
Filed Under WordPress Admin, WordPress Review |
Want to automate your website? Get a free open source content publishing/management system. Using the greatest blogware - WordPress, you can easily setup and build a blog-based and/or content-driven website and manage your site through to ready-to-use web interfaces without heavy design and coding. You can implement WordPress easily as long as your web hosting supports PHP version 4.2 or greater and MySQL version 3.23.23 or greater.
Prepare for Setup
Download WordPress
Download the latest stable release of WordPress ( currently Version 2.1.2) which is a zip file named as “wordpress-2.1.2.zip” from http://wordpress.org/download/
Extract Installation Package
Unzip the download package to extract all files into a staging area in your file system such as a temp folder. Make sure you choose “Use folder name” when you unzip it. You’ll see all files are extracted into a new folder named as “wordpress”.
Setup Database
Login to your web hosting’s control panel and create a MySQL database for the WordPress website. In my web host server, the newly created database name is “altbase_wprb” where “altbase” is the account name of my web hosting.
Also, create a MySQL user who has all privileges for accessing and modifying the database. The user name in my system is “altbase_root”.
Enter Database Info
First, go to the extracted “wordpress” folder and rename the wp-config-sample.php file to wp-config.php.
Then, open this file and enter database information as:
define(’DB_NAME’, ‘ altbase_wprb’); // The name of the database
define(’DB_USER’, ‘altbase_root’); // Your MySQL username
define(’DB_PASSWORD’, ’sqlpass’); // …and password
define(’DB_HOST’, ‘localhost’); // 99% chance it is ‘localhost’
Also, we changed the table prefix to “rb_” since we plan to setup a few more related WordPress blog websites with the same database:
// Change the prefix if you want to have multiple blogs in a single database.
$table_prefix = ‘rb_’; // example: ‘wp_’ or ‘b2′ or ‘mylogin_’
Installation
WordPress can be installed in the website’s root directory or in its own subdirectory. It gives you better control and maintenance by installing WordPress in a subdirectory. In our case, we first installed it in a subdirectory called “blog”. By default, our WordPress site could be accessed from www.richbase.com/blog/
Upload WordPress
Rename the extracted folder from “wordpress” to “blog”. Then use an FTP software such as FileZilla to upload the entire “blog” folder into your website’s root directory.
Run Installation Script
You need to run wp-admin/install.php to setup table structures in the database. Since we installed WordPress in the “blog” subdirectory, we should run the script from web browser as:
www.richbase.com/blog/wp-admin/install.php
The script will walk you through each step.
In the first step, you need to provide your website title and your email address. The email address must be valid since you will receive WordPress configuration information in this address.
The page in the last step provides you the administrator’s user name, password, and login page URL. Keep this information in safe place. The information looks like:
Username: admin
Password: ce3ef3
Login address: wp-login.php
The installation script can only be run once. If you run it again, you will see a message like:
“Already Installed - You appear to have already installed WordPress. To reinstall please clear your old database tables first.”
After that, you may test your website blog home page. In our installation, it is
www.richbase.com/blog/
How to Run WordPress Blog from Root Directory
You’ve installed WordPress in /blog subdirectory but you want run it from the root while still keep files in /blog folder. The easiest way to achieve this is:
First, copy “index.php” file from /blog folder on the web hosting to the root directory.
Then open and modify this file in the root directory. This file has only 4 lines. You only need to modify the path of the header file. So the modified file will look like:
<?php
/* Short and sweet */
define(’WP_USE_THEMES’, true);
require(’./blog/wp-blog-header.php’);
?>
More about Running WordPress Blog from Root Directory
After the above change, although you can start your blog home page from your website root URL, all of blog pages still carry the “/blog” sub-directory in the URL. If you really want to get rid of the subdirectory info in URL for all pages and still keep all of physical files in the /blog folder, you need to use Appache’s MOD_REWRITE feature and create a “.htaccess” file in the root folder. You also need to change the rewrite base for the /blog folder. That could be massey.
For more information on this matter, check Install WordPress in Subdirectory and Access It from Root.
Install WordPress in Website Root Directory
Considering certain search engine marketing advantages, we decided to move our WordPress from /blog sub-directory to the root. It is easy. Just copy all files and folders from /blog to the root, or upload the same files to the root directory via FTP.
Then you need to go to your web hosting’s control panel and drop all the tables in the database that you created for this WordPress website.
After that, you can run /wp-admin/install.php from root directory and follow the same steps. In our installation we need to run:
http://www.richbase.com/wp-admin/install.php
Now you can access you newly installed empty WordPress site from root URL such as
http://www.richbase.com
Since you dropped all the tables created by previous installation, everything you entered before gets lost. Thus if you have entered quite some postings, don’t drop the tables. Instead, create a new database or migrate the data first.
That’s it, you get your WordPress site up and running!
Comments
One Response to “Setup a WordPress Website”
Leave a Reply
great instructions!