From 75eb89e287e1d769a7a18b051b4f4a43b9c03821 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 12 Jun 2024 07:52:34 +0800 Subject: [PATCH 1/2] bj --- .../2024-6-11SSL\351\205\215\347\275\256.md" | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 "\351\231\206\345\260\217\350\220\215/2024-6-11SSL\351\205\215\347\275\256.md" diff --git "a/\351\231\206\345\260\217\350\220\215/2024-6-11SSL\351\205\215\347\275\256.md" "b/\351\231\206\345\260\217\350\220\215/2024-6-11SSL\351\205\215\347\275\256.md" new file mode 100644 index 0000000..3d0ed22 --- /dev/null +++ "b/\351\231\206\345\260\217\350\220\215/2024-6-11SSL\351\205\215\347\275\256.md" @@ -0,0 +1,49 @@ +#### 1.下载安全证书 + +要从证书颁发机构(CA)获取SSL证书和相应的私钥文件。 + +- **证书文件**(`.crt`或`.pem`) +- **私钥文件**(`.key`) +- **可能还包括**中间证书或链证书(如果有,通常为`.crt`) + +#### 2. 上传证书文件至服务器 + +使用FTP、SCP或其他方式,将上述文件上传到服务器。推荐存放在`/etc/nginx/ssl/`目录下,例如: + +Bash + +``` +mkdir /etc/nginx/ssl +``` + +上传后缀为.crt文件、后缀为.key文件到ssl目录下 + +#### 3. 修改Nginx配置 + +编辑Nginx的配置文件,通常位于`/etc/nginx/nginx.conf`或`/etc/nginx/sites-available/default`,或特定站点的配置文件,添加SSL配置。如果已有`listen 80;`配置段,您需要在新的`server`块中添加SSL监听: + +Nginx + +``` +server { + listen 443 ssl;//监听443端口 + server_name your_domain.com;绑定域名 + ssl_certificate /etc/nginx/ssl/your_cert.crt;//证书文件 + ssl_certificate_key /etc/nginx/ssl/your_key.key;//私钥文件 + root /var/www/oprototype.top; + index index.html; +``` + +#### 4. 重启Nginx服务 + +保存配置文件后,重启Nginx服务以应用更改: + +Bash + +``` +systemctl restart nginx +``` + +#### 5. 测试SSL配置 + +通过访问`https://your_domain.com`来测试SSL证书是否安装成功。 \ No newline at end of file -- Gitee From 05c01b9fd5737ca839282e36914d608c4e31f78b Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 13 Jun 2024 20:20:45 +0800 Subject: [PATCH 2/2] bj --- ...62\350\257\276\345\206\205\345\256\271.md" | 32 ++++++++++++++ ...62\350\257\276\345\206\205\345\256\271.md" | 44 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 "\351\231\206\345\260\217\350\220\215/2024-6-12\350\256\262\350\257\276\345\206\205\345\256\271.md" create mode 100644 "\351\231\206\345\260\217\350\220\215/2024-6-13\350\256\262\350\257\276\345\206\205\345\256\271.md" diff --git "a/\351\231\206\345\260\217\350\220\215/2024-6-12\350\256\262\350\257\276\345\206\205\345\256\271.md" "b/\351\231\206\345\260\217\350\220\215/2024-6-12\350\256\262\350\257\276\345\206\205\345\256\271.md" new file mode 100644 index 0000000..8cfe74f --- /dev/null +++ "b/\351\231\206\345\260\217\350\220\215/2024-6-12\350\256\262\350\257\276\345\206\205\345\256\271.md" @@ -0,0 +1,32 @@ +### 6-12讲课内容 + +#### Linux常见命令 + +``` +1.time:测量命令的执行时间 如:time ls; +2.date:显示或设置系统日期和时间; +3.timedatectl:查看和设置系统时间和日期,时区和NTP(网络时间协议)设置 如:timedatectl status; +4.reboot:重新启动系统 如:sudo reboot; +5.poweroff:关闭系统电源 如:sudo poweroff; +6.wget:从网络上下载文件 如:wget https://example.com/file.txt; +7.curl:从网络上获取或发送数据 如:curl -o https://example.com/file.txt; +8.ps:查看当前运行的进程 如:ps aux; +9.kill:终止进程 如 :kill 进程号;pidof进程名; +10.killall:向制定名称的所有进程发送信号 如:killall firefox; +11.ip:显示和操作网络接口和路由 +12.ss:显示套接字统计信息 如:ss -tuln # 查看哪些端口开发着; +13:uname:显示系统信息 如:uname -a; +14:uptime:显示系统运行时间和负载 ; +15:who:显示当前登录用户信息; +16:last:显示系统上最近的登录信息 +17:ping:测试网络连通性; +18:tracerroute:显示到达主机的路径; +19:history:显示命令历史记录; +20:free 和 df -h 是两个用于查看系统资源利用情况的常用命令; +21:du -h :查看当前目录的磁盘使用情况; + + + + +``` + diff --git "a/\351\231\206\345\260\217\350\220\215/2024-6-13\350\256\262\350\257\276\345\206\205\345\256\271.md" "b/\351\231\206\345\260\217\350\220\215/2024-6-13\350\256\262\350\257\276\345\206\205\345\256\271.md" new file mode 100644 index 0000000..baa0490 --- /dev/null +++ "b/\351\231\206\345\260\217\350\220\215/2024-6-13\350\256\262\350\257\276\345\206\205\345\256\271.md" @@ -0,0 +1,44 @@ +### 6-13讲课内容 + +#### 一、重定向和管道 + +##### 1.在Unix和Linux系统中,文件描述符用于表示打开的文件或者输入/输出符。 + +``` +常见文件描述符包括: +0 :标准输入:键盘输入 +1 :标准输出:直接显示在屏幕,不包含错误信息 +2 :标准错误:只包含错误信息 + 追加输出重定向 `>>` +使用形式:定向符前直接用数字,如1>1.txt ,2>2.txt; + 定向符后紧跟定向符并加&号 如 >&1; +``` + +##### 2.输入重定向 '<' + +- 将文件的内容作为命令的输入:例如:sort < unsorted_list.txt + + + +##### 3.错误输出追加重定向 ’2>>‘ + +- ls non_existent_file 2>> error_log.txt + +##### 4.同时重定向标准输出和标准错误输出‘&>’ + +- 使用 `&>` 符号将标准输出和错误输出同时重定向到同一个文件。 + +- ls hhh &> output_and_error_log.txt # 正确和错误原版混搭,原封不动 + + + +##### 5.管道符号 '|' 将一个命令的输出作为另一个命令的输入 + +- ls /home | grep "bb" | grep "3" + +##### 6.将错误输出丢弃 :命令 2> /dev/null + +##### 7.tee命令:从标准输入中读取数据,并同时将数据输出到标准输出和一个或多个文件中。 + +- echo "Hello, world" | tee output.txt:同时写入多个文件 +- echo "New data" | tee -a file1.txt:追加写入文件 \ No newline at end of file -- Gitee