First look yum update source
yum makecache
Install apache:
1. Check whether Apache installed (CentOS in a package called httpd)
yum info httpd
2. If you install uninstall
yum remove -y "httpd*"
3. Install Apache
yum -y install httpd
4. Run and set from the start
systemctl start httpd
systemctl enable httpd
systemctl status httpd
Installation MariaDB (alternatively the mysql):
1. Check whether the installation mariadb
yum info mariadb
yum info mariadb-server
2. Uninstall mariadb already installed
yum remove -y "mariadb*"
3. Install mariadb
yum -y install mariadb mariadb-server
4. Run the self-starting and set mariadb
systemctl start mariadb
systemctl enable mariadb
systemctl status mariadb
5. mysql database initialization
mysql_secure_installation
Then there will be a command line interface, information can be set according to actual needs
Installing PHP
1. check whether they have installed
yum info php
2. If you have already installed the uninstallation
yum remove -y "php*"
3. Install the necessary libraries and php
yum -y install php
yum -y install php-common php-cli php-gd php-pdo php-develf
yum -y install php-xml php-json php-mysqlnd php-bcmath
So far, LAMP will build a good environment, the next step is to deploy Wordpress
Wordpress installation
First, download the tarball from wordpress official website, here we use the 5.3.2 version (wordpress-5.3.2.tar.gz)
1. Extract (high tar version will automatically select Extract parameter is omitted here)
tar -xvf wordpress-5.3.2.tar.gz -C /var/www/html
2. Adjust your wordpress directory and user groups
chown -R apache:apache /var/www/html/wordpress
3. Adjust the directory permissions
chmod -R 755 /var/www/html/wordpress
4.wordpress need to use the database, and now to add an account and create a database mysql
#按照提示输入密码即可登录数据库
mysql -uroot -p
#创建用户,注意username和password分别替换为需要的用户名和密码
#host表示允许访问的主机地址,使用localhost表示只允许本地访问,使用%通配一切远程主机
CREATE USER 'username'@'host' IDENTIFIED BY 'password';
#赋予账号权限, .通配所有权限
GRANT ALL PRIVILEGES ON *.* TO ‘username’@‘%’ IDENTIFIED BY 'password’;
#修改成功后
quit
5. After accessing the server, to follow the installation of the guide wordpress
If prompted no wp-config.php , you can modify the catalog next to wordpress wordpress-config-sample.php the related field is replaced with the actual use of the information, the file is renamed after the wp-config.php
Add in change at the contents of the file to enable debugging:
# Enable debugging features
define( 'WP_DEBUG', true );
# Output debugging information
define( 'WP_DEBUG_LOG', true );
# Show debugging information
define('WP_DEBUG_DISPLAY', true);