软件准备
| 软件包 | 版本 | 大小 |
|---|---|---|
| lnmp1.7.tar.gz | 1.7 | 165kB |
| wordpress-4.7.3-zh_CN.zip | 4.7.3 | 8995KB |
| CentOS-7-x86_64-DVD-1511.iso | 1511 | 4.03GB |
运行lnmp包
[root@lnmp ~]# tar -zxvf lnmp1.7.tar.gz[root@lnmp ~]# cd lnmp1.7[root@lnmp lnmp1.7]# ./install.sh[root@lnmp lnmp1.7]# mysql -uroot -plnmp.org#16342mysql> create database wordpress;Query OK, 1 row affected (0.00 sec)mysql> grant all privileges on *.* to root@localhost identified by '000000' with grant option;Query OK, 0 rows affected (0.00 sec)mysql> grant all privileges on *.* to root@"%" identified by '000000' with grant option;Query OK, 0 rows affected (0.01 sec)mysql> exit[root@lnmp ~]# tar -zxvf wordpress-5.8-zh_CN.tar.gz[root@lnmp ~]# rm -rf /home/wwwroot/default/index.html[root@lnmp ~]# cp -rvf wordpress/* /home/wwwroot/default/[root@lnmp ~]# chmod 777 /home/wwwroot/default/*[root@lnmp ~]# cd /home/wwwroot/default/[root@lnmp ~]# cp wp-config-sample.php wp-config.php[root@lnmp ~]# vi wp-config.php/** The name of the database for WordPress */define( 'DB_NAME', 'wordpress' );/** MySQL database username */define( 'DB_USER', 'root' );/** MySQL database password */define( 'DB_PASSWORD', '000000' );/** MySQL hostname */define( 'DB_HOST', '192.168.100.10' );/** Database charset to use in creating database tables. */define( 'DB_CHARSET', 'utf8' );[root@lnmp default]# cd /usr/local/nginx/conf/vhost/[root@lnmp vhost]# mkdir qq[root@lnmp vhost]# mv default.conf load.conf proxy.conf ssl.conf test.com.conf qq[root@lnmp vhost]# vim qq.confserver{location ~ \.php$ {root /var/www/html;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;include fastcgi_params;}}

