Build LAMP wordpress quickly in CentOS 7
LAMP is the standard for the classic and quick deployment of Internet applications. It is short for Linux + Apache + Mysql + PHP. Previously, I wrote about LAMP build based on CentOS6 and yum. This article mainly describes how to install WordPress under the CentOS7 architecture for your reference.
For more information about how to build CentOS 6, see:
Install and configure the LAMP platform in yum mode in Linux 6
Compile, install, and configure the LAMP platform in Linux 6
1. Install LAMP
Current Environment [root @ centos7-web ~] # More/etc/redhat-release CentOS Linux release 7.2.1511 (Core) install httpd, php, mariadb Based on yum [root @ centos7-web ~] # Yum install httpd-y [root @ centos7-web ~] # Yum install php-mysql-y [root @ centos7-web ~] # Yum install mariadb-server-y verification related installation package [root @ centos7-web ~] # Rpm-qa | grep httpdhttpd-2.4.6-40.el7.centos.x86_64httpd-tools-2.4.6-40.el7.centos.x86_64 [root @ centos7-web ~] # Rpm-qa | grep phpphp-cli-5.4.16-36.el7_1.x86_64php-mysql-5.4.16-36.el7_1.x86_64php-common-5.4.16-36.el7_1.x86_64php-pdo-5.4.16-36.el7_1.x86_64php-5.4.16-36.el7_1.x86_64 [root @ centos7-web ~] # Rpm-qa | grep mariamariadb-libs-5.5.44-2.el7.centos.x86_64mariadb-server-5.5.44-2.el7.centos.x86_64mariadb-5.5.44-2.el7.centos.x86_64 startup and verification httpd [root @ centos7-web ~] # Systemctl start httpd [root @ centos7-web ~] # Ss-nltp | grep httpdLISTEN 0 128: 80 :::: * users :( ("httpd", pid = 120703, fd = 4), ("httpd ", pid = 120702, fd = 4), ("httpd", pid = 120701, fd = 4), ("httpd", pid = 120700, fd = 4 ), ("httpd", pid = 120699, fd = 4), ("httpd", pid = 120688, fd = 4) [root @ centos7-web ~] # Echo "This is a httpd test page.">/var/www/html/index.html [root @ centos7-web ~] # Curl http://localhostThis Is a httpd test page. Start and validate mariadb [root @ centos7-web ~] # Rpm-ql mariadb-server | grep service/usr/lib/systemd/system/mariadb. service [root @ centos7-web ~] # Systemctl start mariadb. service [root @ centos7-web ~] # MysqlWelcome to the MariaDB monitor. commands end with; or \ g. your MariaDB connection id is 2 Server version: 5.5.44-MariaDB ServerCopyright (c) 2000,201 5, Oracle, MariaDB Corporation AB and others. type 'help; 'or' \ H' for help. type '\ C' to clear the current input statement. mariaDB [(none)]> show variables like 'version'; + --------------- + ---------------- + | Variable_name | Value | + ------ --------- + ---------------- + | Version | 5.5.44-MariaDB | + --------------- + ---------------- + 1 row in set (0.00 sec) MariaDB [(none)]> show databases; + -------------------- + | Database | + -------------------- + | information_schema | mysql | performance_schema | test | + ------------------ + 4 rows in set (0.00 sec) MariaDB [(none)]> exitBye test PHP because PHP is loaded to httpd in modular mode, you do not need to start and set PHP separately. The following shows that the php5 module and rewr have been loaded. Ite module [root @ centos7-web ~] # Httpd-M | grep phpphp5_module (shared) [root @ centos7-web ~] # Httpd-M | grep rewriterewrite_module (shared) [root @ centos7-web ~] # Echo "
Ii. install and configure wordpress [Root @ centos7-web ~] # Cd/usr/local/src [root @ centos7-web src] # ls-hltrtotal 8.3M-rw-r -- 1 root 8.3 M Sep 22 wordpress-4.8.1-zh_CN.tar.gz [root @ centos7-web src] # tar-xf wordpress-4.8.1-zh_CN.tar.gz [root @ centos7-web src] # cp-R wordpress/var/www/html/[root @ centos7-web ~] # Cp/var/www/html/wordpress/wp-config-sample.php/var/www/html/wordpress/wp-config.php [root @ centos7-web ~] # Vim/var/www/html/wordpress/wp-config.php ### mainly configure the Database NAME and user password/** WordPress database NAME */define ('db _ name ', 'wpdb');/** MySQL database username */define ('db _ user', 'wpadmin '); /** MySQL Database PASSWORD */define ('db _ password', 'pass');/** MySQL HOST */define ('db _ host ', 'localhost');/** default text encoding when creating a data table */define ('db _ charset', 'utf8');/** database sorting type. If you are not sure, do not change */define ('db _ collate', ''); Create a wordpress database and user [root @ centos7-web ~] # MysqlMariaDB [(none)]> create database wpdb character set utf8; Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> grant all privileges on wpdb. * to 'wpadmin' @ 'localhost' identified by 'pass'; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> flush privileges; Query OK, 0 rows affected( 0.00 sec)
Configure wordpress open a browser to complete wordpress Configuration
After installing wordpress, you can log on to the background management panel
Home Page