一、LNMP搭建wordpress(单机版)
[root@web1 ~]# yum install -y gcc openssl-devel pcre-devel
[root@web1 ~]# useradd -s /sbin/nologin nginx
[root@web1 ~]# tar -xf nginx-1.11.2.tar.gz
[root@web1 ~]# cd nginx-1.11.2/
[root@web1 nginx-1.11.2]# ./configure --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module
[root@web1 nginx-1.11.2]# make && make install
[root@web1 nginx-1.11.2]# yum install -y php php-mysql php-fpm
[root@web1 nginx-1.11.2]# yum install -y mariadb mariadb-server mariadb-devel
[root@web1 nginx-1.11.2]# /usr/local/nginx/sbin/nginx
[root@web1 nginx-1.11.2]# systemctl start mariadb
[root@web1 nginx-1.11.2]# systemctl enable mariadb
[root@web1 nginx-1.11.2]# systemctl start php-fpm
[root@web1 nginx-1.11.2]# systemctl enable php-fpm
[root@web1 nginx-1.11.2]# cd /root/
[root@web1 ~]# vim /usr/local/nginx/conf/nginx.conf
server {
listen 80;
server_name www.work.com;
location / {
root html;
index index.php index.html index.htm;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
}
[root@web1 ~]# /usr/local/nginx/sbin/nginx -s reload
[root@web1 ~]# mysql
MariaDB [(none)]> create database wordpress character set utf8mb4;
MariaDB [(none)]> grant all on wordpress.* to wordpress@'localhost' identified by 'wordpress';
MariaDB [(none)]> grant all on wordpress.* to wordpress@'192.168.2.11' identified by 'wordpress';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit
[root@web1 ~]# yum install -y wget
[root@web1 ~]# wget https://cn.wordpress.org/wordpress-4.8-zh_CN.zip
[root@web1 ~]# yum install -y unzip
[root@w