一、说明
先吐槽一下,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 {