WordPress

-----------

WordPress with Apache Web Server on CentOS

1. To install wordpress basic software requirement

# yum -y install httpd mariadb mariadb-server php php-common php-mysql php-gd php-xml php-mbstring php-mcrypt php-xmlrpc unzip wget

2. To configure mysql

# mysql_secure_installation

so you should just press enter here.

Enter current password for root (enter for none):

OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MySQL

root user without the proper authorisation.

Set root password? [Y/n] y

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

… Success!

Remove anonymous users? [Y/n] y

Disallow root login remotely? [Y/n] y

Remove test database and access to it? [Y/n] y

Reload privilege tables now? [Y/n] y

All done! If you’ve completed all of the above steps, your MySQL

installation should now be secure.

Thanks for using MySQL!

3. To Create database on mysql for wordpress

# mysql -u root -p

mysql> CREATE DATABASE wordpress;

mysql> GRANT ALL PRIVILEGES on wordpress.* to ‘wordpress’@’localhost’ IDENTIFIED BY ‘SECRET@123’;

mysql> FLUSH PRIVILEGES;

mysql> quit

4. To download wordpress file and configure

# cd /tmp/

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

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

# cd /var/www/html/wordpress

# cp wp-config-sample.php wp-config.php

# vi wp-config.php // Open a file and change as follow

define(‘DB_NAME’, ‘wordpress’);

define(‘DB_USER’, ‘wordpress’);

define(‘DB_PASSWORD’, ‘SECRET@123’);

5. To Create virtual host for wordpress

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

VirtualHost *:80>

ServerAdmin webmaster@lqs.co.in

DocumentRoot /var/www/html

ServerName lqs.co.in

ErrorLog /var/log/httpd/wordpress-error-log

CustomLog /var/log/httpd/wordpress-acces-log common

</VirtualHost>

6. To start/restart apache and mysql

# service httpd start

# service mysqld start

# chkconfig httpd on

# chkconfig mysqld on

or

# systemctl start httpd

# systemctl start mysqld

# systemctl enable httpd

# systemctl enable mysqld

7. To open your browser and hostname or IP address

http://ip-address or hostname

 

All the best !.  🙂

-----------