基于LNMP框架部署wordpress小网站

本文详细描述了如何通过yum安装Nginx和PHP,配置Nginx与PHP-FPM的关联,以及部署和上线WordPress项目的全过程,包括检查安装、启动服务和配置文件的管理。
摘要由CSDN通过智能技术生成
1、部署nginx

yum -y install nginx

2、启动nginx

nginx

3、检查是否安装成功

ss -nplt | grep 80

ps aux | grep nginx

部署nginx的详细过程,在前面的文章里有详细的过程。

4、部署php

yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm

yum -y install php74-php-xsl php74-php php74-php-cli php74-php-devel php74-php-gd php74-php-pdo php74-php-mysql php74-php-fpm

5、启动php

systemctl start php74-php-fpm

6、检查是否启动成功

ss -nplt | grep 9000

ps aux | grep php

7、nginx关联php

配置之前先备份配置文件

cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak

修改配置问价

vim +42 /etc/nginx/nginx.conf

[+42] : 进入配置文件后,光标就在42行处

将下面的语句添加。

index index.php index.html index.htm;

location ~ .php$ { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name; }

8、检查nginx配置文件的语法

nginx -t

9、重新加载配置文件

nginx -s reload

这是平缓加载配置文件,不用重启nginx,也能加载配置文件。

10、探测文件

vim /usr/share/nginx/html/index.php

<?php

phpinfo();

?>

我这个截图是部署项目完之后的截图,并不是测试页面。

11、项目上线

1、上传项目,这次项目用的包,我已经上传,感兴趣的可以下在去部署。

2、tar -xf wordpress-5.9.1-zh_CN.tar.gz

3、cp -r wordpress/* /usr/share/nginx/html/

  • 15
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值