Spread the love

Install Modules  :-

# yum install httpd mysql mysql-server php php-common php-mysql php-gd php-xml php-mbstring php-mcrypt

#  mysql_secure_installation

Create a mysql password

Download the latest wordpress file from below location: –


https://wordpress.org/download/

# tar -xzvf latest.tar.gz

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

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 “Password”;

# Create New Database ##

create database wordpress;

# Grant Privileges to Database ##

GRANT ALL ON wordpress.* TO wordpress@localhost;

# FLUSH privileges ##

FLUSH PRIVILEGES;

## Exit ##

Exit

Creating Apache VirtualHost for WordPress

# 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 magazie

DocumentRoot /var/www/html/wordpress

ServerName magazie

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 start; chkconfig httpd on

# service mysqld start; chkconfig mysqld on

Add the following line to /etc/hosts file.

127.0.0.1 magazie

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’, ‘ WordPress ‘);

/** MySQL database username */

define(‘DB_USER’, ‘WordPress ‘);

/** MySQL database password */

define(‘DB_PASSWORD’, “Password’);

/** 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’, ”);

Finishing Word Press Installation

http://localhost

 

Word Press installation using apache/httpd step by step

Leave a Reply

Your email address will not be published. Required fields are marked *