Thursday, November 28, 2013

how to Install wordpress Using LAMP or LEMP on RHEL, CentOS & Fedora

I will show you’ll how to install latestWordPress 3.7 on RHEL 6.4/6.3/6.2/6.1/6/5.8CentOS 6.4/6.3/6.2/6.1/6/5.8 and Fedora 19,18,17,16,15,14,13,12 distributions.


Wordpress


 


Install WordPress 3.7 on RHEL 6.4/6.3/6.2/6.1/6/5.8CentOS 6.4/6.3/6.2/6.1/6/5.8 and Fedora 19,18,17,16,15,14,13,12

Method A: Installing WordPress 3.7 for Apache on RHEL, CentOS & Fedora


This Method A installation guide shows you how to install latest WordPress 3.7 using LAMP setup on RHEL 6.4/6.3/6.2/6.1/6/5.8CentOS 6.4/6.3/6.2/6.1/6/5.8 and Fedora 19,18,17,16,15,14,13,12.


Step 1: Downloading WordPress 3.7 for Apache


You must be root user to download the package.


# cd /tmp
# wget http://wordpress.org/latest.tar.gz

Step 2: Extracting WordPress 3.7 for Apache


Once the download finishes, run the following command to untar it.


# tar -xvzf latest.tar.gz -C /var/www/html

Step 3: Creating MySQL Database WordPress


Connect to MySQL server and run the following commands to create database and grant privileges.


## Connect to MySQL Server & Enter Password (if any or leave blank)## 
mysql -u root -p
Enter password:

## Creating New User for WordPress Database ##
CREATE USER wordpress@localhost IDENTIFIED BY "your_password_here";

## Create New Database ##
create database wordpress;

## Grant Privileges to Database ##
GRANT ALL ON wordpress.* TO wordpress@localhost;

## FLUSH privileges ##
FLUSH PRIVILEGES;

## Exit ##
exit

 


Please replace text a shown in Red color with your appropriate Database NameUser andPassword. These settings we will required later.


Step 4: Creating Apache VirtualHost for WordPress


Open the file /etc/httpd/conf/httpd.conf with VI editor.


# vi /etc/httpd/conf/httpd.conf

Add the following lines of code at the bottom of the file. Replace the text shown in Red color with your required settings.


<VirtualHost *:80>
ServerAdmin tecmint@tecmint.com
DocumentRoot /var/www/html/wordpress
ServerName wordpress
ErrorLog /var/log/httpd/wordpress-error-log
CustomLog /var/log/httpd/wordpress-acces-log common
</VirtualHost>

Next, restart the Apache service to reflect changes.


# service httpd restart

 


Add the following line to /etc/hosts file.


127.0.0.1 wordpress

 


Step 5: Configuring WordPress Installation


Copy default wp-config-sample.php to wp-config.php to configure WordPress installation.


# cd /var/www/html/wordpress
# cp wp-config-sample.php wp-config.php

 


Open wp-config.php file.


# vi wp-config.php

 


Modify the following database settings as we created in the Step #3 above.


// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');

/** MySQL database username */
define('DB_USER', 'username_here');

/** MySQL database password */
define('DB_PASSWORD', 'password_here');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

 


Step 6: Finishing WordPress Installation


Open your browser and type any of the following address.


http://wordpress/

http://localhost


http://your-ip

 


Now Install your wordpress


 


 


 


 


Another Method: Installing WordPress 3.** for Nginx on RHEL, CentOS & Fedora


Step 1: Creating WordPress Directories for Nginx


# mkdir -p /srv/www/wordpress/public_html
# mkdir /srv/www/wordpress/logs
# chown -R nginx:nginx /srv/www/wordpress

 


Step 2: Downloading and Extracting WordPress 3.7 for Nginx


cd /tmp
# wget http://wordpress.org/latest.tar.gz
# tar -xvzf latest.tar.gz -C /srv/www/wordpress/public_html --strip-components=1

Step 3: Creating MySQL Database WordPress

Connect to MySQL server and run the following commands to create database and grant privileges.

## Connect to MySQL Server & Enter Password (if any or leave blank)##
mysql -u root -p
Enter password:

## Creating New User for WordPress Database ##
CREATE USER wordpress@localhost IDENTIFIED BY "your_password_here";

## Create New Database ##
create database wordpress;

## Grant Privileges to Database ##
GRANT ALL ON wordpress.* TO wordpress@localhost;

## FLUSH privileges ##
FLUSH PRIVILEGES;

## Exit ##
exit

 


Please replace text a shown in Red color with your appropriate Database NameUser andPassword. These settings we will required later.


Step 4: Creating Nginx VirtualHost For WordPress


If you’ve followed our LEMP guide these directories are already created. In case, if not then please create it by running these commands.


# mkdir /etc/nginx/sites-available
# mkdir /etc/nginx/sites-enabled

 


Add the following line of code to /etc/nginx/nginx.conf file, After the line that says “include /etc/nginx/conf.d/*.conf.


include /etc/nginx/sites-enabled/*;

 


Next create Nginx virtualhost file for WordPress.


# vi /etc/nginx/sites-available/wordpress

 


Add the following content to /etc/nginx/sites-available/wordpress file.


server png

 


Create symlink for sites enabled directory.


# cd /etc/nginx/sites-enabled/
# ln -s /etc/nginx/sites-available/wordpress

 


Restart the Nginx server to reflect changes.


# service nginx restart

 


Add the following line to /etc/hosts file.


127.0.0.1 wordpress

 


Step 5: Configuring WordPress Installation


Copy default wp-config-sample.php to wp-config.php to configure WordPress installation.


# cd /srv/www/wordpress/public_html
# cp wp-config-sample.php wp-config.php

 


Modify the following database settings as we created in the Step #3 above.


// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');

/** MySQL database username */
define('DB_USER', 'username_here');

/** MySQL database password */
define('DB_PASSWORD', 'password_here');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

No install your WordPress .


 



how to Install wordpress Using LAMP or LEMP on RHEL, CentOS & Fedora

1 comment:

  1. It feels great to feature much revealing and unequalled articles on your websites.
    premium wordpress themes

    ReplyDelete