阿里云搭建lnmp的wordpress

wordpress的sakurairo主题

apt -y install git
git clone https://github.com/mirai-mamori/Sakurairo.git

wordpress下载

下载 | WordPress.org China 简体中文

wget https://cn.wordpress.org/latest-zh_CN.tar.gz
tar xf latest-zh_CN.tar.gz
​

将主题移到/var/www/html/wp-content/themes/下

lnmp配置

ubuntu系统配置

apt  -y install mysql-server php php-fpm php-mysql nginx

mysql

mysql登录

mysql
create user wordpress@'localhost' identified by '123456';
create database wordpress;
grant all on wordpress.* to wordpress@'localhost';

nginx配置

root@ubuntu:/etc/nginx/conf.d# vim www.conf 
​
server {
    listen 80;
    listen 443 ssl;
server {
    listen 80;
    listen 443 ssl;
server {
    listen 80;
    listen 443 ssl;
    ssl_certificate /data/ssl/7459769_www.myisdzx.top.pem;       #ssl认证文件路径
    ssl_certificate_key /data/ssl/7459769_www.myisdzx.top.key;    #ssl认证文件路径
    ssl_session_cache shared:sslcache:20m;
    ssl_session_timeout 10m;
    server_name www.myisdzx.top;
    root /var/www/html;                              #webj文件跟目录
    index index.php
    client_max_body_size 200M;
    location / {
      if ( $scheme = http ) {
        rewrite ^/(.*)$ https://www.myisdzx.top/$1 redirect;
        }
        root /var/www/html;
    }
​
    #location / {
    #    rewrite ^/(.*)$ https://$host/$1 redirect;
    #}
    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;
    }
    location ~ ^/(ping|fpm_status)$ {
        fastcgi_pass 127.0.0.1:9000;                  #php连接端口
        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
​
}

配置php-fpm

vim /etc/php/7.4/fpm/pool.d/www.conf 
;listen = /run/php/php7.4-fpm.sock
listen = 127.0.0.1:9000
​
​
systemctl restart php7.4-fpm.service
​

报错处理

2022/03/22 15:04:25 [warn] 38012#38012: conflicting server name "www.myisdzx.top" on 0.0.0.0:80, ignored

处理方法;

netstat -natulp

看看是不是apach2打开了

apt -y remove apach2
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值