基于lnmp快速搭建wordpress平台

 

 [root@localhost ~]# wget -i -c http;//dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm

[root@localhost ~]# yum install mysql57-community-release-el7-10.noarch.rpm -y

[root@localhost ~]# yum install mysql-community-server -y

[root@localhost ~]# systemctl start mysqld

 [root@localhost ~]# grep "password" /var/log/mysqld.log

2020-10-14T09:08:20.216673Z 1 [Note] A temporary password is generated for root@localhost: dpdHfbGX-4-O

  4.登录mysql

  [root@localhost ~]# mysql -uroot -p
  Enter password:

mysql> alter user 'root'@'localhost' identified by 'lile@5201314';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)

mysql> set global validate_password_length=5;
Query OK, 0 rows affected (0.00 sec)

mysql> set password = password('000000');
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> alter user 'root'@'localhost' identified by 'lile@5201314';

 mysql> create database wordpress;            创建wordpress数据库
Query OK, 1 row affected (0.00 sec)

mysql> create user 'wordpress'@'localhost' identified by 'uK8F8cECIDvv';     创建wordpress用户
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on wordpress.* to 'wordpress'@'localhost';          给数据库授权
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;           
Query OK, 0 rows affected (0.00 sec)

安装nginx环境

[root@localhost ~]# yum install nginx -y

[root@localhost ~]# vim /etc/nginx/conf.d/wordpress.conf

server {
listen 80;
server_name www.test.com;
root /wordpress;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php index.php;
}
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

}

[root@localhost ~]# cp /etc/nginx/nginx.conf ./nginx.conf.bak

从第38行起删除以下内容

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
}

error_page 404 /404.html;
location = /404.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}

[root@localhost ~]# systemctl restart nginx
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

[root@localhost ~]# nginx -t

安装php环境

[root@localhost ~]# yum install -y php-fpm php-mysql

[root@localhost ~]# vim /etc/php-fpm.d/www.conf

 [root@localhost ~]# systemctl restart php-fpm

[root@localhost ~]# wget https://cn.wordpress.org/wordpress-4.7.2-zh_CN.tar.gz          下载wordpress源码包

[root@localhost ~]# tar xvf wordpress-4.7.2-zh_CN.tar.gz

[root@localhost ~]# mv wordpress /

[root@localhost ~]# cd /
[root@localhost /]# ls
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var wordpress

[root@localhost /]# chmod 775 wordpress/


[root@localhost /]# setenforce 0
[root@localhost /]# systemctl stop firewalld
[root@localhost /]# systemctl restart php-fpm
[root@localhost /]# systemctl restart nginx
[root@localhost /]# systemctl restart mysqld

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值