首页 > 其他 > 详细

lnmp快速搭建wordpress博客

时间:2021-05-05 21:57:18      阅读:42      评论:0      收藏:0      [点我收藏+]

技术分享图片

 技术分享图片

技术分享图片

 [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

技术分享图片

lnmp快速搭建wordpress博客

原文:https://www.cnblogs.com/insi2020/p/13816133.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!