云原生(四十八) | Nginx软件安装部署
文章目录
Nginx软件安装部署
一、Nginx软件部署步骤
二、安装与配置Nginx
Nginx软件安装部署
一、Nginx软件部署步骤
第一步:安装 Nginx 软件
第二步:把 Nginx 服务添加到开机启动项
第三步:配置 Nginx
第四步:启动Nginx
二、安装与配置Nginx
安装Nginx软件:
yum install nginx
把Nginx服务添加到开机启动项
systemctl enable nginx
配置Nginx
vim /etc/nginx/nginx.confserver {listen 80;listen [::]:80;server_name localhost;root /web/wordpress;include /etc/nginx/default.d/*.conf;location / {index index.php index.htm index.html;}location ~ \.php$ {fastcgi_pass 127.0.0.1:9000; # PHP-FPM 默认监听的地址和端口fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;include fastcgi_params;}...}
配置完成后,启动Nginx
systemctl start nginx
- 📢博客主页:https://lansonli.blog.csdn.net
- 📢欢迎点赞 👍 收藏 ⭐留言 📝 如有错误敬请指正!
- 📢本文由 Lansonli 原创,首发于 CSDN博客🙉
- 📢停下休息的时候不要忘了别人还在奔跑,希望大家抓紧时间学习,全力奔赴更美好的生活✨