Installing WordPress 5.3.3 on CentOS 6.10
|
CentOS version
WordPress version
|
Web Server version
|
Step by step of Installing WordPress 5.3.3 on CentOS 6.10.
CentOS 6.10 Initial Configuration
- Connect to linux console using SSH
- Login using root username and password
- Tune SSH configuration
- vi /etc/ssh/sshd_config
- add “UseDNS no”
- service sshd restart
- vi /etc/ssh/sshd_config
- 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
- 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…)
- Virtual Machine Settings
- 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
- Remove persistent rules for error interface
- 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
- service network restart
Apache with PHP Installation and Configuration
- Apache with PHP Installation
- yum -y install httpd php php-mysql
- service httpd restart
- chkconfig httpd on
- 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
- iptables -L –line-numbers -n
- Create “PHPinfo” script
- vi /var/www/html/phpinfo.php
- <?php
- // Show all information, defaults to INFO_ALL
- echo(exec(“whoami”));
- phpinfo();
- ?>
- vi /var/www/html/phpinfo.php
- Show current firewall rules
- 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
- http://X.X.X.X/
MySQL Installation and Configuration
- MySQL installation
- yum -y install mysql-server
- service mysqld restart
- chkconfig mysqld on
- 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
- /usr/bin/mysql_secure_installation
- 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
- mysql -u root -p
- MySQL DB for WordPress test
- mysql -u <DB_USER> -p
- Enter password: ******
- mysql>
- SHOW DATABASES;
- <database pop-up>
- exit
- mysql -u <DB_USER> -p
WordPress Installation and Configuration
- 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”
- 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
- WordPress test
- http://A.B.C.D/
- Redirected to WP Admin Initial Page
- http://A.B.C.D/wp-admin/install.php
- http://A.B.C.D/
0 Comments