010、Python+fastapi,第一个后台管理项目走向第10步:ubutun 20.04下安装ngnix+mysql8+redis5环境

一、说明

先吐槽一下,ubuntu 界面还是不习惯,而且用的是云电脑,有些快捷键不好用,只能将就,谁叫我们穷呢?

正在思考怎么往后进行,突然发现没安装mysql 和redis,准备安装,而且配置个远程链接,主要是后续得把mysql导出来

二、安装ngnix

1、安装

sudo apt-get update

sudo apt install nginx 

一路yes

p3wr5zfyw:~$ systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:>
     Active: active (running) since Sat 2024-04-13 14:31:29 CST; 21s ago
       Docs: man:nginx(8)
   Main PID: 4339 (nginx)
      Tasks: 5 (limit: 9479)
     Memory: 5.7M
     CGroup: /system.slice/nginx.service
             ├─4339 nginx: master process /usr/sbin/nginx -g daemon on; master_>
             ├─4341 nginx: worker process
             ├─4342 nginx: worker process
             ├─4343 nginx: worker process
             └─4344 nginx: worker process

成功了吧
 

ps aux|grep nginx
root        4339  0.0  0.0  51432  1524 ?        Ss   14:31   0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data    4341  0.0  0.0  51852  5104 ?        S    14:31   0:00 nginx: worker process
www-data    4342  0.0  0.0  51852  5104 ?        S    14:31   0:00 nginx: worker process
www-data    4343  0.0  0.0  51852  5104 ?        S    14:31   0:00 nginx: worker process
www-data    4344  0.0  0.0  51852  5104 ?        S    14:31   0:00 nginx: worker process
jiangkp+    4909  0.0  0.0  12108   660 pts/0    S+   14:33   0:00 grep --color=auto nginx
 

2、修改配置文件

通常情况下,Nginx 的主配置文件位于 /etc/nginx/nginx.conf。而站点特定的配置文件通常位于 /etc/nginx/conf.d目录下。
要创建一个新的站点配置文件,可以在 /etc/nginx/conf.d/ 目录下创建一个新的文件,
例如 my_site.conf,官方配置文件已经读取了conf.d下所有后缀为conf的自定义配置文件。使用文本编辑器(
创建一个新文件

sudo vi /etc/nginx/conf.d/victor.conf

server {

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值