How to Install WordPress Blog on CentOS 5.5

WordPress is an open source blog tool and publishing platform powered by PHP and MySQL. It can be install on Windows server or Linux server. It is the famous Content Management System (CMS) and it has many features including the plug-in that can make your blog look modern and powerful.Below are the simple steps to install the wordpress blog on CentOS server. This tutorial assume that you already installed LAMP ( Linux, Apache, Mysql and PHP) server.

1.Go t your web server root directory.

    [root@server ~]# cd /var/www
    

2. Download the latest wordpress using wget command:

    [root@server www]# wget http://wordpress.org/latest.tar.gz
    

3.  Extract the compressed archives with below command:

    [root@server www]# tar xzvf latest.tar.gz
    

4. The extracted file name will be wordpress. Rename it to anything you want. Normally we put it blog since your url will be like this:
http://servername/blog

    root@server www]# cp wordpress blog
    

5. Create the Database and database user:

    mysql> CREATE DATABASE blogdb;
    Query OK, 1 row affected (0.00 sec)
    
    mysql> CREATE USER 'bloguser'@'localhost' IDENTIFIED BY 'blogpassword';
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> GRANT ALL PRIVILEGES ON blogdb.* to bloguser@localhost;
    Query OK, 0 rows affected (0.00 sec)
    

6. Navigate the browser to http://servername/blog

There doesn’t seem to be a wp-config.php file. I need this before we can get started. Need more help? We got it. You can create a wp-config.php file through a web interface, but this doesn’t work for all server setups. The safest way is to manually create the file.

Click “Create a Configuration File”

7. You will be redirect to WordPress > Setup Configuration File:

Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.

  • Database name = any_db (User define as  step 5)
  • Database username = any_user (User define as step 5)
  • Database password = any_password (User define as step 5)
  • Database host = localhost (if apache and mysql on the same server)
  • Table prefix (if you want to run more than one WordPress in a single database)

Click Let’s Go! to proceed

8. Fill in below form and Click Submit

  • Database name = blogdb
  • Database username = bloguser
  • Database password = blogpassword
  • Database host = localhost
  • Table prefix = wp_

You will be redirect to this page. Please leave the page and proceed below steps.

Sorry, but I can’t write the wp-config.php file.
You can create the wp-config.php manually and paste the following text into it.

9. Go to your web server terminal or ssh to web server. Copy and rename wp-config-sample.php to wp-config.php:

    [root@server ~]# cp /var/www/blog/wp-config-sample.php /var/www/blog/wp-config.php
    

10. Modify the wp-config.php:

    root@server ~]# vi /var/www/blog/wp-config.php
    

Change below line to above:

    /** The name of the database for WordPress = Line 19 */
    define('DB_NAME', 'database_name_here');
    
    /** MySQL database username = Line 22 */
    define('DB_USER', 'username_here');
    
    /** MySQL database password = Line 25 */
    define('DB_PASSWORD', 'password_here');
    
    /** MySQL hostname = Line 28 */
    define('DB_HOST', 'localhost');
    

Save the wp-config.php file and exit from web server

11. Continue to this URL:
http://servername/blog/wp-admin/setup-config.php?step=2

Click “Run the install”

12. Please complete the form Click “Install WordPress”

  • Site Title : Blog Title
  • Username : Prefered username
  • Password, twice : Your password
  • Your E-mail : Your Email

13. To login Navigate the browser to http://servername/blog/wp-login.php

How to Create Google Custom Search in Thesis WordPress Theme

This Steps will guide you how to install Google Custom Search on thesis wordpress theme. It will create the Custom Search on the top right of Navigation Menu page.

1. In your browser go to http://www.google.com/cse/

2. Go to AdSense Setup -> Get Ads -> Click AdSense for Search -> proceed to create search code unit until you get “Search Box Code” and “Search Box Code”.

Search Box Code
Paste this code in the page where you’d like your search box to appear.

Search Results Code
Paste this code on http://www.myblogxxxx.com/search or where you would like your search results to appear. This page must manually created by your self.

3. Add “Search Box Code” in custom_functions.php

4. Paste “Search Results Code” into http://www.myblogxxxx.com/search

5. Add this in custom editor, Custom/custom.css

    .custom #custom_search {
    	float:right;
    	margin-right:2em;
    	position:relative;
    	padding:0.818em 0 0.818em 0;
    }
    

How to Automatically Show Thumbnail in Thesis WordPress Theme

In the thesis theme, we can customize the post image and thumbnail but it need manual work. It is easy if all these things can be done automatically using existing wordpress plugin and modified a bit in custom.css file. Please follow below steps to enable this feature automatically on your blog post.

1. Install the “Thumbnails for Excerpt” Plugin

  • Login to Dashboard, on the plugin menu, click Add New. Search for “Thumbnail For Excerpts”. Then Install the Plugin


2. Configure the “Thumbnails for Excerpt” Plugin

  • Login to Dashboard, on the Setting menu, “Click Thumbnail Excerpts”


3. Add code to Custom File Editor under Thesis Menu Item

  • Login to Dashboard, on the Thesis menu, Click Custom File Editor. It will show you the currently editing: custom/custom.css then add below code at the bottom.
    /* Teaser Thumbnail Image Styling */
    .custom .teaser img {
    
    /* Add Frame to the thumbnail Image, use "border:none;" to disable border. */
    border:5px solid #F2F2F2;
    
    /* Specify the height of the Thumbnail Image*/
    height:150px;
    
    /* Adds margin space to the thumbnail Image. */
    margin:2px 10px 0 0;
    
    /* Specify the width of the Thumbnail Image. */
    width:150px;
    
    }