Skip to content

Commit

Permalink
update articles
Browse files Browse the repository at this point in the history
  • Loading branch information
mobeicanyue committed May 2, 2024
1 parent 89450aa commit 7189eaa
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 106 deletions.
3 changes: 1 addition & 2 deletions source/_posts/Caddy-installation-and-usage-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ Nginx 是一个被广泛使用的 Web 服务器,但是它的配置相对 Caddy
输入以下命令安装 Caddy:
```bash
sudo apt update
sudo apt install caddy
sudo apt install caddy -y
```
系统会提示是否安装,`回车` 或输入 `Y` 确认安装。

安装完成后,可以使用以下命令检查 Caddy 的版本:
```bash
Expand Down
90 changes: 0 additions & 90 deletions source/_posts/Compress-deploy-code-size.md

This file was deleted.

2 changes: 1 addition & 1 deletion source/_posts/Deploy-a-springboot-project-to-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ deb-src http://deb.debian.org/debian testing bookworm main contrib non-free non-

输入以下命令安装 `mariadb` 数据库:
```bash
sudo apt install mariadb-server
sudo apt install mariadb-server -y
```

### 4.3 配置数据库
Expand Down
26 changes: 24 additions & 2 deletions source/_posts/Deploying-a-Web-Disk-of-Your-Own.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ docker exec -it alist ./alist admin set NEW_PASSWORD
2. 添加存储:
左边栏点击 `存储`,然后点击`添加`,驱动选择 `本机存储`,点击`添加`

1. `挂载路径`填写 `/`,意味着这次添加的存储为 `网盘根目录`。往下滑,找到 `根文件夹路径`,也就是文件的存储路径。
3. `挂载路径`填写 `/`,意味着这次添加的存储为 `网盘根目录`。往下滑,找到 `根文件夹路径`,也就是文件的存储路径。
如果你是 **一键脚本安装** 的,就填写 `/opt/alist/files`;
如果你是 **docker-compose 安装** 的,就填 `/opt/alist/data/files`。(注意,这个是容器内的映射路径,不是宿主机的路径,参考前文的 `volumes` 配置)

Expand All @@ -140,6 +140,28 @@ docker exec -it alist ./alist admin set NEW_PASSWORD
2. 保存索引后,单击构建索引来构建索引;
3. 现在你可以通过点击页面右上角的搜索块或使用快捷键 Ctrl + K 来搜索文件。

## 4. 高级配置
## 4. 更新 Alist

### 4.1 `1Panel` 一键安装

打开 `1Panel` 面板,点击 `应用商店`,点击 `可升级`,找到 `Alist`,点击 `升级` 即可。

### 4.2 一键脚本安装

```bash
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s update
```

### 4.3 docker-compose 安装

```bash
docker-compose pull
docker-compose up -d
```

### 4.4 手动安装

下载最新版本的 Alist,解压后替换原有文件即可。

## 5. 高级配置
更多高级配置请参照官网 https://alist.nn.ci/zh/guide/
4 changes: 2 additions & 2 deletions source/_posts/Fail2ban-installation-and-usage-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ tags:
以 Debian/Ubuntu 为例,使用以下命令安装 Fail2ban:
```bash
sudo apt update
sudo apt install fail2ban
sudo apt install fail2ban -y
```

需要特别注意的是,Debian 12 及以上的版本需要手动安装 `rsyslog` 来保证其正常运行:
```bash
sudo apt install rsyslog
sudo apt install rsyslog -y
```
原因见:[Github Issue](https://github.com/fail2ban/fail2ban/issues/3292)

Expand Down
29 changes: 24 additions & 5 deletions source/_posts/How-to-Deploy-a-new-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ date: 2024-03-01 22:25:20

我曾经也是一个新手,在部署服务器的时候遇到很多问题,不管屏幕前的你是出于何种目的:比如有业务搭建的需要;还是初入运维的小白;或者只是单纯的想折腾。我希望这篇文章大部分人看完后都能有所收获。

本文将会介绍如何部署一台新的服务器。本文 4~7 节内容是关于服务器的安全配置,如果你只是想要部署一个简单的网站,阅读前 3 节即可。
本文将会介绍如何部署一台新的服务器。本文 4~7 节内容是关于服务器的安全配置,如果你只是想要部署一个简单的网站,阅读前 3 节即可。**文末还有一键脚本,可以帮助你快速部署服务器,详情跳到最后一节。**
{% endnote %}

## 0. 基础的 Web 知识
Expand Down Expand Up @@ -58,6 +58,8 @@ date: 2024-03-01 22:25:20

而在 Linux 中,又有很多发行版,比如 Ubuntu、CentOS(近几年争议较多 不建议选择)、Debian、Fedora 等等。本文选择 **`Debian`** 作为演示,它是是最受欢迎的 Linux 发行版之一 Ubuntu 的上游,是一个非常稳定和可靠的操作系统,也通常被认为比 Ubuntu 更轻量级,因为它不包含太多附加的软件。

一般服务器提供商都会提供多种系统,你可以根据自己的需求来选择。

### 0.2 什么是域名及 DNS?

购买了一台服务器之后,服务器供应商 会提供给我们服务器的 IP 地址如 `8.8.8.8`,我们可以通过这个 IP 地址来访问我们的服务器。
Expand Down Expand Up @@ -164,7 +166,7 @@ timedatectl
如果你是 Debian 12,那么你可以使用 `systemd-timesyncd` 来同步服务器时间。
输入以下命令来安装 `systemd-timesyncd`
```bash
sudo apt install systemd-timesyncd
sudo apt install systemd-timesyncd -y
```

查看 `systemd-timesyncd` 的状态:
Expand All @@ -186,7 +188,7 @@ sudo systemctl start systemd-timesyncd

输入以下命令来安装 `ntp`
```bash
sudo apt install ntp
sudo apt install ntp -y
```

查看 `ntp` 的状态:
Expand Down Expand Up @@ -364,7 +366,7 @@ RedHat/CentOS 系统可以选择 `firewalld` 防火墙,而 Debian/Ubuntu 系

```bash
sudo apt update
sudo apt install ufw
sudo apt install ufw -y
```

### 5.4 启用 ufw
Expand Down Expand Up @@ -408,8 +410,25 @@ sudo sysctl -p

Fail2Ban 是一个入侵检测系统框架,它可以监控服务器的日志文件,当发现有暴力破解行为时,会自动封禁攻击者的 IP 地址。可以保护电脑服务器免受暴力破解。它用 Python 编写。能够在具有本地安装的数据包控制系统或防火墙(如 iptables)接口的 POSIX 系统上运行。

## 8. 一键脚本
本文所讲述的内容我整理成了一键脚本,可以帮助你快速部署服务器,包括设置时区、安装 Web 服务器、SSH 安全配置、防火墙配置、禁用 ping、配置 Fail2ban 等等。 **`在使用前请最好先阅读脚本内容,以免造成不必要的损失`** 你可以根据自己的需求修改脚本内容。目前支持 Debian 12, Ubuntu 22.04

使用方法:
```bash
wget https://raw.githubusercontent.com/mobeicanyue/init-server/main/init-server.sh
sudo bash init-server.sh
```
如果你的服务器无法访问 GitHub,可以使用 jsDelivr 加速访问:
```bash
wget https://cdn.jsdelivr.net/gh/mobeicanyue/init-server/init-server.sh
sudo bash init-server.sh
```

<br><br>

本文如有错误或者不足之处,欢迎指正。

<br><br><br>
<br><br>


[^1]: https://help.aliyun.com/zh/ecs/ssh-service-introduction
Expand Down
3 changes: 1 addition & 2 deletions source/_posts/Nginx-installation-and-usage-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ Nginx 是一个高性能的开源 Web 服务器,也可以作为反向代理服
输入以下命令安装 Nginx:
```bash
sudo apt update
sudo apt install nginx
sudo apt install nginx -y
```
系统会提示是否安装,`回车` 或输入 `Y` 确认安装。

安装完成后,可以使用以下命令检查 Nginx 的版本:
```bash
Expand Down
1 change: 0 additions & 1 deletion source/_posts/Tutorial-of-Building-a-blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ tags:
- {% post_link Use-lxgw-wenkai-in-fluid '如何在博客中使用霞鹜文楷字体' %}

### 博客优化
- {% post_link Compress-deploy-code-size '压缩部署的代码' %}
- {% post_link Blog-seo-optimization '博客 SEO 优化' %}
2 changes: 1 addition & 1 deletion source/_posts/Umami-installation-and-usage-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ yarn start

{% endfold %}

{% fold info @dokcer-compose 安装 %}
{% fold info @docker-compose 安装 %}
下载官方的 docker-compose.yml 文件:
https://github.com/umami-software/umami/blob/master/docker-compose.yml

Expand Down

0 comments on commit 7189eaa

Please sign in to comment.