-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/LyunKi/lyunki-blog-source
- Loading branch information
Showing
4 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
title: Docker学习 | ||
--- | ||
|
||
记录一些常用的 Docker 命令和知识 <!-- more --> | ||
|
||
要进入 Docker 中的 Nginx 容器,您可以在终端中使用 docker exec 命令。以下是如何操作的步骤: | ||
|
||
1. 打开您的终端或命令提示符。 | ||
|
||
2. 输入以下命令以列出系统上所有正在运行的 Docker 容器: | ||
|
||
``` | ||
docker ps | ||
``` | ||
|
||
3. 这将显示所有正在运行的容器列表,包括它们的名称和 ID。 | ||
|
||
从列表中找到您想要进入的 Nginx 容器的名称或 ID。 | ||
|
||
4. 要进入容器,请使用以下命令,在其中将 "container-name" 替换为您想要进入的容器的实际名称或 ID: | ||
|
||
```bash | ||
docker exec -it container-name /bin/bash | ||
``` | ||
|
||
-it 选项允许您交互式地进入容器并附加到其控制台。/bin/bash 是您想要在容器内运行的 shell 命令。 | ||
|
||
5. 进入容器后,您可以像在容器的命令行界面上一样运行任何命令。 | ||
|
||
6. 要退出容器,请输入 exit 或按下 CTRL + D。 | ||
|
||
注意:如果您在容器中运行的是不同的 shell(例如,是 sh 而不是 bash),请将 /bin/bash 替换为相应的 shell 命令。 | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: ES装饰器指南 | ||
--- | ||
|
||
网上看到的一篇比较好的装饰器指南,留存备份一下 <!-- more --> | ||
|
||
{% blockquote 装饰器指南: https://2ality.com/2022/10/javascript-decorators.html#class-auto-accessor-decorators/ %} | ||
适用于 **stage3** 后的 ES 装饰器 | ||
{% endblockquote %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
title: Nginx学习 | ||
--- | ||
|
||
记录一些常用的 Nginx 知识 <!-- more --> | ||
|
||
## Nginx 不同网站如何维护 | ||
|
||
在 Nginx 中,通常可以将不同网站的配置和静态文件存放在不同的目录下,这样可以使得 Nginx 配置更加清晰和易于维护。以下是一些常见的最佳实践: | ||
|
||
1. 将不同网站的配置文件存放在 `/etc/nginx/conf.d/` 目录下。可以为每个网站创建一个单独的配置文件,例如 `example.com.conf`、`blog.example.com.conf` 等,这样可以使得每个网站的配置更加独立和清晰。 | ||
|
||
2. 将不同网站的静态文件存放在 `/var/www/` 目录下。可以为每个网站创建一个单独的目录,例如 `/var/www/example.com/`、`/var/www/blog.example.com/` 等,将该网站的静态文件和资源放置在该目录下。 | ||
|
||
3. 在配置文件中使用 `include` 指令,将不同网站的配置文件和静态文件进行分离。例如,在 `/etc/nginx/nginx.conf` 文件中,可以使用以下指令引入所有的网站配置文件: | ||
|
||
``` | ||
http { | ||
# ... | ||
include /etc/nginx/conf.d/*.conf; | ||
} | ||
``` | ||
|
||
在每个网站的配置文件中,可以使用 `root` 指令设置该网站的静态文件目录,例如: | ||
|
||
``` | ||
server { | ||
listen 80; | ||
server_name example.com; | ||
root /var/www/example.com; | ||
# ... | ||
} | ||
``` | ||
|
||
这样可以将每个网站的静态文件和资源与其配置文件进行分离,并使得配置文件更加简洁和易于维护。 | ||
|
||
总之,最佳实践是将不同网站的配置文件和静态文件进行分离,以提高配置的可读性和可维护性。可以根据具体情况选择存放目录和文件命名方式,但应保持清晰和规范。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters