From eaf5df8c0f4db83dafeb5a7c96c8decbabedbeb0 Mon Sep 17 00:00:00 2001 From: Aaron Chen Date: Mon, 24 Jul 2023 21:27:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=9B=AE=E5=BD=95=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vuepress/config.js | 50 +++++++++++++++++-- docs/README.md | 2 +- docs/freeswitch/README.md | 1 + ...FreeSWITCH为系统服务.md => debian-service.md} | 8 +-- ...ian11安装FreeSWITCH1.10.md => debian11.md} | 12 ++--- docs/freeswitch/fail2ban.md | 4 +- docs/freeswitch/ubuntu1604.md | 2 +- docs/php/README.md | 1 + 8 files changed, 61 insertions(+), 19 deletions(-) create mode 100644 docs/freeswitch/README.md rename docs/freeswitch/{Debian11中注册FreeSWITCH为系统服务.md => debian-service.md} (91%) rename docs/freeswitch/{Debian11安装FreeSWITCH1.10.md => debian11.md} (95%) create mode 100644 docs/php/README.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 5c6d499..52edf6e 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -22,22 +22,62 @@ module.exports = { displayAllHeaders: false, nav: [ { text: '首页', link: '/' }, - { text: 'FreeSWITCH', link: '/freeswitch/ubuntu1604' }, - { text: 'PHP', link: '/php/php82' } + { text: 'FreeSWITCH', link: '/freeswitch/' }, + { text: 'PHP', link: '/php/' } ], sidebar: { '/freeswitch/': [ - 'ubuntu1604', - 'fail2ban' + '../', + '', + { + title: '安装', // 必要的 + collapsable: true, // 可选的, 默认值是 true, + sidebarDepth: 1, // 可选的, 默认值是 1 + children: [ + '/freeswitch/debian11', + '/freeswitch/debian-service', + '/freeswitch/ubuntu1604' + ] + }, + { + title: '安全', // 必要的 + collapsable: true, // 可选的, 默认值是 true, + sidebarDepth: 1, // 可选的, 默认值是 1 + children: [ + '/freeswitch/fail2ban' + ] + } ], '/php/': [ + '../', + '', 'nginx', 'openresty', 'php82' ], '/': [ '', - 'freeswitch/ubuntu1604' + { + title: 'FreeSWITCH相关', // 必要的 + collapsable: false, // 可选的, 默认值是 true, + sidebarDepth: 1, // 可选的, 默认值是 1 + children: [ + '/freeswitch/debian11', + '/freeswitch/debian-service', + '/freeswitch/ubuntu1604', + '/freeswitch/fail2ban' + ] + }, + { + title: 'PHP相关', // 必要的 + collapsable: false, // 可选的, 默认值是 true, + sidebarDepth: 1, // 可选的, 默认值是 1 + children: [ + '/php/nginx', + '/php/openresty', + '/php/php82' + ] + }, ] }, }, diff --git a/docs/README.md b/docs/README.md index 2ea095e..b861fbe 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# 关于FreeSWITCH及其相关技术的文档 +# 首页 这里包含了由PHP程序员创建的技术文档,主要记录在做与FreeSWITCH相关的开发过程中所遇到的问题、技能、知识、方法等内容。 diff --git a/docs/freeswitch/README.md b/docs/freeswitch/README.md new file mode 100644 index 0000000..8f1ea78 --- /dev/null +++ b/docs/freeswitch/README.md @@ -0,0 +1 @@ +# FreeSWITCH相关 diff --git a/docs/freeswitch/Debian11中注册FreeSWITCH为系统服务.md b/docs/freeswitch/debian-service.md similarity index 91% rename from docs/freeswitch/Debian11中注册FreeSWITCH为系统服务.md rename to docs/freeswitch/debian-service.md index dc3ac02..236ac6f 100644 --- a/docs/freeswitch/Debian11中注册FreeSWITCH为系统服务.md +++ b/docs/freeswitch/debian-service.md @@ -1,10 +1,10 @@ -## Debian11中注册FreeSWITCH为系统服务 +# Debian11中注册FreeSWITCH为系统服务 Debian 11使用了systemd作为启动管理器,而不再使用sysvinit,所以我们不去`/etc/init.d/`目录中去搞,而是在`/etc/systemd/system/`里面搞。 假设FreeSWITCH的安装目录是`/usr/local/freeswitch`。 -### 创建freeswitch.service文件 +## 创建freeswitch.service文件 ```sh touch /etc/systemd/system/freeswitch.service @@ -36,7 +36,7 @@ WantedBy=default.target 保存`freeswitch.service`文件并退出。 -### 创建freeswitch启动用户和组 +## 创建freeswitch启动用户和组 ```sh ## 创建freeswith用户组 @@ -47,7 +47,7 @@ useradd -r -g freeswitch -s /bin/false -d /usr/local/freeswitch -c "FreeSWITCH" sudo chown -R freeswitch:freeswitch /usr/local/freeswitch ``` -### 注册系统服务并实现开机自启 +## 注册系统服务并实现开机自启 ```sh ## 注册freeswitch服务 diff --git a/docs/freeswitch/Debian11安装FreeSWITCH1.10.md b/docs/freeswitch/debian11.md similarity index 95% rename from docs/freeswitch/Debian11安装FreeSWITCH1.10.md rename to docs/freeswitch/debian11.md index eaf0d76..3c1969c 100644 --- a/docs/freeswitch/Debian11安装FreeSWITCH1.10.md +++ b/docs/freeswitch/debian11.md @@ -1,10 +1,10 @@ -## 在Debian11中编译安装FreeSWITCH1.10 +# 在Debian11中编译安装FreeSWITCH1.10 > wandoubaba / 2023-01-15 本文以Debian11和FreeSWITCH1.10为例,介绍一步一步编译安装FreeSWITCH的方法。 -### 先下载/克隆各种资源 +## 先下载/克隆各种资源 ```shell # 假设所有资源都下载到/opt/目录下 @@ -23,7 +23,7 @@ git clone https://github.com/signalwire/signalwire-c > 国内连接github很累,另外不保证各资源仓库以后更新后对应的操作方法是否会变,建议资源下载成功后自己留一份备份 -### 一步一步安装 +## 一步一步安装 > 如果后面的操作是在root账号下,就不需要再用sudo了 @@ -91,7 +91,7 @@ make moh-install cd .. ``` -### 启动FreeSWITCH服务 +## 启动FreeSWITCH服务 执行以上步骤后,FreeSWITCH已经被安装到/usr/local/freeswitch目录下了。 @@ -103,7 +103,7 @@ bin/freeswitch 等待一段时间后,FreeSWITCH服务就已经成功启动了,在当前控制台输入命令`sofia status`可以看到一点配置信息。前台启动方式非常简单,但是一旦执行`...`命令退出控制台后,对应的FreeSWITCH服务也就退出了。如果想在后台启动服务,在执行`bin/freeswitch`时后面加上`-nc`命令参数就可以了。 -### 做freeswitch和fs_cli的软连接 +## 做freeswitch和fs_cli的软连接 ```shell ln -sf /usr/local/freeswitch/bin/freeswitch /usr/local/bin/ @@ -112,7 +112,7 @@ ln -sf /usr/local/freeswitch/bin/fs_cli /usr/local/bin/ 做完这一步操作后,就可以在任意目录下执行freeswitch地fs_cli命令了(但是要注意freeswitch的运行目录的相对路径问题)。 -### 配置.fs_cli_conf文件 +## 配置.fs_cli_conf文件 fs_cli的本质也是通过esl连接去控制FreeSWITCH,所以如果对FreeSWITCH做配置时更改了event_socket的端口号、密码等内容时,再使用fs_cli工具时就需要在后面加上各种复杂的参数,为了简化操作,我们可以配置一个名为.fs_cli_conf的文件,在里面写好FreeSWITCH的esl相关参数,以后就可以直接执行fs_cli命令进入到FreeSWITCH控制台了。 diff --git a/docs/freeswitch/fail2ban.md b/docs/freeswitch/fail2ban.md index 0ca2245..31d18ff 100644 --- a/docs/freeswitch/fail2ban.md +++ b/docs/freeswitch/fail2ban.md @@ -1,8 +1,8 @@ -# 【安全】使用fail2ban自动拦截向FreeSWITCH发起恶意注册的IP地址 +# 使用fail2ban自动拦截向FreeSWITCH发起恶意注册的IP地址 > wandoubaba / 2023-07-10 -通常情况了,如果我们的FreeSWITCH应用是面向互联网开放的话,就要对互联网开放SIP端口,那么就避免不了来自一些“不友善”的IP发来的尝试SIP注册的请求,我们往往会在FreeSWITCH的日志中看到类似这下面这样的信息: +通常情况下,如果我们的FreeSWITCH应用是面向互联网开放的话,就要对互联网开放SIP端口,那么就避免不了来自一些“不友善”的IP发来的尝试SIP注册的请求,我们往往会在FreeSWITCH的日志中看到类似这下面这样的信息: ```log 2023-07-10 19:12:35.902557 98.23% [WARNING] sofia_reg.c:3211 Can't find user [8001@192.168.0.112] from 194.61.28.102 diff --git a/docs/freeswitch/ubuntu1604.md b/docs/freeswitch/ubuntu1604.md index 5844350..f42cb00 100644 --- a/docs/freeswitch/ubuntu1604.md +++ b/docs/freeswitch/ubuntu1604.md @@ -1,4 +1,4 @@ -# 【安装】在ubuntu16.04系统上安装freeswitch1.6 +# 在ubuntu16.04系统上安装freeswitch1.6 ## 操作系统和软件版本 diff --git a/docs/php/README.md b/docs/php/README.md new file mode 100644 index 0000000..3024ec6 --- /dev/null +++ b/docs/php/README.md @@ -0,0 +1 @@ +# PHP相关