Select Page

Installing WordPress 5.3.3 on CentOS 6.10

by | 25-Jan-2020 | Uncategorized

CentOS version

  • [root@web ~]# rpm -q centos-release
    centos-release-6-10.el6.centos.12.3.x86_64
  • [root@web ~]# cat /etc/centos-release
    CentOS release 6.10 (Final)

WordPress version

  • You are running WordPress 5.0~5.1.4
    WordPress 5.3.2 requires PHP 5.6.20+
  • You have Divi 3.18.3 installed
    Divi 4.2.2 requires WordPress 5.3.2 and PHP 7.2

Web Server version

  • [root@centos6 ~]# httpd -v
    Server version: Apache/2.2.15 (Unix)
    Server built: Jun 19 2018 15:45:13
  • [root@centos6 ~]# mysqladmin -V
    mysqladmin Ver 8.42 Distrib 5.1.73, for redhat-linux-gnu on x86_64
  • [root@centos6 ~]# php -v
    PHP 5.3.3 (cli) (built: Mar 22 2017 12:27:09)
    Copyright (c) 1997-2010 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Step by step of Installing WordPress 5.3.3 on CentOS 6.10.

CentOS 6.10 Initial Configuration

  1. Connect to linux console using SSH
    • Login using root username and password
  2. Tune SSH configuration
    • vi /etc/ssh/sshd_config
      • add “UseDNS no”
    • service sshd restart
  3. Install VMware Tools
    • VM > Install VMware Tools
    • mkdir /mnt/cdrom
    • mount /dev/cdrom /mnt/cdrom
    • cd /tmp
    • tar zxf /mnt/cdrom/VMwareTools-X.X.X-XXXXXXX.tar.gz
    • umount /dev/cdrom
    • cd vmware-tools-distrib
    • ./vmware-install.pl
  4. Add new ethernet interfaces (if required)
    • Virtual Machine Settings
      • Add “Network Adapter”
    • cd /etc/sysconfig/network-scripts/
      • uuidgen eth1
      • cp ifcfg-eth0 ifcfg-eth1
      • vi ifcfg-eth1
        • DEVICE=eth1
        • UUID=<from uuidgen>
        • HWADDR=<MAC from Network Adapter Advanced Settings>
        • IPADDR=X.X.X.X
        • PREFIX=XX
        • GATEWAY=X.X.X.X
        • DNS1=X.X.X.X
        • NAME=”System eth1″
      • ifdown eth1 && ifup eth1
    • Repeat for more interfaces (eth2, eth3, eth…)
  5. Fix modified interface error (if any)
    • Remove persistent rules for error interface
      • vi /etc/udev/rules.d/70-persistent-net.rules
      • Delete line with error interface
        • <…> NAME=”ethX”
      • Re-add network adapter
        • VM > Remove Network Adapter > OK
        • VM > Add Network Adapter > OK
      • Restart network services
        • service network restart
  6. Internet connection test
    • service network restart
      • [ OK ]
    • ping 8.8.8.8
      • 64 bytes from X.X.X.X icmp_seq=1 ttl=44 time=16.8 ms
    • ping www.google.com
      • 64 bytes from X.X.X.X icmp_seq=1 ttl=56 time=4.11 ms

 

Apache with PHP Installation and Configuration

  1. Apache with PHP Installation
    • yum -y install httpd php php-mysql
    • service httpd restart
    • chkconfig httpd on
  2. Apache with PHP Initial Configuration
    • Show current firewall rules
      • iptables -L -v -n | more
    • Setup firewall “allow HTTP”
      • iptables -L –line-numbers -n
        • iptables -I INPUT 1 -p tcp -m state –state NEW -m tcp –dport 80 -j ACCEPT
        • iptables -D INPUT 1
          iptables -I INPUT 1 -p tcp -d 192.168.201.68 -m state –state NEW -m tcp –dport 80 -j ACCEPT
      • /etc/init.d/iptables save
      • /etc/init.d/iptables reload
    • Create “PHPinfo” script
      • vi /var/www/html/phpinfo.php
        • <?php
        • // Show all information, defaults to INFO_ALL
        • echo(exec(“whoami”));
        • phpinfo();
        • ?>
  3. Web server test
    • http://X.X.X.X/
      • Apache 2 Test Page
    • http://X.X.X.X/phpinfo.php
      • <PHP user> PHP Version X.X.X

 

MySQL Installation and Configuration

  1. MySQL installation
    • yum -y install mysql-server
    • service mysqld restart
    • chkconfig mysqld on
  2. MySQL initial configuration
    • /usr/bin/mysql_secure_installation
      • Enter current password for root (enter for none): <press_enter>
      • Set root password? [Y/n] Y
      • New password: ******
      • Re-enter new password: ******
      • 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
  3. MySQL DB configuration for WordPress
    • mysql -u root -p
      • Enter password: ******
    • CREATE DATABASE <DB_NAME>;
      • SHOW DATABASES;
      • DROP DATABASE <DB_NAME>;
    • CREATE USER <DB_USER>;
      • SELECT User FROM mysql.user;
      • DROP USER <DB_USER>;
    • SET PASSWORD FOR <DB_USER>= PASSWORD(“<DB_USER_PASSWORD>”);
    • GRANT ALL PRIVILEGES ON <DB_NAME>.* TO “<DB_USER>”@”localhost” IDENTIFIED BY ‘<DB_USER_PASSWORD>’;
    • FLUSH PRIVILEGES;
    • exit
  4. MySQL DB for WordPress test
    • mysql -u <DB_USER> -p
      • Enter password: ******
      • mysql>
    • SHOW DATABASES;
      • <database pop-up>
    • exit

 

WordPress Installation and Configuration

  1. WordPress installation
    • cd /tmp/
    • wget http://wordpress.org/latest.tar.gz
    • tar -xzvf latest.tar.gz
    • mkdir /var/www/domain/ /var/www/domain/wordpress/
    • cp -r /tmp/wordpress/* /var/www/domain/wordpress/
    • chown -R apache: /var/www/domain/wordpress/
      • Solve “wordpress is unable to access filesystem directly, connection information is required”
  2. WordPress configuration
    • cd /var/www/domain/wordpress/
    • cp wp-config-sample.php wp-config.php
    • vi wp-config.php
      • define(‘AUTOMATIC_UPDATER_DISABLED’, true);
      • define(‘DB_NAME’, ‘<DB_NAME>’);
      • define(‘DB_USER’, ‘<DB_USER>’);
      • define(‘DB_PASSWORD’, ‘<DB_USER_PASSWORD>’);
    • Edit HTTPD config “vi /etc/httpd/conf/httpd.conf”
      • <Directory />
      • Options FollowSymLinks
      • AllowOverride All
      • </Directory>
    • Add HTTPD config “vi /etc/httpd/conf/httpd.conf”
      • NameVirtualHost A.B.C.D:80
      • <VirtualHost A.B.C.D:80>
      • ServerAdmin admin@domain.com
      • DocumentRoot /var/www/domain/wordpress/
      • ServerName www.domain.com
      • ErrorLog logs/www.domain.com-error_log
      • CustomLog logs/www.domain.com-access_log common
      • </VirtualHost>
    • service httpd reload
  3. WordPress test
    • http://A.B.C.D/
      • Redirected to WP Admin Initial Page
    • http://A.B.C.D/wp-admin/install.php

0 Comments

Submit a Comment

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