Nginx 发布Web项目
2021/12/8 7:20:10
本文主要是介绍Nginx 发布Web项目,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
1、准备Web项目资源包
2、在CentOS服务器上创建存放项目的相关目录
$ cd /home/ $ mkdir toutiao
3、通过终端sftp,将Web资源包上传到,/home/toutiao/
sftp -P 端口 用户@服务器IP 示例: sftp -P 8081 user@192.168.20.249 >sftp cd /home/toutiao/ >sftp put /路径/案例一.zip
4、通过终端命令,解压上传到服务器上资源包
cd /home/toutiao/ unzip 案例一
解压包如下:
5、配置Nginx,在etc/nginx/conf.d/目录下修改 nginx.conf配置
6、修改/etc/selinux/config目录下SELINUX的状态,
将SELINUX=enforcing 修改为 SELINUX=disabled 状态
vi /etc/selinux/config #SELINUX=enforcing SELINUX=disabled
重启生效。reboot。
7、重启nginx
$ sudo systemctl enable nginx # 设置开机启动 $ sudo service nginx start # 启动 nginx 服务 $ sudo service nginx stop # 停止 nginx 服务 $ sudo service nginx restart # 重启 nginx 服务 $ sudo service nginx reload # 重新加载配置,一般是在修改过 nginx 配置文件时使用。
8、测试,在浏览器上输入ip地址,进行测试。
这篇关于Nginx 发布Web项目的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-03-29fail2ban nginx
- 2024-03-18install nginx proxy manager
- 2024-01-2444从零开始用Rust编写nginx,命令行参数的设计与解析及说明
- 2024-01-22比Nginx更好用的Gateway!
- 2024-01-17nginx daemon off
- 2023-12-30Nginx Vhost Traffic Status 是什么意思-icode9专业技术文章分享
- 2023-12-26使用nginx搭建creates.io镜像(稀疏索引)
- 2023-11-18centos7编译安装Nginx教程。
- 2023-11-02nginx启动命令和停止命令
- 2023-10-25Centos7系统Nginx负载均衡如何安装和配置?