Compare commits
2
Commits
9b79ff6203
...
e2bbe1a478
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2bbe1a478 | ||
|
|
2ccdfcfe42 |
@@ -1,67 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# 设置变量
|
|
||||||
EMAIL="AAAA"
|
|
||||||
API_KEY="BBBB"
|
|
||||||
ZONE_ID="CCCC"
|
|
||||||
LOAD_THRESHOLD=5.0 # 设置高负载阈值
|
|
||||||
|
|
||||||
TELEGRAM_BOT_TOKEN="输入TG机器人API"
|
|
||||||
CHAT_ID="输入TG用户ID"
|
|
||||||
|
|
||||||
|
|
||||||
# 获取当前系统负载
|
|
||||||
CURRENT_LOAD=$(uptime | awk -F'load average:' '{ print $2 }' | cut -d, -f1 | awk '{print $1}')
|
|
||||||
|
|
||||||
echo "当前系统负载: $CURRENT_LOAD"
|
|
||||||
|
|
||||||
|
|
||||||
send_tg_notification() {
|
|
||||||
local MESSAGE=$1
|
|
||||||
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" -d "chat_id=$CHAT_ID" -d "text=$MESSAGE"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 获取当前的“Under Attack”模式状态
|
|
||||||
STATUS=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/settings/security_level" \
|
|
||||||
-H "X-Auth-Email: $EMAIL" \
|
|
||||||
-H "X-Auth-Key: $API_KEY" \
|
|
||||||
-H "Content-Type: application/json" | jq -r '.result.value')
|
|
||||||
|
|
||||||
echo "当前的Under Attack模式状态: $STATUS"
|
|
||||||
|
|
||||||
# 检查系统负载是否高于阈值
|
|
||||||
if (( $(echo "$CURRENT_LOAD > $LOAD_THRESHOLD" | bc -l) )); then
|
|
||||||
if [ "$STATUS" != "under_attack" ]; then
|
|
||||||
echo "系统负载高于阈值,开启Under Attack模式"
|
|
||||||
# send_tg_notification "系统负载高于阈值,开启Under Attack模式"
|
|
||||||
NEW_STATUS="under_attack"
|
|
||||||
else
|
|
||||||
echo "系统负载高,但Under Attack模式已经开启"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if [ "$STATUS" == "under_attack" ]; then
|
|
||||||
echo "系统负载低于阈值,关闭Under Attack模式"
|
|
||||||
# send_tg_notification "系统负载低于阈值,关闭Under Attack模式"
|
|
||||||
NEW_STATUS="high"
|
|
||||||
else
|
|
||||||
echo "系统负载低,Under Attack模式已经关闭"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 更新“Under Attack”模式状态
|
|
||||||
RESPONSE=$(curl -s -X PATCH "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/settings/security_level" \
|
|
||||||
-H "X-Auth-Email: $EMAIL" \
|
|
||||||
-H "X-Auth-Key: $API_KEY" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
--data "{\"value\":\"$NEW_STATUS\"}")
|
|
||||||
|
|
||||||
if [[ $(echo $RESPONSE | jq -r '.success') == "true" ]]; then
|
|
||||||
echo "成功更新Under Attack模式状态为: $NEW_STATUS"
|
|
||||||
else
|
|
||||||
echo "更新Under Attack模式状态失败"
|
|
||||||
echo "响应: $RESPONSE"
|
|
||||||
fi
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
"bind": "0.0.0.0:8181",
|
|
||||||
"tls": {
|
|
||||||
"enabled": false,
|
|
||||||
"cert_file": "",
|
|
||||||
"key_file": ""
|
|
||||||
},
|
|
||||||
"timeout": 600,
|
|
||||||
"proxy_url": "",
|
|
||||||
"license_id": "github",
|
|
||||||
"public_share": false,
|
|
||||||
"site_password": "",
|
|
||||||
"setup_password": "webgptpasswd",
|
|
||||||
"server_tokens": true,
|
|
||||||
"proxy_api_prefix": "",
|
|
||||||
"isolated_conv_title": "*",
|
|
||||||
"disable_signup": false,
|
|
||||||
"auto_conv_arkose": false,
|
|
||||||
"proxy_file_service": false,
|
|
||||||
"custom_doh_host": "",
|
|
||||||
"captcha": {
|
|
||||||
"provider": "",
|
|
||||||
"site_key": "",
|
|
||||||
"site_secret": "",
|
|
||||||
"site_login": false,
|
|
||||||
"setup_login": false,
|
|
||||||
"oai_username": false,
|
|
||||||
"oai_password": false,
|
|
||||||
"oai_signup": false
|
|
||||||
},
|
|
||||||
"whitelist": null
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"test-1": {
|
|
||||||
"token": "access token / session token / refresh token",
|
|
||||||
"shared": true,
|
|
||||||
"show_user_info": false
|
|
||||||
},
|
|
||||||
"test-2": {
|
|
||||||
"token": "access token / session token / refresh token",
|
|
||||||
"shared": true,
|
|
||||||
"show_user_info": true,
|
|
||||||
"plus": true
|
|
||||||
},
|
|
||||||
"test2": {
|
|
||||||
"token": "access token / session token / refresh token / share token / username & password",
|
|
||||||
"password": "12345"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# 科技lion一键脚本工具
|
# 科技lion一键脚本工具
|
||||||
|
|
||||||
## 介绍
|
## 介绍
|
||||||
科技Lion 的 Shell 脚本工具是一款全能脚本工具箱,专为 VPS 监控、测试和管理而设计。无论您是初学者还是经验丰富的用户,该工具都能为您提供便捷的解决方案。集成了独创的 Docker 管理功能,让您轻松管理容器化应用;LNMP建站解决方案 能帮助您快速搭建网站,站点优化,防御,备份还原迁移一应俱全;并且整合了各类系统工具面板的安装及使用,使系统维护变得更加简单。我们的目标是成为全网最优秀的 VPS 一键脚本工具,为用户提供高效、便捷的科技支持。
|
科技Lion 的 Shell 脚本工具是一款面向 Linux VPS 的交互式管理工具箱,聚焦系统信息与维护、Docker 基础管理、网络测试与调优、SSH 安全防护、Telegram 监控通知、tmux 后台工作区和 VPS 集群批量运维。无论您是初学者还是经验丰富的用户,都可以通过菜单快速执行常见服务器管理任务。
|
||||||
[视频介绍](https://www.youtube.com/watch?v=0o7oH3Dit70&t=211s)
|
[视频介绍](https://www.youtube.com/watch?v=0o7oH3Dit70&t=211s)
|
||||||
***
|
***
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 获取登录信息
|
|
||||||
country=$(curl -s ipinfo.io/$public_ip/country)
|
|
||||||
isp_info=$(curl -s ipinfo.io/org | sed -e 's/\"//g' | awk -F' ' '{print $2}')
|
|
||||||
|
|
||||||
ipv4_address=$(curl -s ipv4.ip.sb)
|
|
||||||
masked_ip=$(echo $ipv4_address | awk -F'.' '{print "*."$3"."$4}')
|
|
||||||
|
|
||||||
|
|
||||||
IP=$(echo $SSH_CONNECTION | awk '{print $1}')
|
|
||||||
TIME=$(date +"%Y年%m月%d日 %H:%M:%S")
|
|
||||||
# 查询IP地址对应的地区信息
|
|
||||||
#LOCATION=$(curl -s https://ipapi.co/$IP/json/ | jq -r '.city')
|
|
||||||
LOCATION=$(curl -s "http://opendata.baidu.com/api.php?query=$IP&co=&resource_id=6006&oe=utf8&format=json" | jq -r '.data[0].location')
|
|
||||||
# 获取当前用户名
|
|
||||||
USERNAME=$(whoami)
|
|
||||||
# 发送Telegram消息
|
|
||||||
MESSAGE="ℹ️ 登录信息:
|
|
||||||
登录机器:${isp_info}-${country}-${masked_ip}
|
|
||||||
登录名:$USERNAME
|
|
||||||
登录IP:$IP
|
|
||||||
登录时间:$TIME
|
|
||||||
登录地区:$LOCATION"
|
|
||||||
|
|
||||||
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" -d "chat_id=$CHAT_ID&text=$MESSAGE" > /dev/null 2>&1
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# 你需要配置Telegram Bot Token和Chat ID
|
|
||||||
TELEGRAM_BOT_TOKEN="输入TG的机器人API"
|
|
||||||
CHAT_ID="输入TG的接收通知的账号ID"
|
|
||||||
|
|
||||||
|
|
||||||
# 你可以修改监控阈值设置
|
|
||||||
CPU_THRESHOLD=70
|
|
||||||
MEMORY_THRESHOLD=70
|
|
||||||
DISK_THRESHOLD=70
|
|
||||||
NETWORK_THRESHOLD_GB=1000
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 获取设备信息的变量
|
|
||||||
country=$(curl -s ipinfo.io/$public_ip/country)
|
|
||||||
isp_info=$(curl -s ipinfo.io/org | sed -e 's/\"//g' | awk -F' ' '{print $2}')
|
|
||||||
|
|
||||||
ipv4_address=$(curl -s ipv4.ip.sb)
|
|
||||||
masked_ip=$(echo $ipv4_address | awk -F'.' '{print "*."$3"."$4}')
|
|
||||||
|
|
||||||
# 发送Telegram通知的函数
|
|
||||||
send_tg_notification() {
|
|
||||||
local MESSAGE=$1
|
|
||||||
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" -d "chat_id=$CHAT_ID" -d "text=$MESSAGE"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# 获取CPU使用率
|
|
||||||
get_cpu_usage() {
|
|
||||||
awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else printf "%.0f\n", (($2+$4-u1) * 100 / (t-t1))}' \
|
|
||||||
<(grep 'cpu ' /proc/stat) <(sleep 1; grep 'cpu ' /proc/stat)
|
|
||||||
}
|
|
||||||
|
|
||||||
# 获取内存使用率
|
|
||||||
get_memory_usage() {
|
|
||||||
free | awk '/Mem/ {printf("%.0f"), $3/$2 * 100}'
|
|
||||||
}
|
|
||||||
|
|
||||||
# 获取硬盘使用率
|
|
||||||
get_disk_usage() {
|
|
||||||
df / | awk 'NR==2 {print $5}' | sed 's/%//'
|
|
||||||
}
|
|
||||||
|
|
||||||
# 获取总的接收流量(字节数)
|
|
||||||
get_rx_bytes() {
|
|
||||||
awk 'BEGIN { rx_total = 0 }
|
|
||||||
NR > 2 { rx_total += $2 }
|
|
||||||
END {
|
|
||||||
printf("%.2f", rx_total / (1024 * 1024 * 1024));
|
|
||||||
}' /proc/net/dev
|
|
||||||
}
|
|
||||||
|
|
||||||
# 获取总的发送流量(字节数)
|
|
||||||
get_tx_bytes() {
|
|
||||||
awk 'BEGIN { tx_total = 0 }
|
|
||||||
NR > 2 { tx_total += $10 }
|
|
||||||
END {
|
|
||||||
printf("%.2f", tx_total / (1024 * 1024 * 1024));
|
|
||||||
}' /proc/net/dev
|
|
||||||
}
|
|
||||||
|
|
||||||
# 检查并发送通知
|
|
||||||
check_and_notify() {
|
|
||||||
local USAGE=$1
|
|
||||||
local TYPE=$2
|
|
||||||
local THRESHOLD=$3
|
|
||||||
local CURRENT_VALUE=$4
|
|
||||||
|
|
||||||
if (( $(echo "$USAGE > $THRESHOLD" | bc -l) )); then
|
|
||||||
send_tg_notification "警告: ${isp_info}-${country}-${masked_ip} 的 $TYPE 使用率已达到 $USAGE%,超过阈值 $THRESHOLD%。"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# 主循环
|
|
||||||
while true; do
|
|
||||||
CPU_USAGE=$(get_cpu_usage)
|
|
||||||
MEMORY_USAGE=$(get_memory_usage)
|
|
||||||
DISK_USAGE=$(get_disk_usage)
|
|
||||||
RX_GB=$(get_rx_bytes)
|
|
||||||
TX_GB=$(get_tx_bytes)
|
|
||||||
|
|
||||||
check_and_notify $CPU_USAGE "CPU" $CPU_THRESHOLD $CPU_USAGE
|
|
||||||
check_and_notify $MEMORY_USAGE "内存" $MEMORY_THRESHOLD $MEMORY_USAGE
|
|
||||||
check_and_notify $DISK_USAGE "硬盘" $DISK_THRESHOLD $DISK_USAGE
|
|
||||||
|
|
||||||
# 检查入站流量是否超过阈值
|
|
||||||
if (( $(echo "$RX_GB > $NETWORK_THRESHOLD_GB" | bc -l) )); then
|
|
||||||
send_tg_notification "警告: ${isp_info}-${country}-${masked_ip} 的入站流量已达到 ${RX_GB}GB,超过阈值 ${NETWORK_THRESHOLD_GB}GB。"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 检查出站流量是否超过阈值
|
|
||||||
if (( $(echo "$TX_GB > $NETWORK_THRESHOLD_GB" | bc -l) )); then
|
|
||||||
send_tg_notification "警告: ${isp_info}-${country}-${masked_ip} 的出站流量已达到 ${TX_GB}GB,超过阈值 ${NETWORK_THRESHOLD_GB}GB。"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 休眠5分钟
|
|
||||||
sleep 300
|
|
||||||
done
|
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
本项目是一套面向 **Linux VPS 的交互式服务器管理脚本工具箱**,核心程序是 `kejilion.sh`。当前功能聚焦于系统管理、网络测试与调优、安全防护、流量限额控制和 VPS 集群运维。
|
||||||
|
|
||||||
|
## 1. VPS 系统管理
|
||||||
|
|
||||||
|
- 查看 CPU、内存、Swap、磁盘、流量和系统负载
|
||||||
|
- 查看操作系统、内核、主机名、IP、运营商和地理位置
|
||||||
|
- 查看 TCP 拥塞算法、系统时间及运行时长
|
||||||
|
- 更新系统、清理系统垃圾
|
||||||
|
- 修改主机名、时区、DNS 和登录密码
|
||||||
|
- 管理 Swap、用户和 sudo 权限
|
||||||
|
- IPv4/IPv6 优先级切换
|
||||||
|
- 查看端口占用
|
||||||
|
- 管理 `/etc/hosts`
|
||||||
|
- 管理 Crontab 定时任务
|
||||||
|
- 重启服务器
|
||||||
|
|
||||||
|
## 2. 网络与 VPS 测试
|
||||||
|
|
||||||
|
- WARP 管理
|
||||||
|
- ChatGPT 解锁测试
|
||||||
|
- 流媒体解锁检测
|
||||||
|
- IP 质量检测
|
||||||
|
- 三网回程路由测试
|
||||||
|
- MTR 线路测试
|
||||||
|
- NextTrace 路由测试
|
||||||
|
- SuperSpeed 和多功能测速
|
||||||
|
- YABS 性能测试
|
||||||
|
- Geekbench 5 CPU 测试
|
||||||
|
- Bench 综合测试
|
||||||
|
- 融合怪综合测评
|
||||||
|
|
||||||
|
## 3. 网络加速与系统调优
|
||||||
|
|
||||||
|
- 开启或关闭 BBR
|
||||||
|
- BBRv3/XanMod 内核管理
|
||||||
|
- 设置 Swap
|
||||||
|
- 配置国内或国外 DNS
|
||||||
|
- 优化时区和系统软件
|
||||||
|
|
||||||
|
## 4. 安全防护
|
||||||
|
|
||||||
|
### SSH Fail2Ban
|
||||||
|
|
||||||
|
- SSH 防暴力破解
|
||||||
|
- 查看 SSH 封禁状态和拦截记录
|
||||||
|
- 实时查看 Fail2Ban 日志
|
||||||
|
- 安装或卸载 SSH 防护
|
||||||
|
|
||||||
|
相关配置文件:`sshd.local`
|
||||||
|
|
||||||
|
### 账户安全
|
||||||
|
|
||||||
|
- 用户管理
|
||||||
|
- 用户和密码生成
|
||||||
|
- 登录密码管理
|
||||||
|
|
||||||
|
## 5. 流量限额自动关机
|
||||||
|
|
||||||
|
- 设置每月流量额度
|
||||||
|
- 定期统计接收和发送流量
|
||||||
|
- 达到阈值后自动关机
|
||||||
|
- 每月重新开始统计
|
||||||
|
- 支持启用和停用
|
||||||
|
|
||||||
|
相关文件:`Limiting_Shut_down.sh`
|
||||||
|
|
||||||
|
## 6. VPS 集群批量管理
|
||||||
|
|
||||||
|
可以维护多台服务器列表,并批量执行:
|
||||||
|
|
||||||
|
- 安装本项目脚本
|
||||||
|
- 更新或清理系统
|
||||||
|
- 安装 BBR3
|
||||||
|
- 设置 Swap 和时区
|
||||||
|
- 开放端口
|
||||||
|
- 执行自定义命令
|
||||||
|
- 导入或导出服务器列表
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
总体而言,这个项目可以概括为:
|
||||||
|
|
||||||
|
> **VPS 系统管理 + 网络测试与调优 + SSH 安全防护 + 流量限额控制 + 集群运维。**
|
||||||
|
|
||||||
|
部分功能会在运行时从 GitHub 或第三方站点下载脚本和配置,因此实际可用性取决于外部资源和目标 Linux 发行版。
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
# 定义证书存储目录
|
|
||||||
certs_directory="/etc/letsencrypt/live/"
|
|
||||||
|
|
||||||
days_before_expiry=5 # 设置在证书到期前几天触发续签
|
|
||||||
|
|
||||||
# 遍历所有证书文件
|
|
||||||
for cert_dir in $certs_directory*; do
|
|
||||||
# 获取域名
|
|
||||||
domain=$(basename "$cert_dir")
|
|
||||||
|
|
||||||
# 忽略 README 目录
|
|
||||||
if [ "$domain" = "README" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 输出正在检查的证书信息
|
|
||||||
echo "检查证书过期日期: ${domain}"
|
|
||||||
|
|
||||||
# 获取fullchain.pem文件路径
|
|
||||||
cert_file="${cert_dir}/fullchain.pem"
|
|
||||||
|
|
||||||
# 获取证书过期日期
|
|
||||||
expiration_date=$(openssl x509 -enddate -noout -in "${cert_file}" | cut -d "=" -f 2-)
|
|
||||||
|
|
||||||
# 输出证书过期日期
|
|
||||||
echo "过期日期: ${expiration_date}"
|
|
||||||
|
|
||||||
# 将日期转换为时间戳
|
|
||||||
expiration_timestamp=$(date -d "${expiration_date}" +%s)
|
|
||||||
current_timestamp=$(date +%s)
|
|
||||||
|
|
||||||
# 计算距离过期还有几天
|
|
||||||
days_until_expiry=$(( ($expiration_timestamp - $current_timestamp) / 86400 ))
|
|
||||||
|
|
||||||
# 检查是否需要续签(在满足续签条件的情况下)
|
|
||||||
if [ $days_until_expiry -le $days_before_expiry ]; then
|
|
||||||
echo "证书将在${days_before_expiry}天内过期,正在进行自动续签。"
|
|
||||||
|
|
||||||
# 停止 Nginx
|
|
||||||
docker stop nginx
|
|
||||||
|
|
||||||
iptables -P INPUT ACCEPT
|
|
||||||
iptables -P FORWARD ACCEPT
|
|
||||||
iptables -P OUTPUT ACCEPT
|
|
||||||
iptables -F
|
|
||||||
|
|
||||||
ip6tables -P INPUT ACCEPT
|
|
||||||
ip6tables -P FORWARD ACCEPT
|
|
||||||
ip6tables -P OUTPUT ACCEPT
|
|
||||||
ip6tables -F
|
|
||||||
|
|
||||||
# 续签证书
|
|
||||||
certbot certonly --standalone -d $domain --email your@email.com --agree-tos --no-eff-email --force-renewal
|
|
||||||
|
|
||||||
# 启动 Nginx
|
|
||||||
docker start nginx
|
|
||||||
|
|
||||||
echo "证书已成功续签。"
|
|
||||||
else
|
|
||||||
# 若未满足续签条件,则输出证书仍然有效
|
|
||||||
echo "证书仍然有效,距离过期还有 ${days_until_expiry} 天。"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 输出分隔线
|
|
||||||
echo "--------------------------"
|
|
||||||
done
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
# 定义证书存储目录
|
|
||||||
certs_directory="/home/web/certs/"
|
|
||||||
days_before_expiry=5 # 设置在证书到期前几天触发续签
|
|
||||||
|
|
||||||
# 遍历所有证书文件
|
|
||||||
for cert_file in $certs_directory*_cert.pem; do
|
|
||||||
# 获取域名
|
|
||||||
domain=$(basename "$cert_file" "_cert.pem")
|
|
||||||
|
|
||||||
# 输出正在检查的证书信息
|
|
||||||
echo "检查证书过期日期: ${domain}"
|
|
||||||
|
|
||||||
# 获取证书过期日期
|
|
||||||
expiration_date=$(openssl x509 -enddate -noout -in "${certs_directory}${domain}_cert.pem" | cut -d "=" -f 2-)
|
|
||||||
|
|
||||||
# 输出证书过期日期
|
|
||||||
echo "过期日期: ${expiration_date}"
|
|
||||||
|
|
||||||
# 将日期转换为时间戳
|
|
||||||
expiration_timestamp=$(date -d "${expiration_date}" +%s)
|
|
||||||
current_timestamp=$(date +%s)
|
|
||||||
|
|
||||||
# 计算距离过期还有几天
|
|
||||||
days_until_expiry=$(( ($expiration_timestamp - $current_timestamp) / 86400 ))
|
|
||||||
|
|
||||||
# 检查是否需要续签(在满足续签条件的情况下)
|
|
||||||
if [ $days_until_expiry -le $days_before_expiry ]; then
|
|
||||||
echo "证书将在${days_before_expiry}天内过期,正在进行自动续签。"
|
|
||||||
|
|
||||||
# 停止 Nginx
|
|
||||||
docker stop nginx
|
|
||||||
|
|
||||||
iptables -P INPUT ACCEPT
|
|
||||||
iptables -P FORWARD ACCEPT
|
|
||||||
iptables -P OUTPUT ACCEPT
|
|
||||||
iptables -F
|
|
||||||
|
|
||||||
ip6tables -P INPUT ACCEPT
|
|
||||||
ip6tables -P FORWARD ACCEPT
|
|
||||||
ip6tables -P OUTPUT ACCEPT
|
|
||||||
ip6tables -F
|
|
||||||
|
|
||||||
# 续签证书
|
|
||||||
# certbot certonly --standalone -d $domain --email your@email.com --agree-tos --no-eff-email --force-renewal
|
|
||||||
certbot certonly --standalone -d $domain --email your@email.com --agree-tos --no-eff-email --force-renewal --key-type ecdsa
|
|
||||||
|
|
||||||
# 复制续签后的证书和私钥
|
|
||||||
cp /etc/letsencrypt/live/$domain/fullchain.pem ${certs_directory}${domain}_cert.pem
|
|
||||||
cp /etc/letsencrypt/live/$domain/privkey.pem ${certs_directory}${domain}_key.pem
|
|
||||||
|
|
||||||
# 启动 Nginx
|
|
||||||
docker start nginx
|
|
||||||
|
|
||||||
echo "证书已成功续签。"
|
|
||||||
else
|
|
||||||
# 若未满足续签条件,则输出证书仍然有效
|
|
||||||
echo "证书仍然有效,距离过期还有 ${days_until_expiry} 天。"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 输出分隔线
|
|
||||||
echo "--------------------------"
|
|
||||||
done
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Create a tar archive of the web directory
|
|
||||||
cd /home/ && tar czvf web_$(date +"%Y%m%d%H%M%S").tar.gz web
|
|
||||||
|
|
||||||
# Transfer the tar archive to another VPS
|
|
||||||
cd /home/ && ls -t /home/*.tar.gz | head -1 | xargs -I {} sshpass -p 123456 scp -o StrictHostKeyChecking=no -P 22 {} root@0.0.0.0:/home/
|
|
||||||
|
|
||||||
# Keep only 5 tar archives and delete the rest
|
|
||||||
cd /home/ && ls -t /home/*.tar.gz | tail -n +4 | xargs -I {} rm {}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
#在oci=begin和oci=end之间放入你的API配置信息 支持多个配置文件 机器人切换profile可更换操作配置
|
|
||||||
oci=begin
|
|
||||||
|
|
||||||
[DEFAULT]
|
|
||||||
user=ocid1.user.oc1..aaaaaaaaxxxxgwlg3xuzwgsaazxtzbozqq
|
|
||||||
fingerprint=b8:33:6f:xxxx:45:43:33
|
|
||||||
tenancy=ocid1.tenancy.oc1..aaaaaaaaxxx7x7h4ya
|
|
||||||
region=ap-singapore-1
|
|
||||||
key_file=写你的API密钥文件路径
|
|
||||||
|
|
||||||
[DEFAULT2]
|
|
||||||
user=ocid1.user.oc1..aaaaaaaaxxxxgwlg3xuzwgsaazxtzbozqq
|
|
||||||
fingerprint=b8:33:6f:xxxx:45:43:33
|
|
||||||
tenancy=ocid1.tenancy.oc1..aaaaaaaaxxx7x7h4ya
|
|
||||||
region=ap-singapore-1
|
|
||||||
key_file=写你的API密钥文件路径
|
|
||||||
|
|
||||||
oci=end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#用户信息 从 https://t.me/radiance_helper_bot 配置(bot可使用/raninfo命令随机生成)
|
|
||||||
#必传
|
|
||||||
username=
|
|
||||||
#必传
|
|
||||||
password=
|
|
||||||
|
|
||||||
|
|
||||||
#cloudflare 功能参数 非必传
|
|
||||||
#非必传 cloudflare邮箱
|
|
||||||
cf_email=
|
|
||||||
#非必传 cloudflare key 在我的个人资料->API令牌处->API密钥->Global API Key 获取
|
|
||||||
cf_account_key=
|
|
||||||
|
|
||||||
|
|
||||||
#非必填 本机ip和端口号 (进阶玩家选项 可填写域名) 不写将自动获取本机ip 并使用默认端口号9527 (小白用户建议不填) 如填写 格式为:https://xxx.xx:9527
|
|
||||||
local_address=
|
|
||||||
#非必填 url名称(默认为address 可在bot上修改)
|
|
||||||
local_url_name=
|
|
||||||
|
|
||||||
#非必填 启动模式 填写local为启动本地无公网IP模式(只要能联网即可) 不填或填其他 则启动端口模式
|
|
||||||
model=
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#在azure=begin和azure=end之间放入你的azure的API配置信息 支持多个配置文件 机器人切换profile可更换操作配置 上传配置支持使用原格式({"appId":"xxx","password":"xxx"...})上传
|
|
||||||
azure=begin
|
|
||||||
|
|
||||||
[az001]
|
|
||||||
appId=551xxxx7-xxxx-xxxx-xxxx-b9xxxx60cc65
|
|
||||||
password=T618Q~.LIy_xxxxx~jm~xxxxxx
|
|
||||||
tenant=xxxx3713-xxxx-4cb5-xxxx-3001060xxxxx
|
|
||||||
|
|
||||||
azure=end
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
#
|
|
||||||
# Author: Mike Rushton
|
|
||||||
#
|
|
||||||
# IMPORTANT
|
|
||||||
#
|
|
||||||
# Please set jail.local's permission to 640 because it contains your CF API key.
|
|
||||||
#
|
|
||||||
# This action depends on curl (and optionally jq).
|
|
||||||
# Referenced from http://www.normyee.net/blog/2012/02/02/adding-cloudflare-support-to-fail2ban by NORM YEE
|
|
||||||
#
|
|
||||||
# To get your CloudFlare API Key: https://www.cloudflare.com/a/account/my-account
|
|
||||||
#
|
|
||||||
# CloudFlare API error codes: https://www.cloudflare.com/docs/host-api.html#s4.2
|
|
||||||
|
|
||||||
[Definition]
|
|
||||||
|
|
||||||
# Option: actionstart
|
|
||||||
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
|
|
||||||
# Values: CMD
|
|
||||||
#
|
|
||||||
actionstart =
|
|
||||||
|
|
||||||
# Option: actionstop
|
|
||||||
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
|
|
||||||
# Values: CMD
|
|
||||||
#
|
|
||||||
actionstop =
|
|
||||||
|
|
||||||
# Option: actioncheck
|
|
||||||
# Notes.: command executed once before each actionban command
|
|
||||||
# Values: CMD
|
|
||||||
#
|
|
||||||
actioncheck =
|
|
||||||
|
|
||||||
# Option: actionban
|
|
||||||
# Notes.: command executed when banning an IP. Take care that the
|
|
||||||
# command is executed with Fail2Ban user rights.
|
|
||||||
# Tags: <ip> IP address
|
|
||||||
# <failures> number of failures
|
|
||||||
# <time> unix timestamp of the ban time
|
|
||||||
# Values: CMD
|
|
||||||
#
|
|
||||||
# API v1
|
|
||||||
#actionban = curl -s -o /dev/null https://www.cloudflare.com/api_json.html -d 'a=ban' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
|
|
||||||
# API v4
|
|
||||||
actionban = curl -s -o /dev/null -X POST <_cf_api_prms> \
|
|
||||||
-d '{"mode":"block","configuration":{"target":"<cftarget>","value":"<ip>"},"notes":"Fail2Ban <name>"}' \
|
|
||||||
<_cf_api_url>
|
|
||||||
|
|
||||||
# Option: actionunban
|
|
||||||
# Notes.: command executed when unbanning an IP. Take care that the
|
|
||||||
# command is executed with Fail2Ban user rights.
|
|
||||||
# Tags: <ip> IP address
|
|
||||||
# <failures> number of failures
|
|
||||||
# <time> unix timestamp of the ban time
|
|
||||||
# Values: CMD
|
|
||||||
#
|
|
||||||
# API v1
|
|
||||||
#actionunban = curl -s -o /dev/null https://www.cloudflare.com/api_json.html -d 'a=nul' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
|
|
||||||
# API v4
|
|
||||||
actionunban = id=$(curl -s -X GET <_cf_api_prms> \
|
|
||||||
"<_cf_api_url>?mode=block&configuration_target=<cftarget>&configuration_value=<ip>&page=1&per_page=1¬es=Fail2Ban%%20<name>" \
|
|
||||||
| { jq -r '.result[0].id' 2>/dev/null || tr -d '\n' | sed -nE 's/^.*"result"\s*:\s*\[\s*\{\s*"id"\s*:\s*"([^"]+)".*$/\1/p'; })
|
|
||||||
if [ -z "$id" ]; then echo "<name>: id for <ip> cannot be found"; exit 0; fi;
|
|
||||||
curl -s -o /dev/null -X DELETE <_cf_api_prms> "<_cf_api_url>/$id"
|
|
||||||
|
|
||||||
_cf_api_url = https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules
|
|
||||||
_cf_api_prms = -H 'X-Auth-Email: <cfuser>' -H 'X-Auth-Key: <cftoken>' -H 'Content-Type: application/json'
|
|
||||||
|
|
||||||
[Init]
|
|
||||||
|
|
||||||
# If you like to use this action with mailing whois lines, you could use the composite action
|
|
||||||
# action_cf_mwl predefined in jail.conf, just define in your jail:
|
|
||||||
#
|
|
||||||
# action = %(action_cf_mwl)s
|
|
||||||
# # Your CF account e-mail
|
|
||||||
# cfemail =
|
|
||||||
# # Your CF API Key
|
|
||||||
# cfapikey =
|
|
||||||
|
|
||||||
cftoken = APIKEY00000
|
|
||||||
|
|
||||||
cfuser = kejilion@outlook.com
|
|
||||||
|
|
||||||
cftarget = ip
|
|
||||||
|
|
||||||
[Init?family=inet6]
|
|
||||||
cftarget = ip6
|
|
||||||
-6499
File diff suppressed because it is too large
Load Diff
@@ -1,36 +0,0 @@
|
|||||||
[mysqld]
|
|
||||||
|
|
||||||
# 连接和线程管理
|
|
||||||
max_connections = 2048
|
|
||||||
thread_cache_size = 512
|
|
||||||
interactive_timeout = 30
|
|
||||||
wait_timeout = 30
|
|
||||||
|
|
||||||
# InnoDB设置
|
|
||||||
innodb_buffer_pool_size = 2048M
|
|
||||||
innodb_buffer_pool_instances = 2
|
|
||||||
innodb_log_buffer_size = 16M
|
|
||||||
innodb_log_file_size = 64M
|
|
||||||
innodb_lock_wait_timeout = 30
|
|
||||||
innodb_file_per_table = 1
|
|
||||||
innodb_flush_log_at_trx_commit = 1
|
|
||||||
innodb_io_capacity = 1000
|
|
||||||
innodb_io_capacity_max = 2000
|
|
||||||
|
|
||||||
# 缓存和限制
|
|
||||||
table_open_cache = 2000
|
|
||||||
open_files_limit = 4000
|
|
||||||
tmp_table_size = 16M
|
|
||||||
max_heap_table_size = 16M
|
|
||||||
max_allowed_packet = 16M
|
|
||||||
|
|
||||||
# 缓冲区大小
|
|
||||||
sort_buffer_size = 4M
|
|
||||||
read_buffer_size = 2M
|
|
||||||
join_buffer_size = 2M
|
|
||||||
|
|
||||||
# --------------------------
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
[Definition]
|
|
||||||
# failregex = ^<HOST> .* "(GET|POST|HEAD).*HTTP.*" (404|503) .*$
|
|
||||||
# failregex = ^<HOST> .* "(GET|POST|HEAD).*HTTP.*" (404|503|444) .*
|
|
||||||
failregex = ^<HOST> .* "(GET|POST|HEAD).*HTTP.*" ([45]\d\d) .*
|
|
||||||
ignoreregex =.*(robots.txt|favicon.ico|jpg|png)
|
|
||||||
+47
-4226
File diff suppressed because it is too large
Load Diff
@@ -1,59 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# 获取用户输入,用于替换 docker-compose.yml 文件中的占位符
|
|
||||||
read -p "请输入 数据库ROOT密码:" dbrootpasswd
|
|
||||||
read -p "请输入 数据库用户名:" dbuse
|
|
||||||
read -p "请输入 数据库用户密码:" dbusepasswd
|
|
||||||
|
|
||||||
|
|
||||||
# 更新并安装必要的软件包
|
|
||||||
DEBIAN_FRONTEND=noninteractive apt update -y
|
|
||||||
DEBIAN_FRONTEND=noninteractive apt full-upgrade -y
|
|
||||||
apt install -y curl wget sudo socat unzip tar htop
|
|
||||||
|
|
||||||
# 安装 Docker
|
|
||||||
curl -fsSL https://get.docker.com | sh
|
|
||||||
|
|
||||||
# 安装 Docker Compose
|
|
||||||
curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
|
|
||||||
|
|
||||||
# 创建必要的目录和文件
|
|
||||||
cd /home && mkdir -p web/html web/mysql web/certs web/conf.d web/redis && touch web/docker-compose.yml
|
|
||||||
|
|
||||||
# 下载 docker-compose.yml 文件并进行替换
|
|
||||||
wget -O /home/web/docker-compose.yml https://raw.githubusercontent.com/kejilion/docker/main/LNMP-docker-compose-4.yml
|
|
||||||
|
|
||||||
|
|
||||||
# 在 docker-compose.yml 文件中进行替换
|
|
||||||
sed -i "s/webroot/$dbrootpasswd/g" /home/web/docker-compose.yml
|
|
||||||
sed -i "s/kejilionYYDS/$dbusepasswd/g" /home/web/docker-compose.yml
|
|
||||||
sed -i "s/kejilion/$dbuse/g" /home/web/docker-compose.yml
|
|
||||||
|
|
||||||
iptables -P INPUT ACCEPT
|
|
||||||
iptables -P FORWARD ACCEPT
|
|
||||||
iptables -P OUTPUT ACCEPT
|
|
||||||
iptables -F
|
|
||||||
|
|
||||||
cd /home/web && docker-compose up -d
|
|
||||||
|
|
||||||
docker exec php apt update &&
|
|
||||||
docker exec php apt install -y libmariadb-dev-compat libmariadb-dev libzip-dev libmagickwand-dev imagemagick &&
|
|
||||||
docker exec php docker-php-ext-install mysqli pdo_mysql zip exif gd intl bcmath opcache &&
|
|
||||||
docker exec php pecl install imagick &&
|
|
||||||
docker exec php sh -c 'echo "extension=imagick.so" > /usr/local/etc/php/conf.d/imagick.ini' &&
|
|
||||||
docker exec php pecl install redis &&
|
|
||||||
docker exec php sh -c 'echo "extension=redis.so" > /usr/local/etc/php/conf.d/docker-php-ext-redis.ini' &&
|
|
||||||
docker exec php sh -c 'echo "upload_max_filesize=50M \n post_max_size=50M" > /usr/local/etc/php/conf.d/uploads.ini' &&
|
|
||||||
docker exec php sh -c 'echo "memory_limit=256M" > /usr/local/etc/php/conf.d/memory.ini'
|
|
||||||
|
|
||||||
|
|
||||||
docker exec php74 apt update &&
|
|
||||||
docker exec php74 apt install -y libmariadb-dev-compat libmariadb-dev libzip-dev libmagickwand-dev imagemagick &&
|
|
||||||
docker exec php74 docker-php-ext-install mysqli pdo_mysql zip gd intl bcmath opcache &&
|
|
||||||
docker exec php74 pecl install imagick &&
|
|
||||||
docker exec php74 sh -c 'echo "extension=imagick.so" > /usr/local/etc/php/conf.d/imagick.ini' &&
|
|
||||||
docker exec php74 pecl install redis &&
|
|
||||||
docker exec php74 sh -c 'echo "extension=redis.so" > /usr/local/etc/php/conf.d/docker-php-ext-redis.ini' &&
|
|
||||||
docker exec php74 sh -c 'echo "upload_max_filesize=50M \n post_max_size=50M" > /usr/local/etc/php/conf.d/uploads.ini' &&
|
|
||||||
docker exec php74 sh -c 'echo "memory_limit=256M" > /usr/local/etc/php/conf.d/memory.ini'
|
|
||||||
|
|
||||||
-62
@@ -1,62 +0,0 @@
|
|||||||
[fail2ban-nginx-cc]
|
|
||||||
|
|
||||||
enabled = true
|
|
||||||
filter = fail2ban-nginx-cc
|
|
||||||
chain = DOCKER-USER
|
|
||||||
port = http,https
|
|
||||||
action = cloudflare
|
|
||||||
logpath = /home/web/log/nginx/access.log
|
|
||||||
maxretry = 3
|
|
||||||
bantime = 3600
|
|
||||||
findtime = 3600
|
|
||||||
ignoreip = 192.168.0.1/24
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[nginx-http-auth]
|
|
||||||
|
|
||||||
enabled = true
|
|
||||||
chain = DOCKER-USER
|
|
||||||
mode = fallback
|
|
||||||
port = http,https
|
|
||||||
logpath = /home/web/log/nginx/error.log
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[nginx-limit-req]
|
|
||||||
|
|
||||||
enabled = true
|
|
||||||
chain = DOCKER-USER
|
|
||||||
port = http,https
|
|
||||||
action = cloudflare
|
|
||||||
logpath = /home/web/log/nginx/error.log
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[nginx-botsearch]
|
|
||||||
|
|
||||||
enabled = true
|
|
||||||
chain = DOCKER-USER
|
|
||||||
port = http,https
|
|
||||||
action = cloudflare
|
|
||||||
logpath = /home/web/log/nginx/error.log
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[nginx-bad-request]
|
|
||||||
|
|
||||||
enabled = true
|
|
||||||
chain = DOCKER-USER
|
|
||||||
port = http,https
|
|
||||||
action = cloudflare
|
|
||||||
logpath = /home/web/log/nginx/access.log
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[php-url-fopen]
|
|
||||||
|
|
||||||
enabled = true
|
|
||||||
chain = DOCKER-USER
|
|
||||||
port = http,https
|
|
||||||
action = cloudflare
|
|
||||||
logpath = /home/web/log/nginx/access.log
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
clear
|
|
||||||
mkdir -p /home/game
|
|
||||||
docker cp steamcmd:/home/steam/Steam/steamapps/common/PalServer/Pal/Saved/ /home/game/palworld/
|
|
||||||
cd /home/game && tar czvf palworld_$(date +"%Y%m%d%H%M%S").tar.gz palworld
|
|
||||||
rm -rf /home/game/palworld/
|
|
||||||
echo -e "\033[0;32m游戏存档已导出存放在: /home/game/\033[0m"
|
|
||||||
-13
@@ -1,13 +0,0 @@
|
|||||||
clear
|
|
||||||
echo "脚本更新日志"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-2-1 v1.0"
|
|
||||||
echo "风靡全球的幻兽帕鲁服务端管理面板上线!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-2-2 v1.0.1"
|
|
||||||
echo "增加了游戏存档定时备份,可选每周,每天,每小时"
|
|
||||||
echo "主菜单增加了游戏服务安装状态以及开服情况的智能显示"
|
|
||||||
echo "主菜单增加k选项与科技lion官方脚本工具联动。"
|
|
||||||
echo "主菜单增加游戏配置修改功能"
|
|
||||||
echo "对脚本细节调优,体验更好"
|
|
||||||
echo "------------------------"
|
|
||||||
-445
@@ -1,445 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
ln -sf ~/palworld.sh /usr/local/bin/p
|
|
||||||
|
|
||||||
ip_address() {
|
|
||||||
ipv4_address=$(curl -s ipv4.ip.sb)
|
|
||||||
ipv6_address=$(curl -s --max-time 1 ipv6.ip.sb)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
install() {
|
|
||||||
if [ $# -eq 0 ]; then
|
|
||||||
echo "未提供软件包参数!"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for package in "$@"; do
|
|
||||||
if ! command -v "$package" &>/dev/null; then
|
|
||||||
if command -v apt &>/dev/null; then
|
|
||||||
apt update -y && apt install -y "$package"
|
|
||||||
elif command -v yum &>/dev/null; then
|
|
||||||
yum -y update && yum -y install "$package"
|
|
||||||
elif command -v apk &>/dev/null; then
|
|
||||||
apk update && apk add "$package"
|
|
||||||
else
|
|
||||||
echo "未知的包管理器!"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
remove() {
|
|
||||||
if [ $# -eq 0 ]; then
|
|
||||||
echo "未提供软件包参数!"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for package in "$@"; do
|
|
||||||
if command -v apt &>/dev/null; then
|
|
||||||
apt purge -y "$package"
|
|
||||||
elif command -v yum &>/dev/null; then
|
|
||||||
yum remove -y "$package"
|
|
||||||
elif command -v apk &>/dev/null; then
|
|
||||||
apk del "$package"
|
|
||||||
else
|
|
||||||
echo "未知的包管理器!"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
break_end() {
|
|
||||||
echo -e "\033[0;32m操作完成\033[0m"
|
|
||||||
echo "按任意键继续..."
|
|
||||||
read -n 1 -s -r -p ""
|
|
||||||
echo ""
|
|
||||||
clear
|
|
||||||
}
|
|
||||||
|
|
||||||
palworld() {
|
|
||||||
p
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
install_add_docker() {
|
|
||||||
if [ -f "/etc/alpine-release" ]; then
|
|
||||||
apk update
|
|
||||||
apk add docker docker-compose
|
|
||||||
rc-update add docker default
|
|
||||||
service docker start
|
|
||||||
else
|
|
||||||
curl -fsSL https://get.docker.com | sh && ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/local/bin
|
|
||||||
systemctl start docker
|
|
||||||
systemctl enable docker
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
install_docker() {
|
|
||||||
if ! command -v docker &>/dev/null; then
|
|
||||||
install_add_docker
|
|
||||||
else
|
|
||||||
echo "Docker 已经安装"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pal_start() {
|
|
||||||
ip_address
|
|
||||||
tmux new -d -s my1 "docker exec -it steamcmd bash -c '/home/steam/Steam/steamapps/common/PalServer/PalServer.sh'"
|
|
||||||
echo -e "\033[0;32m幻兽帕鲁服务启动啦!\033[0m"
|
|
||||||
echo -e "\033[0;32m游戏下载地址: https://store.steampowered.com/app/1623730\033[0m"
|
|
||||||
echo -e "\033[0;32m进入游戏连接:\033[93m $ipv4_address:8255 \033[0;32m开始冒险吧!\033[0m"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
pal_backup() {
|
|
||||||
cd ~
|
|
||||||
curl -sS -O https://kejilion.pro/pal_backup.sh && chmod +x pal_backup.sh
|
|
||||||
}
|
|
||||||
|
|
||||||
pal_install_status() {
|
|
||||||
CONTAINER_NAME="steamcmd"
|
|
||||||
|
|
||||||
# 检查容器是否已安装
|
|
||||||
if [ "$(docker ps -a -q -f name=$CONTAINER_NAME 2>/dev/null)" ]; then
|
|
||||||
container_status="\e[32m幻兽帕鲁服务已安装\e[0m" # 绿色
|
|
||||||
else
|
|
||||||
container_status="\e[90m幻兽帕鲁服务未安装\e[0m" # 灰色
|
|
||||||
fi
|
|
||||||
|
|
||||||
SESSION_NAME="my1"
|
|
||||||
|
|
||||||
ip_address
|
|
||||||
# 检查 tmux 中是否存在指定的工作区
|
|
||||||
if tmux has-session -t $SESSION_NAME 2>/dev/null; then
|
|
||||||
tmux_status="\e[32m已开服:\033[93m $ipv4_address:8255\e[0m" # 绿色
|
|
||||||
else
|
|
||||||
tmux_status="\e[90m未开服\e[0m" # 灰色
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
while true; do
|
|
||||||
clear
|
|
||||||
pal_install_status
|
|
||||||
echo -e "\033[93m . . ."
|
|
||||||
echo "._ _.|. , _ ._.| _|"
|
|
||||||
echo "[_)(_]| \/\/ (_)[ |(_]"
|
|
||||||
echo "| "
|
|
||||||
echo -e "\033[96m幻兽帕鲁开服一键脚本工具v1.0.2 by KEJILION\033[0m"
|
|
||||||
echo -e "\033[96m-输入\033[93mp\033[96m可快速启动此脚本-\033[0m"
|
|
||||||
echo -e "$container_status $tmux_status"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "1. 安装幻兽帕鲁服务"
|
|
||||||
echo "2. 开启幻兽帕鲁服务"
|
|
||||||
echo "3. 关闭幻兽帕鲁服务"
|
|
||||||
echo "4. 重启幻兽帕鲁服务"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "5. 查看服务器状态"
|
|
||||||
echo "6. 设置虚拟内存"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "7. 导出游戏存档"
|
|
||||||
echo "8. 导入游戏存档"
|
|
||||||
echo "9. 定时备份游戏存档"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "10. 修改游戏配置"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "11. 更新幻兽帕鲁服务"
|
|
||||||
echo "12. 卸载幻兽帕鲁服务"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "k. 科技lion脚本工具箱"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "00. 脚本更新"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "0. 退出脚本"
|
|
||||||
echo "------------------------"
|
|
||||||
read -p "请输入你的选择: " choice
|
|
||||||
|
|
||||||
case $choice in
|
|
||||||
1)
|
|
||||||
clear
|
|
||||||
install_docker
|
|
||||||
install tmux
|
|
||||||
docker run -dit --name steamcmd -p 8255:8211/udp --restart=always cm2network/steamcmd
|
|
||||||
docker exec -it steamcmd bash -c "/home/steam/steamcmd/steamcmd.sh +login anonymous +app_update 2394010 validate +quit"
|
|
||||||
clear
|
|
||||||
pal_start
|
|
||||||
;;
|
|
||||||
|
|
||||||
2)
|
|
||||||
clear
|
|
||||||
docker start steamcmd > /dev/null 2>&1
|
|
||||||
pal_start
|
|
||||||
;;
|
|
||||||
|
|
||||||
3)
|
|
||||||
clear
|
|
||||||
tmux kill-session -t my1
|
|
||||||
docker stop steamcmd > /dev/null 2>&1
|
|
||||||
echo -e "\033[0;32m幻兽帕鲁服务已关闭\033[0m"
|
|
||||||
;;
|
|
||||||
|
|
||||||
4)
|
|
||||||
clear
|
|
||||||
tmux kill-session -t my1
|
|
||||||
docker restart steamcmd > /dev/null 2>&1
|
|
||||||
pal_start
|
|
||||||
;;
|
|
||||||
|
|
||||||
5)
|
|
||||||
clear
|
|
||||||
install btop
|
|
||||||
clear
|
|
||||||
btop
|
|
||||||
;;
|
|
||||||
|
|
||||||
6)
|
|
||||||
clear
|
|
||||||
swap_used=$(free -m | awk 'NR==3{print $3}')
|
|
||||||
swap_total=$(free -m | awk 'NR==3{print $2}')
|
|
||||||
|
|
||||||
if [ "$swap_total" -eq 0 ]; then
|
|
||||||
swap_percentage=0
|
|
||||||
else
|
|
||||||
swap_percentage=$((swap_used * 100 / swap_total))
|
|
||||||
fi
|
|
||||||
|
|
||||||
swap_info="${swap_used}MB/${swap_total}MB (${swap_percentage}%)"
|
|
||||||
|
|
||||||
echo "当前虚拟内存: $swap_info"
|
|
||||||
|
|
||||||
read -p "是否调整大小?(Y/N): " choice
|
|
||||||
|
|
||||||
case "$choice" in
|
|
||||||
[Yy])
|
|
||||||
# 输入新的虚拟内存大小
|
|
||||||
read -p "请输入虚拟内存大小MB: " new_swap
|
|
||||||
|
|
||||||
# 获取当前系统中所有的 swap 分区
|
|
||||||
swap_partitions=$(grep -E '^/dev/' /proc/swaps | awk '{print $1}')
|
|
||||||
|
|
||||||
# 遍历并删除所有的 swap 分区
|
|
||||||
for partition in $swap_partitions; do
|
|
||||||
swapoff "$partition"
|
|
||||||
wipefs -a "$partition" # 清除文件系统标识符
|
|
||||||
mkswap -f "$partition"
|
|
||||||
echo "已删除并重新创建 swap 分区: $partition"
|
|
||||||
done
|
|
||||||
|
|
||||||
# 确保 /swapfile 不再被使用
|
|
||||||
swapoff /swapfile
|
|
||||||
|
|
||||||
# 删除旧的 /swapfile
|
|
||||||
rm -f /swapfile
|
|
||||||
|
|
||||||
# 创建新的 swap 分区
|
|
||||||
dd if=/dev/zero of=/swapfile bs=1M count=$new_swap
|
|
||||||
chmod 600 /swapfile
|
|
||||||
mkswap /swapfile
|
|
||||||
swapon /swapfile
|
|
||||||
|
|
||||||
if [ -f /etc/alpine-release ]; then
|
|
||||||
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
|
|
||||||
echo "nohup swapon /swapfile" >> /etc/local.d/swap.start
|
|
||||||
chmod +x /etc/local.d/swap.start
|
|
||||||
rc-update add local
|
|
||||||
else
|
|
||||||
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "虚拟内存大小已调整为${new_swap}MB"
|
|
||||||
;;
|
|
||||||
[Nn])
|
|
||||||
echo "已取消"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "无效的选择,请输入 Y 或 N。"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
|
|
||||||
7)
|
|
||||||
clear
|
|
||||||
mkdir -p /home/game
|
|
||||||
docker cp steamcmd:/home/steam/Steam/steamapps/common/PalServer/Pal/Saved/ /home/game/palworld/ > /dev/null 2>&1
|
|
||||||
cd /home/game && tar czvf palworld_$(date +"%Y%m%d%H%M%S").tar.gz palworld > /dev/null 2>&1
|
|
||||||
rm -rf /home/game/palworld/
|
|
||||||
echo -e "\033[0;32m游戏存档已导出存放在: /home/game/\033[0m"
|
|
||||||
;;
|
|
||||||
8)
|
|
||||||
clear
|
|
||||||
tmux kill-session -t my1
|
|
||||||
docker exec -it steamcmd bash -c "rm -rf /home/steam/Steam/steamapps/common/PalServer/Pal/Saved/*"
|
|
||||||
cd /home/game/ && ls -t /home/game/*.tar.gz | head -1 | xargs -I {} tar -xzf {}
|
|
||||||
docker cp /home/game/palworld/Config steamcmd:/home/steam/Steam/steamapps/common/PalServer/Pal/Saved/Config > /dev/null 2>&1
|
|
||||||
docker cp /home/game/palworld/ImGui steamcmd:/home/steam/Steam/steamapps/common/PalServer/Pal/Saved/ImGui > /dev/null 2>&1
|
|
||||||
docker cp /home/game/palworld/SaveGames steamcmd:/home/steam/Steam/steamapps/common/PalServer/Pal/Saved/SaveGames > /dev/null 2>&1
|
|
||||||
docker exec -it -u root steamcmd bash -c "chmod -R 777 /home/steam/Steam/steamapps/common/PalServer/Pal/Saved/"
|
|
||||||
rm -rf /home/game/palworld/
|
|
||||||
echo -e "\033[0;32m游戏存档已导入\033[0m"
|
|
||||||
docker restart steamcmd > /dev/null 2>&1
|
|
||||||
pal_start
|
|
||||||
;;
|
|
||||||
|
|
||||||
9)
|
|
||||||
clear
|
|
||||||
echo "幻兽帕鲁游戏存档定时备份"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "1. 每周备份 2. 每天备份 3. 每小时备份"
|
|
||||||
echo "------------------------"
|
|
||||||
read -p "请输入你的选择: " dingshi
|
|
||||||
case $dingshi in
|
|
||||||
1)
|
|
||||||
pal_backup
|
|
||||||
(crontab -l ; echo "0 0 * * 1 ./pal_backup.sh") | crontab - > /dev/null 2>&1
|
|
||||||
echo "每周一备份,已设置"
|
|
||||||
|
|
||||||
;;
|
|
||||||
2)
|
|
||||||
pal_backup
|
|
||||||
(crontab -l ; echo "0 3 * * * ./pal_backup.sh") | crontab - > /dev/null 2>&1
|
|
||||||
echo "每天凌晨3点备份,已设置"
|
|
||||||
|
|
||||||
;;
|
|
||||||
3)
|
|
||||||
pal_backup
|
|
||||||
(crontab -l ; echo "0 * * * * ./pal_backup.sh") | crontab - > /dev/null 2>&1
|
|
||||||
echo "每小时整点备份,已设置"
|
|
||||||
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "已取消"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
|
|
||||||
10)
|
|
||||||
clear
|
|
||||||
tmux kill-session -t my1
|
|
||||||
cd ~ && curl -sS -O https://kejilion.pro/PalWorldSettings.ini
|
|
||||||
|
|
||||||
echo "配置游戏参数"
|
|
||||||
echo "------------------------"
|
|
||||||
read -p "设置加入的密码(回车默认无密码): " server_password
|
|
||||||
read -p "设置游戏难度: (1. 简单 2. 普通 3. 困难):" Difficulty
|
|
||||||
case $Difficulty in
|
|
||||||
1)
|
|
||||||
Difficulty=1
|
|
||||||
;;
|
|
||||||
|
|
||||||
2)
|
|
||||||
Difficulty=2
|
|
||||||
;;
|
|
||||||
3)
|
|
||||||
Difficulty=3
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "-默认设置为普通难度"
|
|
||||||
Difficulty=2
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
read -p "经验值倍率: (回车默认1倍):" exp_rate
|
|
||||||
ExpRate=${exp_rate:-1}
|
|
||||||
read -p "死亡后掉落设置: (1. 掉落 2. 不掉落):" DeathPenalty
|
|
||||||
case $DeathPenalty in
|
|
||||||
1)
|
|
||||||
DeathPenalty=All
|
|
||||||
;;
|
|
||||||
|
|
||||||
2)
|
|
||||||
DeathPenalty=None
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
DeathPenalty=All
|
|
||||||
echo "-默认设置为掉落"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
read -p "设置pvp模式: (1. 开启 2. 关闭):" pal_pvp
|
|
||||||
|
|
||||||
case $pal_pvp in
|
|
||||||
1)
|
|
||||||
pal_pvp=True
|
|
||||||
;;
|
|
||||||
2)
|
|
||||||
pal_pvp=False
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
pal_pvp=False
|
|
||||||
echo "-默认关闭pvp模式"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# 更新配置文件
|
|
||||||
sed -i "s/ServerPassword=\"\"/ServerPassword=\"$server_password\"/" ~/PalWorldSettings.ini
|
|
||||||
sed -i "s/Difficulty=2/Difficulty=$Difficulty/" ~/PalWorldSettings.ini
|
|
||||||
sed -i "s/ExpRate=1.000000/ExpRate=$ExpRate/" ~/PalWorldSettings.ini
|
|
||||||
sed -i "s/DeathPenalty=All/DeathPenalty=$DeathPenalty/" ~/PalWorldSettings.ini
|
|
||||||
sed -i "s/bEnablePlayerToPlayerDamage=False/bEnablePlayerToPlayerDamage=$pal_pvp/" ~/PalWorldSettings.ini
|
|
||||||
sed -i "s/bIsPvP=False/bIsPvP=$pal_pvp/" ~/PalWorldSettings.ini
|
|
||||||
echo "------------------------"
|
|
||||||
echo "配置文件已更新"
|
|
||||||
|
|
||||||
docker exec -it steamcmd bash -c "rm -f /home/steam/Steam/steamapps/common/PalServer/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini"
|
|
||||||
docker cp ~/PalWorldSettings.ini steamcmd:/home/steam/Steam/steamapps/common/PalServer/Pal/Saved/Config/LinuxServer/ > /dev/null 2>&1
|
|
||||||
docker exec -it -u root steamcmd bash -c "chmod -R 777 /home/steam/Steam/steamapps/common/PalServer/Pal/Saved/"
|
|
||||||
rm -f ~/PalWorldSettings.ini
|
|
||||||
echo -e "\033[0;32m游戏配置已导入\033[0m"
|
|
||||||
docker restart steamcmd > /dev/null 2>&1
|
|
||||||
pal_start
|
|
||||||
;;
|
|
||||||
|
|
||||||
|
|
||||||
11)
|
|
||||||
clear
|
|
||||||
tmux kill-session -t my1
|
|
||||||
docker restart steamcmd > /dev/null 2>&1
|
|
||||||
docker exec -it steamcmd bash -c "/home/steam/steamcmd/steamcmd.sh +login anonymous +app_update 2394010 validate +quit"
|
|
||||||
clear
|
|
||||||
echo -e "\033[0;32m幻兽帕鲁已更新\033[0m"
|
|
||||||
pal_start
|
|
||||||
;;
|
|
||||||
|
|
||||||
12)
|
|
||||||
clear
|
|
||||||
docker rm -f steamcmd
|
|
||||||
docker rmi -f cm2network/steamcmd
|
|
||||||
;;
|
|
||||||
|
|
||||||
k)
|
|
||||||
cd ~
|
|
||||||
curl -sS -O https://kejilion.pro/kejilion.sh && chmod +x kejilion.sh && ./kejilion.sh
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
|
|
||||||
00)
|
|
||||||
cd ~
|
|
||||||
curl -sS -O https://kejilion.pro/pal_log.sh && chmod +x pal_log.sh && ./pal_log.sh
|
|
||||||
rm pal_log.sh
|
|
||||||
echo ""
|
|
||||||
curl -sS -O https://kejilion.pro/palworld.sh && chmod +x palworld.sh
|
|
||||||
echo "脚本已更新到最新版本!"
|
|
||||||
break_end
|
|
||||||
palworld
|
|
||||||
;;
|
|
||||||
|
|
||||||
|
|
||||||
0)
|
|
||||||
clear
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "无效的输入!"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
break_end
|
|
||||||
done
|
|
||||||
-422
@@ -1,422 +0,0 @@
|
|||||||
clear
|
|
||||||
echo "脚本更新日志"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-13 v1.0.3"
|
|
||||||
echo "1.甲骨文云的DD脚本,添加了Ubuntu 20.04的重装选项。"
|
|
||||||
echo "2.LDNMP建站,开放了苹果CMS网站的搭建功能."
|
|
||||||
echo "3.系统信息查询,增加了内核版本显示,美化了界面。"
|
|
||||||
echo "4.甲骨文脚本中,添加了开启ROOT登录的选项。"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-13 v1.0.4"
|
|
||||||
echo "1.LDNMP建站,开放了独角数卡网站的搭建功能."
|
|
||||||
echo "2.LDNMP建站,优化了备份全站到远端服务器的稳定性."
|
|
||||||
echo "3.Docker管理,全局状态信息,添加了所有docker卷的显示."
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-14 v1.1"
|
|
||||||
echo "Docker管理器全面升级,体验前所未有!"
|
|
||||||
echo "-加入了docker容器管理面板"
|
|
||||||
echo "-加入了docker镜像管理面板"
|
|
||||||
echo "-加入了docker网络管理面板"
|
|
||||||
echo "-加入了docker卷管理面板"
|
|
||||||
echo "-删除docker时追加确认信息,拒绝误操作"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-14 v1.2"
|
|
||||||
echo "1.新增了11选项,加入了常用面板工具合集!"
|
|
||||||
echo "-支持安装各种面板,包括: 宝塔,宝塔国际版,1panel,Nginx Proxy Manager等等,满足更多人群的使用需求!"
|
|
||||||
echo "2.优化了菜单效果"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-14 v1.3"
|
|
||||||
echo "新增了12选项,我的工作区功能"
|
|
||||||
echo "-将为你提供5个后台运行的工作区,用来执行后台任务。即使你断开SSH也不会中断,"
|
|
||||||
echo "-非常有意思的功能,快去试试吧!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-14 v1.3.2"
|
|
||||||
echo "新增了13选项,系统工具"
|
|
||||||
echo "科技lion一键脚本可以通过设置快捷键唤醒打开了,我设置的k作为脚本打开的快捷键!无需复制长命令了"
|
|
||||||
echo "加入了ROOT密码修改,切换成ROOT登录模式"
|
|
||||||
echo "系统设置中还有很多功能没开发,敬请期待!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-15 v1.4"
|
|
||||||
echo "全面适配Centos系统,实现Ubuntu,Debian,Centos三大主流系统的适配"
|
|
||||||
echo "优化LDNMP中PHP输入数据最大时间,解决WordPress网站导入部分主题失败的问题"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-15 v1.4.1"
|
|
||||||
echo "选项13,系统工具中,加入了安装Python最新版的选项,感谢群友春风得意马蹄疾的投稿!很好用!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-15 v1.4.2"
|
|
||||||
echo "docker管理中增加容器日志查看"
|
|
||||||
echo "选项13,系统工具中,加入了留言板的选项,可以留下你的宝贵意见也可以在这里聊天,贼好玩!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-15 v1.4.5"
|
|
||||||
echo "优化了信息查询运行效率"
|
|
||||||
echo "信息查询新增了地理位置显示"
|
|
||||||
echo "优化了脚本内系统判断机制!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-16 v1.4.6"
|
|
||||||
echo "LDNMP建站中加入了删除站点删除数据库功能"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-16 v1.4.7"
|
|
||||||
echo "选项11中,增加了一键搭建alist多存储文件列表工具的"
|
|
||||||
echo "选项11中,增加了一键搭建网页版乌班图远程桌面"
|
|
||||||
echo "选项13中,增加了开放所有端口功能"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-16 v1.4.8"
|
|
||||||
echo "系统信息查询中,终于可以显示总流量消耗了!总接收和总发送两个信息"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-17 v1.4.9"
|
|
||||||
echo "系统工具中新增SSH端口修改功能"
|
|
||||||
echo "系统工具中新增优化DNS地址功能"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-18 v1.5"
|
|
||||||
echo "系统性优化了代码,去除了无效的代码与空格"
|
|
||||||
echo "系统信息查询添加了系统时间"
|
|
||||||
echo "禁用ROOT账户,创建新的账户,更安全!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-18 v1.5.1"
|
|
||||||
echo "LDNMP加入了安装bingchatAI聊天网站"
|
|
||||||
echo "面板工具中添加了哪吒探针脚本整合"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-18 v1.5.2"
|
|
||||||
echo "LDNMP加入了更新LDNMP选项"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-19 v1.5.3"
|
|
||||||
echo "面板工具添加安装QB离线BT磁力下载面板"
|
|
||||||
echo "优化IP获取源"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-20 v1.5.4"
|
|
||||||
echo "面板工具已安装的工具支持状态检测,可以进行删除了!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-21 v1.5.5"
|
|
||||||
echo "系统工具中添加优先ipv4/ipv6选项"
|
|
||||||
echo "系统工具中添加查看端口占用状态选项"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-21 v1.5.6"
|
|
||||||
echo "LDNMP建站添加了定时自动远程备份功能"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-22 v1.5.7"
|
|
||||||
echo "面板工具增加了邮件服务器搭建,请确保服务器的25.80.443开放"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-23 v1.5.8"
|
|
||||||
echo "面板工具增加了聊天系统搭建"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-24 v1.5.9"
|
|
||||||
echo "面板工具增加了禅道项目管理软件搭建"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-24 v1.6"
|
|
||||||
echo "面板工具增加了青龙面板搭建"
|
|
||||||
echo "调整了面板工具列表的排版显示效果"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-27 v1.6.1"
|
|
||||||
echo "LDNMP大幅优化安装体验,添加安装进度条和百分比显示,太刁了!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-28 v1.6.2"
|
|
||||||
echo "docker管理可以显示容器所属网络,并且可以加入网络和退出网络了"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-28 v1.6.3"
|
|
||||||
echo "系统工具中增加修改虚拟内存大小的选项"
|
|
||||||
echo "系统信息查询中显示虚拟内存占用"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-29 v1.6.4"
|
|
||||||
echo "面板工具加入cloudreve网盘的搭建"
|
|
||||||
echo "面板工具加入简单图床程序搭建"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-8-29 v1.6.5"
|
|
||||||
echo "LDNMP加入了高逼格的flarum论坛搭建"
|
|
||||||
echo "面板工具加入简单图床程序搭建"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-9-1 v1.6.6"
|
|
||||||
echo "LDNMP环境安装时用户密码将随机生成,提升安全性,安装环境更简单!"
|
|
||||||
echo "LDNMP环境安装时如果安装过docker将自动跳过,节省安装时间"
|
|
||||||
echo "LDNMP环境更新WordPress到6.3.1版本"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-9-1 v1.6.7"
|
|
||||||
echo "添加了账户管理功能,查看当前账户列表,添加删除账户,账号权限管理等"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-9-4 v1.6.8"
|
|
||||||
echo "独角数卡登录时报错,显示解决办法"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-9-6 v1.6.9"
|
|
||||||
echo "系统工具中添加随机用户密码生成器,方便懒得想用户名和密码的小伙伴"
|
|
||||||
echo "优化了所有搭建网站与面板后的信息复制体验"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-9-11 v1.7"
|
|
||||||
echo "面板工具中添加emby多媒体管理系统的搭建"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-9-15 v1.7.1"
|
|
||||||
echo "LDNMP建站中可以搭建Bitwarden密码管理平台了"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-9-18 v1.7.2"
|
|
||||||
echo "LDNMP建站将站点信息查询和站点管理合并"
|
|
||||||
echo "LDNMP站点管理中添加证书重新申请和站点更换域名的功能"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-9-25 v1.8"
|
|
||||||
echo "LDNMP建站增加了服务器与网站防护功能,防御暴力破解,防御网站被攻击"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-9-28 v1.8.2"
|
|
||||||
echo "LDNMP建站优化了运行速度和安全性,增加了频率限制"
|
|
||||||
echo "LDNMP建站优化了防御程序的高可用性"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-10-3 v1.8.3"
|
|
||||||
echo "系统工具增加系统时区切换功能"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-10-7 v1.8.4"
|
|
||||||
echo "LDNMP建站添加halo博客网站搭建"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-10-12 v1.8.5"
|
|
||||||
echo "LDNMP建站添加优化LDNMP环境选项,可以开启高性能模式,大幅提升网站性能,应对高并发!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-10-14 v1.8.6"
|
|
||||||
echo "面板工具增加了测速流量监控面板的安装"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-10-16 v1.8.7"
|
|
||||||
echo "系统工具中添加开启BBR3加速功能"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-10-18 v1.8.8"
|
|
||||||
echo "系统工具中优化BBR3加速安装流程,可根据CPU型号自行安装适合的内核版本"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-10-19 v1.8.9"
|
|
||||||
echo "系统工具中BBRv3功能增加了更新内核和卸载内核功能"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-10-21 v1.9"
|
|
||||||
echo "开放端口相关优化"
|
|
||||||
echo "解决部分系统SSH端口切换后重启失联的问题"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-10-26 v1.9.1"
|
|
||||||
echo "LNMP建站管理中添加了站点缓存清理功能"
|
|
||||||
echo "面板工具中卸载对应应用时添加了应用目录一并删除,删除更彻底!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-10-28 v1.9.2"
|
|
||||||
echo "系统工具中修复了虚拟内存大小重启后还原的问题"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-11-07 v1.9.3"
|
|
||||||
echo "面板工具中增加AdGuardHome去广告软件安装和管理"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-11-08 v1.9.4"
|
|
||||||
echo "系统工具添加了防火墙高级管理功能,可以开关端口,可以IP黑白名单"
|
|
||||||
echo "未来会上线地域黑白名单等高级功能"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-11-09 v1.9.5"
|
|
||||||
echo "系统工具中防火墙添加udp控制"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-11-10 v1.9.6"
|
|
||||||
echo "测试脚本合集增加了缝合怪一条龙测试"
|
|
||||||
echo "系统信息查询中添加了系统运行时长显示"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-11-10 v1.9.7"
|
|
||||||
echo "LDNMP建站增加typecho轻量博客的搭建"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-11-16 v1.9.8"
|
|
||||||
echo "面板工具中增加了在线office办公软件安装"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-11-21 v1.9.9"
|
|
||||||
echo "面板工具中增加了雷池WAF防火墙程序安装"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-11-28 v2.0"
|
|
||||||
echo "LDNMP建站中增加仅安装nginx的选项专门服务于站点重定向和站点反向代理"
|
|
||||||
echo "精简无用的代码,优化执行效率"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-11-29 v2.0.1"
|
|
||||||
echo "LDNMP建站改用cerbot申请证书,更稳定更快速。弃用acme"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-11-30 v2.0.2"
|
|
||||||
echo "面板工具修复QB无法登录问题"
|
|
||||||
echo "面板工具修复RocketChat进入后无限加载问题"
|
|
||||||
echo "系统工具中添加修改主机名功能"
|
|
||||||
echo "系统工具中添加服务器重启功能"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-12-04 v2.0.3"
|
|
||||||
echo "LDNMP建站过程中增加了nginx自我检测修复功能"
|
|
||||||
echo "系统工具添加更新源切换功能,请先在测试环境使用"
|
|
||||||
echo "LDNMP建站增加自定义上传静态html界面功能"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-12-05 v2.0.4"
|
|
||||||
echo "LDNMP建站中仅安装nginx功能添加安装成功提示,更优雅直观"
|
|
||||||
echo "LDNMP建站中仅安装nginx功能支持自动更新nginx版本"
|
|
||||||
echo "优化代码细节,定义调用函数,脚本执行更简洁,提升效率"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-12-07 v2.0.5"
|
|
||||||
echo "LDNMP在站点数据管理中增加查看站点分析报告功能,可以对网站流量进行监控与分析"
|
|
||||||
echo "主菜单添加手动更新脚本功能"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-12-08 v2.0.6"
|
|
||||||
echo "主菜单中更新日志和脚本更新合并,更新时可以看到更新日志,更直觉"
|
|
||||||
echo "面板工具中新增了docker管理面板portainer的安装"
|
|
||||||
echo "面板工具中新增了VScode网页版的安装"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-12-15 v2.0.7"
|
|
||||||
echo "系统工具中添加了定时任务的管理功能"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-12-16 v2.0.8"
|
|
||||||
echo "大量安装软件的代码整合更简单快速安装各类软件包"
|
|
||||||
echo "优化选项4中的常用工具安装及使用体验,已安装可以提示使用方法"
|
|
||||||
echo "选项4中新增多款实用工具,如btop现代化监控工具,安装即用,q退出"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-12-18 v2.0.9"
|
|
||||||
echo "优化安装代码,全局调用,安装智能检测,安装软件更快"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-12-19 v2.1"
|
|
||||||
echo "选项4中,新增自定义安装卸载指定的工具"
|
|
||||||
echo "优化了清理逻辑,清理系统更快更干净"
|
|
||||||
echo "优化了卸载软件包的逻辑,根据系统执行卸载,更智能"
|
|
||||||
echo "优化主菜单到二级菜单的交互,二级菜单更沉浸,二级菜单箭头引导调整"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-12-20 v2.1.1"
|
|
||||||
echo "史诗级代码精简,屎山大扫除,脚本运行更快速,脚本大小缩减20%"
|
|
||||||
echo "LDNMP安装环境时增加端口检测功能,端口被占用会无法安装"
|
|
||||||
echo "面板工具中添加Uptime Kuma监控工具的安装"
|
|
||||||
echo "面板工具中添加Memos网页备忘录的安装"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-12-23 v2.1.2"
|
|
||||||
echo "面板工具中添加潘多拉GPT镜像站安装"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-12-26 v2.1.3"
|
|
||||||
echo "选项4常用工具中添加跑火车屏保,俄罗斯方块,贪吃蛇,太空入侵者三款小游戏"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2023-12-30 v2.1.4"
|
|
||||||
echo "LDNMP增加了防止源站IP泄露机制,保护源站IP与证书潜在安全隐患"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-01-04 v2.1.5"
|
|
||||||
echo "脚本添加了启动快捷键,命令行输入k可以快速启动科技lion脚本工具"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-01-04 v2.1.6"
|
|
||||||
echo "脚本添加了启动快捷键,命令行输入k可以快速启动科技lion脚本工具"
|
|
||||||
echo "面板工具1panel增加了已安装状态,支持查看面板信息修改用户密码,支持卸载面板"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-01-06 v2.1.7"
|
|
||||||
echo "面板工具增加了nextcloud网盘的搭建"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-01-09 v2.1.8"
|
|
||||||
echo "LDNMP建站增加对ipv6的建站支持,解析v6地址建站据说提升站点安全性,性能也有提升!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-01-10 v2.1.9"
|
|
||||||
echo "面板工具增加QD-Today定时任务管理框架的安装"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-01-12 v2.2"
|
|
||||||
echo "面板工具增加了Dockge容器堆栈管理面板的安装"
|
|
||||||
echo "面板工具增加了LibreSpeed轻量级测速工具的安装"
|
|
||||||
echo "优化了脚本快捷启动,输入k快速启动脚本支持任何目录下使用"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-01-16 v2.2.1"
|
|
||||||
echo "主菜单添加14选项,VPS集群控制系统,可以一键操控所有VPS执行任务。"
|
|
||||||
echo "VPS集群控制属于测试版本,请用闲置机器开始体验,有任何问题欢迎留言反馈"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-01-17 v2.2.2"
|
|
||||||
echo "面板工具增加了搜索聚合网站的安装"
|
|
||||||
echo "优化了集群控制体验,集群环境备份还原卸载等功能上线"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-01-18 v2.2.3"
|
|
||||||
echo "面板工具增加了私有相册系统的安装"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-01-21 v2.2.4"
|
|
||||||
echo "面板工具增加了PDF工具大全应用的安装"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-01-23 v2.2.5"
|
|
||||||
echo "优化了LDNMP建站配置时进度条体验,让读条不至于卡在一个地方很久。拆分配置环节让体验更加顺畅"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-01-25 v2.2.6"
|
|
||||||
echo "精简了LDNMP建站镜像大小,采用官方alpine精简镜像包,更快,更轻,更安全"
|
|
||||||
echo "脚本适配alpine系统"
|
|
||||||
echo "系统工具中重装系统选项升级,增加了Debian11 Debian10 ubuntu22.04 centos7 alpine3.19 windows11的安装选项"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-01-30 v2.2.7"
|
|
||||||
echo "LDNMP建站更新halo2的安装版本到2.11"
|
|
||||||
echo "修复alpine系统下虚拟内存重启后失效的问题"
|
|
||||||
echo "优化alpine系统下docker安装体验,安装docker应用时自动识别安装docker环境"
|
|
||||||
echo "修复alpine系统下CPU占用显示异常的问题"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-02-1 v2.2.8"
|
|
||||||
echo "主菜单临时增加p选项,与幻兽帕鲁开服脚本联动"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-02-5 v2.2.9"
|
|
||||||
echo "修改主机名支持alpine系统"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-02-8 v2.3"
|
|
||||||
echo "面板工具增加了drawio在线绘图工具的安装"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-02-21 v2.3.1"
|
|
||||||
echo "主菜单选项12我的工作区增加至10个,更利于多线程后台任务"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-02-26 v2.3.2"
|
|
||||||
echo "系统工具中的选项8中一键重装系统的体验进行优化,重装时展示系统重装后的用户名密码和端口号"
|
|
||||||
echo "一键重装系统增加了更多Windows版本重装 11 10 2019 2022"
|
|
||||||
echo "一键重装系统增加了更多版本重装"
|
|
||||||
echo "一键重装Windows系统默认为中文版了"
|
|
||||||
echo "主菜单选项5的BBR管理适配了alpine的新界面"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-03-06 v2.3.3"
|
|
||||||
echo "系统工具中新增了host解析设置功能"
|
|
||||||
echo "优化了alpine系统的主机名修改逻辑"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-03-11 v2.3.4"
|
|
||||||
echo "系统工具中新增fail2banSSH防御程序,防止你的SSH被暴力破解"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-03-20 v2.3.5"
|
|
||||||
echo "面板工具加入了PVE开小鸡的面板,感谢oneclickvirt大佬的一键安装脚本"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-03-29 v2.3.6"
|
|
||||||
echo "LDNMP安装环境时提前设置1G虚拟内存,提升建站环境安装速度和稳定性"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-04-01 v2.3.7"
|
|
||||||
echo "LDNMP改进了防御能力,可以拦截404攻击,守护网站安全。脚本进入选择10再选择35站点防御,防御原来这么简单!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-04-02 v2.3.8"
|
|
||||||
echo "LDNMP站点防御接入cf,添加了cloudflare模式,添加了参数配置选项"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-04-07 v2.3.9"
|
|
||||||
echo "LDNMP申请域名证书,解决证书链不完整的问题,谢谢wuying2021分支提供思路,已整合至主线版本"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-04-12 v2.4"
|
|
||||||
echo "面板工具中添加了24选项 webtop远程桌面程序,alpine中文可视化桌面系统,很好用!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-04-14 v2.4.1"
|
|
||||||
echo "面板工具中添加Sun-Panel导航面板的安装"
|
|
||||||
echo "LDNMP建站中halo镜像版本更新到最新版本"
|
|
||||||
echo "测试脚本合集中追加了两项,nxtrace快速回程测试脚本 nxtrace指定IP回程测试脚本"
|
|
||||||
echo "测试脚本合集中追加了两项,ludashi2020的三网线路测试"
|
|
||||||
echo "测试脚本合集界面重构,分类更清晰,方便未来扩展使用"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-04-18 v2.4.2"
|
|
||||||
echo "使用docker容器方式部署fail2ban防暴力破解程序,ssh和nginx都能防御"
|
|
||||||
echo "优化了重启服务器的逻辑,增加了确认提示。"
|
|
||||||
echo "增加了dnf包管理的适配"
|
|
||||||
echo "安装BBRV3,cpu测速时将自动分配1024M的虚拟内存。"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-04-23 v2.4.3"
|
|
||||||
echo "面板工具中添加了34选项,一个文件共享平台,可以传文件传图片,做分享链接用"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-04-26 v2.4.4"
|
|
||||||
echo "面板工具中添加了33选项,一个极简朋友圈网页程序,高仿微信朋友圈!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-04-29 v2.4.5"
|
|
||||||
echo "系统工具中添加了限流关机功能,到达限定流量后自动关机,针对小流量怕反撸的机型而设计!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-04-30 v2.4.6"
|
|
||||||
echo "LDNMP建站分类调整,将不需要安装PHP就能搭建的应用移至nginx区块中,"
|
|
||||||
echo "LDNMP建站如果没装环境直接部署网站会弹出检测提示,要求先装环境再建站"
|
|
||||||
echo "缩小脚本体积,降了5kb,整合了一些老大难代码,模块化更顺畅小巧"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-05-04 v2.4.7"
|
|
||||||
echo "面板工具新增36选项,加入了对AI聚合聊天网站的安装"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-05-05 v2.4.8"
|
|
||||||
echo "LDNMP增加了自定义PHP动态站点功能,你可以上传自己的PHP项目"
|
|
||||||
echo "LDNMP站点管理中,增加了编辑查看全局和站点配置"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-05-09 v2.4.9"
|
|
||||||
echo "LDNMP静态站点动态站点自定义搭建优化,支持远程下载源码,手动上传源码"
|
|
||||||
echo "修改主机名大小写Y的支持"
|
|
||||||
echo "检测脚本添加了xykt大佬的IP质量体检脚本,非常美观实用的脚本"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-05-09 v2.4.10"
|
|
||||||
echo "更新脚本逻辑进行优化,可选择是否更新,并且显示当前和最新的版本号,更智能!"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-05-09 v2.5"
|
|
||||||
echo "重构并定义脚本中出现的红绿蓝黄灰白文字颜色,创建未来统一灵活调用文字颜色"
|
|
||||||
echo "面板工具中添加了MYIP工具箱面板,可以查看当前使用的IP信息与状态"
|
|
||||||
echo "------------------------"
|
|
||||||
echo "2024-05-11 v2.5.1"
|
|
||||||
echo "对docker环境检测进行优化,应用部署将会更稳定"
|
|
||||||
echo "对一些提示的文字颜色进行了优化,对一些警示文字进行红色黄色标注"
|
|
||||||
echo "------------------------"
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,154 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# 设置OpenSSH的版本号
|
|
||||||
OPENSSH_VERSION="9.8p1"
|
|
||||||
|
|
||||||
|
|
||||||
# 检测系统类型
|
|
||||||
if [ -f /etc/os-release ]; then
|
|
||||||
. /etc/os-release
|
|
||||||
OS=$ID
|
|
||||||
else
|
|
||||||
echo "无法检测操作系统类型。"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 等待并检查锁文件
|
|
||||||
wait_for_lock() {
|
|
||||||
while fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1; do
|
|
||||||
echo "等待dpkg锁释放..."
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# 修复dpkg中断问题
|
|
||||||
fix_dpkg() {
|
|
||||||
DEBIAN_FRONTEND=noninteractive dpkg --configure -a
|
|
||||||
}
|
|
||||||
|
|
||||||
# 安装依赖包
|
|
||||||
install_dependencies() {
|
|
||||||
case $OS in
|
|
||||||
ubuntu|debian)
|
|
||||||
wait_for_lock
|
|
||||||
fix_dpkg
|
|
||||||
DEBIAN_FRONTEND=noninteractive apt update
|
|
||||||
DEBIAN_FRONTEND=noninteractive apt install -y build-essential zlib1g-dev libssl-dev libpam0g-dev wget ntpdate -o Dpkg::Options::="--force-confnew"
|
|
||||||
;;
|
|
||||||
centos|rhel|fedora)
|
|
||||||
yum install -y epel-release
|
|
||||||
yum groupinstall -y "Development Tools"
|
|
||||||
yum install -y zlib-devel openssl-devel pam-devel wget ntpdate
|
|
||||||
;;
|
|
||||||
alpine)
|
|
||||||
apk add build-base zlib-dev openssl-dev pam-dev wget ntpdate
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "不支持的操作系统:$OS"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# 下载、编译和安装OpenSSH
|
|
||||||
install_openssh() {
|
|
||||||
wget --no-check-certificate https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${OPENSSH_VERSION}.tar.gz
|
|
||||||
tar -xzf openssh-${OPENSSH_VERSION}.tar.gz
|
|
||||||
cd openssh-${OPENSSH_VERSION}
|
|
||||||
./configure
|
|
||||||
make
|
|
||||||
make install
|
|
||||||
}
|
|
||||||
|
|
||||||
# 重启SSH服务
|
|
||||||
restart_ssh() {
|
|
||||||
case $OS in
|
|
||||||
ubuntu|debian)
|
|
||||||
systemctl restart ssh
|
|
||||||
;;
|
|
||||||
centos|rhel|fedora)
|
|
||||||
systemctl restart sshd
|
|
||||||
;;
|
|
||||||
alpine)
|
|
||||||
rc-service sshd restart
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "不支持的操作系统:$OS"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# 设置路径优先级
|
|
||||||
set_path_priority() {
|
|
||||||
NEW_SSH_PATH=$(which sshd) # 假设新版本的sshd和ssh在同一个目录
|
|
||||||
NEW_SSH_DIR=$(dirname "$NEW_SSH_PATH")
|
|
||||||
|
|
||||||
if [[ ":$PATH:" != *":$NEW_SSH_DIR:"* ]]; then
|
|
||||||
export PATH="$NEW_SSH_DIR:$PATH"
|
|
||||||
echo "export PATH=\"$NEW_SSH_DIR:\$PATH\"" >> ~/.bashrc
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# 验证更新
|
|
||||||
verify_installation() {
|
|
||||||
echo "SSH版本信息:"
|
|
||||||
ssh -V
|
|
||||||
sshd -V
|
|
||||||
}
|
|
||||||
|
|
||||||
# 清理下载的文件
|
|
||||||
clean_up() {
|
|
||||||
cd ..
|
|
||||||
rm -rf openssh-${OPENSSH_VERSION}*
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# 标题
|
|
||||||
check_openssh_test() {
|
|
||||||
echo "SSH高危漏洞修复工具"
|
|
||||||
echo "--------------------------"
|
|
||||||
}
|
|
||||||
|
|
||||||
# 检查OpenSSH版本
|
|
||||||
check_openssh_version() {
|
|
||||||
current_version=$(ssh -V 2>&1 | awk '{print $1}' | cut -d_ -f2 | cut -d'p' -f1)
|
|
||||||
|
|
||||||
# 版本范围
|
|
||||||
min_version=8.5
|
|
||||||
max_version=9.7
|
|
||||||
|
|
||||||
if awk -v ver="$current_version" -v min="$min_version" -v max="$max_version" 'BEGIN{if(ver>=min && ver<=max) exit 0; else exit 1}'; then
|
|
||||||
check_openssh_test
|
|
||||||
echo "SSH版本: $current_version 在8.5到9.7之间,需要修复。"
|
|
||||||
read -p "确定继续吗?(Y/N): " choice
|
|
||||||
case "$choice" in
|
|
||||||
[Yy])
|
|
||||||
install_dependencies
|
|
||||||
install_openssh
|
|
||||||
restart_ssh
|
|
||||||
set_path_priority
|
|
||||||
verify_installation
|
|
||||||
clean_up
|
|
||||||
|
|
||||||
;;
|
|
||||||
[Nn])
|
|
||||||
echo "已取消"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "无效的选择,请输入 Y 或 N。"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
check_openssh_test
|
|
||||||
echo "SSH版本: $current_version 不在8.5到9.7之间,无需修复。"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
check_openssh_version
|
|
||||||
-490
@@ -1,490 +0,0 @@
|
|||||||
; Start a new pool named 'www'.
|
|
||||||
; the variable $pool can be used in any directive and will be replaced by the
|
|
||||||
; pool name ('www' here)
|
|
||||||
[www]
|
|
||||||
|
|
||||||
; Per pool prefix
|
|
||||||
; It only applies on the following directives:
|
|
||||||
; - 'access.log'
|
|
||||||
; - 'slowlog'
|
|
||||||
; - 'listen' (unixsocket)
|
|
||||||
; - 'chroot'
|
|
||||||
; - 'chdir'
|
|
||||||
; - 'php_values'
|
|
||||||
; - 'php_admin_values'
|
|
||||||
; When not set, the global prefix (or NONE) applies instead.
|
|
||||||
; Note: This directive can also be relative to the global prefix.
|
|
||||||
; Default Value: none
|
|
||||||
;prefix = /path/to/pools/$pool
|
|
||||||
|
|
||||||
; Unix user/group of the child processes. This can be used only if the master
|
|
||||||
; process running user is root. It is set after the child process is created.
|
|
||||||
; The user and group can be specified either by their name or by their numeric
|
|
||||||
; IDs.
|
|
||||||
; Note: If the user is root, the executable needs to be started with
|
|
||||||
; --allow-to-run-as-root option to work.
|
|
||||||
; Default Values: The user is set to master process running user by default.
|
|
||||||
; If the group is not set, the user's group is used.
|
|
||||||
user = www-data
|
|
||||||
group = www-data
|
|
||||||
|
|
||||||
; The address on which to accept FastCGI requests.
|
|
||||||
; Valid syntaxes are:
|
|
||||||
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
|
|
||||||
; a specific port;
|
|
||||||
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
|
|
||||||
; a specific port;
|
|
||||||
; 'port' - to listen on a TCP socket to all addresses
|
|
||||||
; (IPv6 and IPv4-mapped) on a specific port;
|
|
||||||
; '/path/to/unix/socket' - to listen on a unix socket.
|
|
||||||
; Note: This value is mandatory.
|
|
||||||
listen = 127.0.0.1:9000
|
|
||||||
|
|
||||||
; Set listen(2) backlog.
|
|
||||||
; Default Value: 511 (-1 on Linux, FreeBSD and OpenBSD)
|
|
||||||
;listen.backlog = 511
|
|
||||||
|
|
||||||
; Set permissions for unix socket, if one is used. In Linux, read/write
|
|
||||||
; permissions must be set in order to allow connections from a web server. Many
|
|
||||||
; BSD-derived systems allow connections regardless of permissions. The owner
|
|
||||||
; and group can be specified either by name or by their numeric IDs.
|
|
||||||
; Default Values: Owner is set to the master process running user. If the group
|
|
||||||
; is not set, the owner's group is used. Mode is set to 0660.
|
|
||||||
;listen.owner = www-data
|
|
||||||
;listen.group = www-data
|
|
||||||
;listen.mode = 0660
|
|
||||||
|
|
||||||
; When POSIX Access Control Lists are supported you can set them using
|
|
||||||
; these options, value is a comma separated list of user/group names.
|
|
||||||
; When set, listen.owner and listen.group are ignored
|
|
||||||
;listen.acl_users =
|
|
||||||
;listen.acl_groups =
|
|
||||||
|
|
||||||
; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
|
|
||||||
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
|
|
||||||
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
|
|
||||||
; must be separated by a comma. If this value is left blank, connections will be
|
|
||||||
; accepted from any ip address.
|
|
||||||
; Default Value: any
|
|
||||||
;listen.allowed_clients = 127.0.0.1
|
|
||||||
|
|
||||||
; Set the associated the route table (FIB). FreeBSD only
|
|
||||||
; Default Value: -1
|
|
||||||
;listen.setfib = 1
|
|
||||||
|
|
||||||
; Specify the nice(2) priority to apply to the pool processes (only if set)
|
|
||||||
; The value can vary from -19 (highest priority) to 20 (lower priority)
|
|
||||||
; Note: - It will only work if the FPM master process is launched as root
|
|
||||||
; - The pool processes will inherit the master process priority
|
|
||||||
; unless it specified otherwise
|
|
||||||
; Default Value: no set
|
|
||||||
; process.priority = -19
|
|
||||||
|
|
||||||
; Set the process dumpable flag (PR_SET_DUMPABLE prctl for Linux or
|
|
||||||
; PROC_TRACE_CTL procctl for FreeBSD) even if the process user
|
|
||||||
; or group is different than the master process user. It allows to create process
|
|
||||||
; core dump and ptrace the process for the pool user.
|
|
||||||
; Default Value: no
|
|
||||||
; process.dumpable = yes
|
|
||||||
|
|
||||||
; Choose how the process manager will control the number of child processes.
|
|
||||||
; Possible Values:
|
|
||||||
; static - a fixed number (pm.max_children) of child processes;
|
|
||||||
; dynamic - the number of child processes are set dynamically based on the
|
|
||||||
; following directives. With this process management, there will be
|
|
||||||
; always at least 1 children.
|
|
||||||
; pm.max_children - the maximum number of children that can
|
|
||||||
; be alive at the same time.
|
|
||||||
; pm.start_servers - the number of children created on startup.
|
|
||||||
; pm.min_spare_servers - the minimum number of children in 'idle'
|
|
||||||
; state (waiting to process). If the number
|
|
||||||
; of 'idle' processes is less than this
|
|
||||||
; number then some children will be created.
|
|
||||||
; pm.max_spare_servers - the maximum number of children in 'idle'
|
|
||||||
; state (waiting to process). If the number
|
|
||||||
; of 'idle' processes is greater than this
|
|
||||||
; number then some children will be killed.
|
|
||||||
; pm.max_spawn_rate - the maximum number of rate to spawn child
|
|
||||||
; processes at once.
|
|
||||||
; ondemand - no children are created at startup. Children will be forked when
|
|
||||||
; new requests will connect. The following parameter are used:
|
|
||||||
; pm.max_children - the maximum number of children that
|
|
||||||
; can be alive at the same time.
|
|
||||||
; pm.process_idle_timeout - The number of seconds after which
|
|
||||||
; an idle process will be killed.
|
|
||||||
; Note: This value is mandatory.
|
|
||||||
pm = dynamic
|
|
||||||
|
|
||||||
; The number of child processes to be created when pm is set to 'static' and the
|
|
||||||
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
|
|
||||||
; This value sets the limit on the number of simultaneous requests that will be
|
|
||||||
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
|
|
||||||
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
|
|
||||||
; CGI. The below defaults are based on a server without much resources. Don't
|
|
||||||
; forget to tweak pm.* to fit your needs.
|
|
||||||
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
|
|
||||||
; Note: This value is mandatory.
|
|
||||||
pm.max_children = 10
|
|
||||||
|
|
||||||
; The number of child processes created on startup.
|
|
||||||
; Note: Used only when pm is set to 'dynamic'
|
|
||||||
; Default Value: (min_spare_servers + max_spare_servers) / 2
|
|
||||||
pm.start_servers = 3
|
|
||||||
|
|
||||||
; The desired minimum number of idle server processes.
|
|
||||||
; Note: Used only when pm is set to 'dynamic'
|
|
||||||
; Note: Mandatory when pm is set to 'dynamic'
|
|
||||||
pm.min_spare_servers = 3
|
|
||||||
|
|
||||||
; The desired maximum number of idle server processes.
|
|
||||||
; Note: Used only when pm is set to 'dynamic'
|
|
||||||
; Note: Mandatory when pm is set to 'dynamic'
|
|
||||||
pm.max_spare_servers = 5
|
|
||||||
|
|
||||||
; The number of rate to spawn child processes at once.
|
|
||||||
; Note: Used only when pm is set to 'dynamic'
|
|
||||||
; Note: Mandatory when pm is set to 'dynamic'
|
|
||||||
; Default Value: 32
|
|
||||||
;pm.max_spawn_rate = 32
|
|
||||||
|
|
||||||
; The number of seconds after which an idle process will be killed.
|
|
||||||
; Note: Used only when pm is set to 'ondemand'
|
|
||||||
; Default Value: 10s
|
|
||||||
pm.process_idle_timeout = 20s;
|
|
||||||
|
|
||||||
; The number of requests each child process should execute before respawning.
|
|
||||||
; This can be useful to work around memory leaks in 3rd party libraries. For
|
|
||||||
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
|
|
||||||
; Default Value: 0
|
|
||||||
;pm.max_requests = 500
|
|
||||||
|
|
||||||
; The URI to view the FPM status page. If this value is not set, no URI will be
|
|
||||||
; recognized as a status page. It shows the following information:
|
|
||||||
; pool - the name of the pool;
|
|
||||||
; process manager - static, dynamic or ondemand;
|
|
||||||
; start time - the date and time FPM has started;
|
|
||||||
; start since - number of seconds since FPM has started;
|
|
||||||
; accepted conn - the number of request accepted by the pool;
|
|
||||||
; listen queue - the number of request in the queue of pending
|
|
||||||
; connections (see backlog in listen(2));
|
|
||||||
; max listen queue - the maximum number of requests in the queue
|
|
||||||
; of pending connections since FPM has started;
|
|
||||||
; listen queue len - the size of the socket queue of pending connections;
|
|
||||||
; idle processes - the number of idle processes;
|
|
||||||
; active processes - the number of active processes;
|
|
||||||
; total processes - the number of idle + active processes;
|
|
||||||
; max active processes - the maximum number of active processes since FPM
|
|
||||||
; has started;
|
|
||||||
; max children reached - number of times, the process limit has been reached,
|
|
||||||
; when pm tries to start more children (works only for
|
|
||||||
; pm 'dynamic' and 'ondemand');
|
|
||||||
; Value are updated in real time.
|
|
||||||
; Example output:
|
|
||||||
; pool: www
|
|
||||||
; process manager: static
|
|
||||||
; start time: 01/Jul/2011:17:53:49 +0200
|
|
||||||
; start since: 62636
|
|
||||||
; accepted conn: 190460
|
|
||||||
; listen queue: 0
|
|
||||||
; max listen queue: 1
|
|
||||||
; listen queue len: 42
|
|
||||||
; idle processes: 4
|
|
||||||
; active processes: 11
|
|
||||||
; total processes: 15
|
|
||||||
; max active processes: 12
|
|
||||||
; max children reached: 0
|
|
||||||
;
|
|
||||||
; By default the status page output is formatted as text/plain. Passing either
|
|
||||||
; 'html', 'xml' or 'json' in the query string will return the corresponding
|
|
||||||
; output syntax. Example:
|
|
||||||
; http://www.foo.bar/status
|
|
||||||
; http://www.foo.bar/status?json
|
|
||||||
; http://www.foo.bar/status?html
|
|
||||||
; http://www.foo.bar/status?xml
|
|
||||||
;
|
|
||||||
; By default the status page only outputs short status. Passing 'full' in the
|
|
||||||
; query string will also return status for each pool process.
|
|
||||||
; Example:
|
|
||||||
; http://www.foo.bar/status?full
|
|
||||||
; http://www.foo.bar/status?json&full
|
|
||||||
; http://www.foo.bar/status?html&full
|
|
||||||
; http://www.foo.bar/status?xml&full
|
|
||||||
; The Full status returns for each process:
|
|
||||||
; pid - the PID of the process;
|
|
||||||
; state - the state of the process (Idle, Running, ...);
|
|
||||||
; start time - the date and time the process has started;
|
|
||||||
; start since - the number of seconds since the process has started;
|
|
||||||
; requests - the number of requests the process has served;
|
|
||||||
; request duration - the duration in µs of the requests;
|
|
||||||
; request method - the request method (GET, POST, ...);
|
|
||||||
; request URI - the request URI with the query string;
|
|
||||||
; content length - the content length of the request (only with POST);
|
|
||||||
; user - the user (PHP_AUTH_USER) (or '-' if not set);
|
|
||||||
; script - the main script called (or '-' if not set);
|
|
||||||
; last request cpu - the %cpu the last request consumed
|
|
||||||
; it's always 0 if the process is not in Idle state
|
|
||||||
; because CPU calculation is done when the request
|
|
||||||
; processing has terminated;
|
|
||||||
; last request memory - the max amount of memory the last request consumed
|
|
||||||
; it's always 0 if the process is not in Idle state
|
|
||||||
; because memory calculation is done when the request
|
|
||||||
; processing has terminated;
|
|
||||||
; If the process is in Idle state, then informations are related to the
|
|
||||||
; last request the process has served. Otherwise informations are related to
|
|
||||||
; the current request being served.
|
|
||||||
; Example output:
|
|
||||||
; ************************
|
|
||||||
; pid: 31330
|
|
||||||
; state: Running
|
|
||||||
; start time: 01/Jul/2011:17:53:49 +0200
|
|
||||||
; start since: 63087
|
|
||||||
; requests: 12808
|
|
||||||
; request duration: 1250261
|
|
||||||
; request method: GET
|
|
||||||
; request URI: /test_mem.php?N=10000
|
|
||||||
; content length: 0
|
|
||||||
; user: -
|
|
||||||
; script: /home/fat/web/docs/php/test_mem.php
|
|
||||||
; last request cpu: 0.00
|
|
||||||
; last request memory: 0
|
|
||||||
;
|
|
||||||
; Note: There is a real-time FPM status monitoring sample web page available
|
|
||||||
; It's available in: /usr/local/share/php/fpm/status.html
|
|
||||||
;
|
|
||||||
; Note: The value must start with a leading slash (/). The value can be
|
|
||||||
; anything, but it may not be a good idea to use the .php extension or it
|
|
||||||
; may conflict with a real PHP file.
|
|
||||||
; Default Value: not set
|
|
||||||
;pm.status_path = /status
|
|
||||||
|
|
||||||
; The address on which to accept FastCGI status request. This creates a new
|
|
||||||
; invisible pool that can handle requests independently. This is useful
|
|
||||||
; if the main pool is busy with long running requests because it is still possible
|
|
||||||
; to get the status before finishing the long running requests.
|
|
||||||
;
|
|
||||||
; Valid syntaxes are:
|
|
||||||
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
|
|
||||||
; a specific port;
|
|
||||||
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
|
|
||||||
; a specific port;
|
|
||||||
; 'port' - to listen on a TCP socket to all addresses
|
|
||||||
; (IPv6 and IPv4-mapped) on a specific port;
|
|
||||||
; '/path/to/unix/socket' - to listen on a unix socket.
|
|
||||||
; Default Value: value of the listen option
|
|
||||||
;pm.status_listen = 127.0.0.1:9001
|
|
||||||
|
|
||||||
; The ping URI to call the monitoring page of FPM. If this value is not set, no
|
|
||||||
; URI will be recognized as a ping page. This could be used to test from outside
|
|
||||||
; that FPM is alive and responding, or to
|
|
||||||
; - create a graph of FPM availability (rrd or such);
|
|
||||||
; - remove a server from a group if it is not responding (load balancing);
|
|
||||||
; - trigger alerts for the operating team (24/7).
|
|
||||||
; Note: The value must start with a leading slash (/). The value can be
|
|
||||||
; anything, but it may not be a good idea to use the .php extension or it
|
|
||||||
; may conflict with a real PHP file.
|
|
||||||
; Default Value: not set
|
|
||||||
;ping.path = /ping
|
|
||||||
|
|
||||||
; This directive may be used to customize the response of a ping request. The
|
|
||||||
; response is formatted as text/plain with a 200 response code.
|
|
||||||
; Default Value: pong
|
|
||||||
;ping.response = pong
|
|
||||||
|
|
||||||
; The access log file
|
|
||||||
; Default: not set
|
|
||||||
;access.log = log/$pool.access.log
|
|
||||||
|
|
||||||
; The access log format.
|
|
||||||
; The following syntax is allowed
|
|
||||||
; %%: the '%' character
|
|
||||||
; %C: %CPU used by the request
|
|
||||||
; it can accept the following format:
|
|
||||||
; - %{user}C for user CPU only
|
|
||||||
; - %{system}C for system CPU only
|
|
||||||
; - %{total}C for user + system CPU (default)
|
|
||||||
; %d: time taken to serve the request
|
|
||||||
; it can accept the following format:
|
|
||||||
; - %{seconds}d (default)
|
|
||||||
; - %{milliseconds}d
|
|
||||||
; - %{milli}d
|
|
||||||
; - %{microseconds}d
|
|
||||||
; - %{micro}d
|
|
||||||
; %e: an environment variable (same as $_ENV or $_SERVER)
|
|
||||||
; it must be associated with embraces to specify the name of the env
|
|
||||||
; variable. Some examples:
|
|
||||||
; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
|
|
||||||
; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
|
|
||||||
; %f: script filename
|
|
||||||
; %l: content-length of the request (for POST request only)
|
|
||||||
; %m: request method
|
|
||||||
; %M: peak of memory allocated by PHP
|
|
||||||
; it can accept the following format:
|
|
||||||
; - %{bytes}M (default)
|
|
||||||
; - %{kilobytes}M
|
|
||||||
; - %{kilo}M
|
|
||||||
; - %{megabytes}M
|
|
||||||
; - %{mega}M
|
|
||||||
; %n: pool name
|
|
||||||
; %o: output header
|
|
||||||
; it must be associated with embraces to specify the name of the header:
|
|
||||||
; - %{Content-Type}o
|
|
||||||
; - %{X-Powered-By}o
|
|
||||||
; - %{Transfert-Encoding}o
|
|
||||||
; - ....
|
|
||||||
; %p: PID of the child that serviced the request
|
|
||||||
; %P: PID of the parent of the child that serviced the request
|
|
||||||
; %q: the query string
|
|
||||||
; %Q: the '?' character if query string exists
|
|
||||||
; %r: the request URI (without the query string, see %q and %Q)
|
|
||||||
; %R: remote IP address
|
|
||||||
; %s: status (response code)
|
|
||||||
; %t: server time the request was received
|
|
||||||
; it can accept a strftime(3) format:
|
|
||||||
; %d/%b/%Y:%H:%M:%S %z (default)
|
|
||||||
; The strftime(3) format must be encapsulated in a %{<strftime_format>}t tag
|
|
||||||
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
|
|
||||||
; %T: time the log has been written (the request has finished)
|
|
||||||
; it can accept a strftime(3) format:
|
|
||||||
; %d/%b/%Y:%H:%M:%S %z (default)
|
|
||||||
; The strftime(3) format must be encapsulated in a %{<strftime_format>}t tag
|
|
||||||
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
|
|
||||||
; %u: remote user
|
|
||||||
;
|
|
||||||
; Default: "%R - %u %t \"%m %r\" %s"
|
|
||||||
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{milli}d %{kilo}M %C%%"
|
|
||||||
|
|
||||||
; A list of request_uri values which should be filtered from the access log.
|
|
||||||
;
|
|
||||||
; As a security precuation, this setting will be ignored if:
|
|
||||||
; - the request method is not GET or HEAD; or
|
|
||||||
; - there is a request body; or
|
|
||||||
; - there are query parameters; or
|
|
||||||
; - the response code is outwith the successful range of 200 to 299
|
|
||||||
;
|
|
||||||
; Note: The paths are matched against the output of the access.format tag "%r".
|
|
||||||
; On common configurations, this may look more like SCRIPT_NAME than the
|
|
||||||
; expected pre-rewrite URI.
|
|
||||||
;
|
|
||||||
; Default Value: not set
|
|
||||||
;access.suppress_path[] = /ping
|
|
||||||
;access.suppress_path[] = /health_check.php
|
|
||||||
|
|
||||||
; The log file for slow requests
|
|
||||||
; Default Value: not set
|
|
||||||
; Note: slowlog is mandatory if request_slowlog_timeout is set
|
|
||||||
;slowlog = log/$pool.log.slow
|
|
||||||
|
|
||||||
; The timeout for serving a single request after which a PHP backtrace will be
|
|
||||||
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
|
|
||||||
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
|
|
||||||
; Default Value: 0
|
|
||||||
;request_slowlog_timeout = 0
|
|
||||||
|
|
||||||
; Depth of slow log stack trace.
|
|
||||||
; Default Value: 20
|
|
||||||
;request_slowlog_trace_depth = 20
|
|
||||||
|
|
||||||
; The timeout for serving a single request after which the worker process will
|
|
||||||
; be killed. This option should be used when the 'max_execution_time' ini option
|
|
||||||
; does not stop script execution for some reason. A value of '0' means 'off'.
|
|
||||||
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
|
|
||||||
; Default Value: 0
|
|
||||||
;request_terminate_timeout = 0
|
|
||||||
|
|
||||||
; The timeout set by 'request_terminate_timeout' ini option is not engaged after
|
|
||||||
; application calls 'fastcgi_finish_request' or when application has finished and
|
|
||||||
; shutdown functions are being called (registered via register_shutdown_function).
|
|
||||||
; This option will enable timeout limit to be applied unconditionally
|
|
||||||
; even in such cases.
|
|
||||||
; Default Value: no
|
|
||||||
;request_terminate_timeout_track_finished = no
|
|
||||||
|
|
||||||
; Set open file descriptor rlimit.
|
|
||||||
; Default Value: system defined value
|
|
||||||
;rlimit_files = 1024
|
|
||||||
|
|
||||||
; Set max core size rlimit.
|
|
||||||
; Possible Values: 'unlimited' or an integer greater or equal to 0
|
|
||||||
; Default Value: system defined value
|
|
||||||
;rlimit_core = 0
|
|
||||||
|
|
||||||
; Chroot to this directory at the start. This value must be defined as an
|
|
||||||
; absolute path. When this value is not set, chroot is not used.
|
|
||||||
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
|
|
||||||
; of its subdirectories. If the pool prefix is not set, the global prefix
|
|
||||||
; will be used instead.
|
|
||||||
; Note: chrooting is a great security feature and should be used whenever
|
|
||||||
; possible. However, all PHP paths will be relative to the chroot
|
|
||||||
; (error_log, sessions.save_path, ...).
|
|
||||||
; Default Value: not set
|
|
||||||
;chroot =
|
|
||||||
|
|
||||||
; Chdir to this directory at the start.
|
|
||||||
; Note: relative path can be used.
|
|
||||||
; Default Value: current directory or / when chroot
|
|
||||||
;chdir = /var/www
|
|
||||||
|
|
||||||
; Redirect worker stdout and stderr into main error log. If not set, stdout and
|
|
||||||
; stderr will be redirected to /dev/null according to FastCGI specs.
|
|
||||||
; Note: on highloaded environment, this can cause some delay in the page
|
|
||||||
; process time (several ms).
|
|
||||||
; Default Value: no
|
|
||||||
;catch_workers_output = yes
|
|
||||||
|
|
||||||
; Decorate worker output with prefix and suffix containing information about
|
|
||||||
; the child that writes to the log and if stdout or stderr is used as well as
|
|
||||||
; log level and time. This options is used only if catch_workers_output is yes.
|
|
||||||
; Settings to "no" will output data as written to the stdout or stderr.
|
|
||||||
; Default value: yes
|
|
||||||
;decorate_workers_output = no
|
|
||||||
|
|
||||||
; Clear environment in FPM workers
|
|
||||||
; Prevents arbitrary environment variables from reaching FPM worker processes
|
|
||||||
; by clearing the environment in workers before env vars specified in this
|
|
||||||
; pool configuration are added.
|
|
||||||
; Setting to "no" will make all environment variables available to PHP code
|
|
||||||
; via getenv(), $_ENV and $_SERVER.
|
|
||||||
; Default Value: yes
|
|
||||||
;clear_env = no
|
|
||||||
|
|
||||||
; Limits the extensions of the main script FPM will allow to parse. This can
|
|
||||||
; prevent configuration mistakes on the web server side. You should only limit
|
|
||||||
; FPM to .php extensions to prevent malicious users to use other extensions to
|
|
||||||
; execute php code.
|
|
||||||
; Note: set an empty value to allow all extensions.
|
|
||||||
; Default Value: .php
|
|
||||||
;security.limit_extensions = .php .php3 .php4 .php5 .php7
|
|
||||||
|
|
||||||
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
|
|
||||||
; the current environment.
|
|
||||||
; Default Value: clean env
|
|
||||||
;env[HOSTNAME] = $HOSTNAME
|
|
||||||
;env[PATH] = /usr/local/bin:/usr/bin:/bin
|
|
||||||
;env[TMP] = /tmp
|
|
||||||
;env[TMPDIR] = /tmp
|
|
||||||
;env[TEMP] = /tmp
|
|
||||||
|
|
||||||
; Additional php.ini defines, specific to this pool of workers. These settings
|
|
||||||
; overwrite the values previously defined in the php.ini. The directives are the
|
|
||||||
; same as the PHP SAPI:
|
|
||||||
; php_value/php_flag - you can set classic ini defines which can
|
|
||||||
; be overwritten from PHP call 'ini_set'.
|
|
||||||
; php_admin_value/php_admin_flag - these directives won't be overwritten by
|
|
||||||
; PHP call 'ini_set'
|
|
||||||
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
|
|
||||||
|
|
||||||
; Defining 'extension' will load the corresponding shared extension from
|
|
||||||
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
|
|
||||||
; overwrite previously defined php.ini values, but will append the new value
|
|
||||||
; instead.
|
|
||||||
|
|
||||||
; Note: path INI options can be relative and will be expanded with the prefix
|
|
||||||
; (pool, global or /usr/local)
|
|
||||||
|
|
||||||
; Default Value: nothing is defined by default except the values in php.ini and
|
|
||||||
; specified at startup with the -d argument
|
|
||||||
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
|
|
||||||
php_flag[display_errors] = off
|
|
||||||
php_admin_value[error_log] = /var/log/fpm-php.www.log
|
|
||||||
php_admin_flag[log_errors] = on
|
|
||||||
;php_admin_value[memory_limit] = 32M
|
|
||||||
@@ -1,490 +0,0 @@
|
|||||||
; Start a new pool named 'www'.
|
|
||||||
; the variable $pool can be used in any directive and will be replaced by the
|
|
||||||
; pool name ('www' here)
|
|
||||||
[www]
|
|
||||||
|
|
||||||
; Per pool prefix
|
|
||||||
; It only applies on the following directives:
|
|
||||||
; - 'access.log'
|
|
||||||
; - 'slowlog'
|
|
||||||
; - 'listen' (unixsocket)
|
|
||||||
; - 'chroot'
|
|
||||||
; - 'chdir'
|
|
||||||
; - 'php_values'
|
|
||||||
; - 'php_admin_values'
|
|
||||||
; When not set, the global prefix (or NONE) applies instead.
|
|
||||||
; Note: This directive can also be relative to the global prefix.
|
|
||||||
; Default Value: none
|
|
||||||
;prefix = /path/to/pools/$pool
|
|
||||||
|
|
||||||
; Unix user/group of the child processes. This can be used only if the master
|
|
||||||
; process running user is root. It is set after the child process is created.
|
|
||||||
; The user and group can be specified either by their name or by their numeric
|
|
||||||
; IDs.
|
|
||||||
; Note: If the user is root, the executable needs to be started with
|
|
||||||
; --allow-to-run-as-root option to work.
|
|
||||||
; Default Values: The user is set to master process running user by default.
|
|
||||||
; If the group is not set, the user's group is used.
|
|
||||||
user = www-data
|
|
||||||
group = www-data
|
|
||||||
|
|
||||||
; The address on which to accept FastCGI requests.
|
|
||||||
; Valid syntaxes are:
|
|
||||||
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
|
|
||||||
; a specific port;
|
|
||||||
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
|
|
||||||
; a specific port;
|
|
||||||
; 'port' - to listen on a TCP socket to all addresses
|
|
||||||
; (IPv6 and IPv4-mapped) on a specific port;
|
|
||||||
; '/path/to/unix/socket' - to listen on a unix socket.
|
|
||||||
; Note: This value is mandatory.
|
|
||||||
listen = 127.0.0.1:9000
|
|
||||||
|
|
||||||
; Set listen(2) backlog.
|
|
||||||
; Default Value: 511 (-1 on Linux, FreeBSD and OpenBSD)
|
|
||||||
;listen.backlog = 511
|
|
||||||
|
|
||||||
; Set permissions for unix socket, if one is used. In Linux, read/write
|
|
||||||
; permissions must be set in order to allow connections from a web server. Many
|
|
||||||
; BSD-derived systems allow connections regardless of permissions. The owner
|
|
||||||
; and group can be specified either by name or by their numeric IDs.
|
|
||||||
; Default Values: Owner is set to the master process running user. If the group
|
|
||||||
; is not set, the owner's group is used. Mode is set to 0660.
|
|
||||||
;listen.owner = www-data
|
|
||||||
;listen.group = www-data
|
|
||||||
;listen.mode = 0660
|
|
||||||
|
|
||||||
; When POSIX Access Control Lists are supported you can set them using
|
|
||||||
; these options, value is a comma separated list of user/group names.
|
|
||||||
; When set, listen.owner and listen.group are ignored
|
|
||||||
;listen.acl_users =
|
|
||||||
;listen.acl_groups =
|
|
||||||
|
|
||||||
; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
|
|
||||||
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
|
|
||||||
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
|
|
||||||
; must be separated by a comma. If this value is left blank, connections will be
|
|
||||||
; accepted from any ip address.
|
|
||||||
; Default Value: any
|
|
||||||
;listen.allowed_clients = 127.0.0.1
|
|
||||||
|
|
||||||
; Set the associated the route table (FIB). FreeBSD only
|
|
||||||
; Default Value: -1
|
|
||||||
;listen.setfib = 1
|
|
||||||
|
|
||||||
; Specify the nice(2) priority to apply to the pool processes (only if set)
|
|
||||||
; The value can vary from -19 (highest priority) to 20 (lower priority)
|
|
||||||
; Note: - It will only work if the FPM master process is launched as root
|
|
||||||
; - The pool processes will inherit the master process priority
|
|
||||||
; unless it specified otherwise
|
|
||||||
; Default Value: no set
|
|
||||||
; process.priority = -19
|
|
||||||
|
|
||||||
; Set the process dumpable flag (PR_SET_DUMPABLE prctl for Linux or
|
|
||||||
; PROC_TRACE_CTL procctl for FreeBSD) even if the process user
|
|
||||||
; or group is different than the master process user. It allows to create process
|
|
||||||
; core dump and ptrace the process for the pool user.
|
|
||||||
; Default Value: no
|
|
||||||
; process.dumpable = yes
|
|
||||||
|
|
||||||
; Choose how the process manager will control the number of child processes.
|
|
||||||
; Possible Values:
|
|
||||||
; static - a fixed number (pm.max_children) of child processes;
|
|
||||||
; dynamic - the number of child processes are set dynamically based on the
|
|
||||||
; following directives. With this process management, there will be
|
|
||||||
; always at least 1 children.
|
|
||||||
; pm.max_children - the maximum number of children that can
|
|
||||||
; be alive at the same time.
|
|
||||||
; pm.start_servers - the number of children created on startup.
|
|
||||||
; pm.min_spare_servers - the minimum number of children in 'idle'
|
|
||||||
; state (waiting to process). If the number
|
|
||||||
; of 'idle' processes is less than this
|
|
||||||
; number then some children will be created.
|
|
||||||
; pm.max_spare_servers - the maximum number of children in 'idle'
|
|
||||||
; state (waiting to process). If the number
|
|
||||||
; of 'idle' processes is greater than this
|
|
||||||
; number then some children will be killed.
|
|
||||||
; pm.max_spawn_rate - the maximum number of rate to spawn child
|
|
||||||
; processes at once.
|
|
||||||
; ondemand - no children are created at startup. Children will be forked when
|
|
||||||
; new requests will connect. The following parameter are used:
|
|
||||||
; pm.max_children - the maximum number of children that
|
|
||||||
; can be alive at the same time.
|
|
||||||
; pm.process_idle_timeout - The number of seconds after which
|
|
||||||
; an idle process will be killed.
|
|
||||||
; Note: This value is mandatory.
|
|
||||||
pm = dynamic
|
|
||||||
|
|
||||||
; The number of child processes to be created when pm is set to 'static' and the
|
|
||||||
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
|
|
||||||
; This value sets the limit on the number of simultaneous requests that will be
|
|
||||||
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
|
|
||||||
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
|
|
||||||
; CGI. The below defaults are based on a server without much resources. Don't
|
|
||||||
; forget to tweak pm.* to fit your needs.
|
|
||||||
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
|
|
||||||
; Note: This value is mandatory.
|
|
||||||
pm.max_children = 50
|
|
||||||
|
|
||||||
; The number of child processes created on startup.
|
|
||||||
; Note: Used only when pm is set to 'dynamic'
|
|
||||||
; Default Value: (min_spare_servers + max_spare_servers) / 2
|
|
||||||
pm.start_servers = 5
|
|
||||||
|
|
||||||
; The desired minimum number of idle server processes.
|
|
||||||
; Note: Used only when pm is set to 'dynamic'
|
|
||||||
; Note: Mandatory when pm is set to 'dynamic'
|
|
||||||
pm.min_spare_servers = 5
|
|
||||||
|
|
||||||
; The desired maximum number of idle server processes.
|
|
||||||
; Note: Used only when pm is set to 'dynamic'
|
|
||||||
; Note: Mandatory when pm is set to 'dynamic'
|
|
||||||
pm.max_spare_servers = 10
|
|
||||||
|
|
||||||
; The number of rate to spawn child processes at once.
|
|
||||||
; Note: Used only when pm is set to 'dynamic'
|
|
||||||
; Note: Mandatory when pm is set to 'dynamic'
|
|
||||||
; Default Value: 32
|
|
||||||
;pm.max_spawn_rate = 32
|
|
||||||
|
|
||||||
; The number of seconds after which an idle process will be killed.
|
|
||||||
; Note: Used only when pm is set to 'ondemand'
|
|
||||||
; Default Value: 10s
|
|
||||||
pm.process_idle_timeout = 20s;
|
|
||||||
|
|
||||||
; The number of requests each child process should execute before respawning.
|
|
||||||
; This can be useful to work around memory leaks in 3rd party libraries. For
|
|
||||||
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
|
|
||||||
; Default Value: 0
|
|
||||||
;pm.max_requests = 500
|
|
||||||
|
|
||||||
; The URI to view the FPM status page. If this value is not set, no URI will be
|
|
||||||
; recognized as a status page. It shows the following information:
|
|
||||||
; pool - the name of the pool;
|
|
||||||
; process manager - static, dynamic or ondemand;
|
|
||||||
; start time - the date and time FPM has started;
|
|
||||||
; start since - number of seconds since FPM has started;
|
|
||||||
; accepted conn - the number of request accepted by the pool;
|
|
||||||
; listen queue - the number of request in the queue of pending
|
|
||||||
; connections (see backlog in listen(2));
|
|
||||||
; max listen queue - the maximum number of requests in the queue
|
|
||||||
; of pending connections since FPM has started;
|
|
||||||
; listen queue len - the size of the socket queue of pending connections;
|
|
||||||
; idle processes - the number of idle processes;
|
|
||||||
; active processes - the number of active processes;
|
|
||||||
; total processes - the number of idle + active processes;
|
|
||||||
; max active processes - the maximum number of active processes since FPM
|
|
||||||
; has started;
|
|
||||||
; max children reached - number of times, the process limit has been reached,
|
|
||||||
; when pm tries to start more children (works only for
|
|
||||||
; pm 'dynamic' and 'ondemand');
|
|
||||||
; Value are updated in real time.
|
|
||||||
; Example output:
|
|
||||||
; pool: www
|
|
||||||
; process manager: static
|
|
||||||
; start time: 01/Jul/2011:17:53:49 +0200
|
|
||||||
; start since: 62636
|
|
||||||
; accepted conn: 190460
|
|
||||||
; listen queue: 0
|
|
||||||
; max listen queue: 1
|
|
||||||
; listen queue len: 42
|
|
||||||
; idle processes: 4
|
|
||||||
; active processes: 11
|
|
||||||
; total processes: 15
|
|
||||||
; max active processes: 12
|
|
||||||
; max children reached: 0
|
|
||||||
;
|
|
||||||
; By default the status page output is formatted as text/plain. Passing either
|
|
||||||
; 'html', 'xml' or 'json' in the query string will return the corresponding
|
|
||||||
; output syntax. Example:
|
|
||||||
; http://www.foo.bar/status
|
|
||||||
; http://www.foo.bar/status?json
|
|
||||||
; http://www.foo.bar/status?html
|
|
||||||
; http://www.foo.bar/status?xml
|
|
||||||
;
|
|
||||||
; By default the status page only outputs short status. Passing 'full' in the
|
|
||||||
; query string will also return status for each pool process.
|
|
||||||
; Example:
|
|
||||||
; http://www.foo.bar/status?full
|
|
||||||
; http://www.foo.bar/status?json&full
|
|
||||||
; http://www.foo.bar/status?html&full
|
|
||||||
; http://www.foo.bar/status?xml&full
|
|
||||||
; The Full status returns for each process:
|
|
||||||
; pid - the PID of the process;
|
|
||||||
; state - the state of the process (Idle, Running, ...);
|
|
||||||
; start time - the date and time the process has started;
|
|
||||||
; start since - the number of seconds since the process has started;
|
|
||||||
; requests - the number of requests the process has served;
|
|
||||||
; request duration - the duration in µs of the requests;
|
|
||||||
; request method - the request method (GET, POST, ...);
|
|
||||||
; request URI - the request URI with the query string;
|
|
||||||
; content length - the content length of the request (only with POST);
|
|
||||||
; user - the user (PHP_AUTH_USER) (or '-' if not set);
|
|
||||||
; script - the main script called (or '-' if not set);
|
|
||||||
; last request cpu - the %cpu the last request consumed
|
|
||||||
; it's always 0 if the process is not in Idle state
|
|
||||||
; because CPU calculation is done when the request
|
|
||||||
; processing has terminated;
|
|
||||||
; last request memory - the max amount of memory the last request consumed
|
|
||||||
; it's always 0 if the process is not in Idle state
|
|
||||||
; because memory calculation is done when the request
|
|
||||||
; processing has terminated;
|
|
||||||
; If the process is in Idle state, then informations are related to the
|
|
||||||
; last request the process has served. Otherwise informations are related to
|
|
||||||
; the current request being served.
|
|
||||||
; Example output:
|
|
||||||
; ************************
|
|
||||||
; pid: 31330
|
|
||||||
; state: Running
|
|
||||||
; start time: 01/Jul/2011:17:53:49 +0200
|
|
||||||
; start since: 63087
|
|
||||||
; requests: 12808
|
|
||||||
; request duration: 1250261
|
|
||||||
; request method: GET
|
|
||||||
; request URI: /test_mem.php?N=10000
|
|
||||||
; content length: 0
|
|
||||||
; user: -
|
|
||||||
; script: /home/fat/web/docs/php/test_mem.php
|
|
||||||
; last request cpu: 0.00
|
|
||||||
; last request memory: 0
|
|
||||||
;
|
|
||||||
; Note: There is a real-time FPM status monitoring sample web page available
|
|
||||||
; It's available in: /usr/local/share/php/fpm/status.html
|
|
||||||
;
|
|
||||||
; Note: The value must start with a leading slash (/). The value can be
|
|
||||||
; anything, but it may not be a good idea to use the .php extension or it
|
|
||||||
; may conflict with a real PHP file.
|
|
||||||
; Default Value: not set
|
|
||||||
;pm.status_path = /status
|
|
||||||
|
|
||||||
; The address on which to accept FastCGI status request. This creates a new
|
|
||||||
; invisible pool that can handle requests independently. This is useful
|
|
||||||
; if the main pool is busy with long running requests because it is still possible
|
|
||||||
; to get the status before finishing the long running requests.
|
|
||||||
;
|
|
||||||
; Valid syntaxes are:
|
|
||||||
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
|
|
||||||
; a specific port;
|
|
||||||
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
|
|
||||||
; a specific port;
|
|
||||||
; 'port' - to listen on a TCP socket to all addresses
|
|
||||||
; (IPv6 and IPv4-mapped) on a specific port;
|
|
||||||
; '/path/to/unix/socket' - to listen on a unix socket.
|
|
||||||
; Default Value: value of the listen option
|
|
||||||
;pm.status_listen = 127.0.0.1:9001
|
|
||||||
|
|
||||||
; The ping URI to call the monitoring page of FPM. If this value is not set, no
|
|
||||||
; URI will be recognized as a ping page. This could be used to test from outside
|
|
||||||
; that FPM is alive and responding, or to
|
|
||||||
; - create a graph of FPM availability (rrd or such);
|
|
||||||
; - remove a server from a group if it is not responding (load balancing);
|
|
||||||
; - trigger alerts for the operating team (24/7).
|
|
||||||
; Note: The value must start with a leading slash (/). The value can be
|
|
||||||
; anything, but it may not be a good idea to use the .php extension or it
|
|
||||||
; may conflict with a real PHP file.
|
|
||||||
; Default Value: not set
|
|
||||||
;ping.path = /ping
|
|
||||||
|
|
||||||
; This directive may be used to customize the response of a ping request. The
|
|
||||||
; response is formatted as text/plain with a 200 response code.
|
|
||||||
; Default Value: pong
|
|
||||||
;ping.response = pong
|
|
||||||
|
|
||||||
; The access log file
|
|
||||||
; Default: not set
|
|
||||||
;access.log = log/$pool.access.log
|
|
||||||
|
|
||||||
; The access log format.
|
|
||||||
; The following syntax is allowed
|
|
||||||
; %%: the '%' character
|
|
||||||
; %C: %CPU used by the request
|
|
||||||
; it can accept the following format:
|
|
||||||
; - %{user}C for user CPU only
|
|
||||||
; - %{system}C for system CPU only
|
|
||||||
; - %{total}C for user + system CPU (default)
|
|
||||||
; %d: time taken to serve the request
|
|
||||||
; it can accept the following format:
|
|
||||||
; - %{seconds}d (default)
|
|
||||||
; - %{milliseconds}d
|
|
||||||
; - %{milli}d
|
|
||||||
; - %{microseconds}d
|
|
||||||
; - %{micro}d
|
|
||||||
; %e: an environment variable (same as $_ENV or $_SERVER)
|
|
||||||
; it must be associated with embraces to specify the name of the env
|
|
||||||
; variable. Some examples:
|
|
||||||
; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
|
|
||||||
; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
|
|
||||||
; %f: script filename
|
|
||||||
; %l: content-length of the request (for POST request only)
|
|
||||||
; %m: request method
|
|
||||||
; %M: peak of memory allocated by PHP
|
|
||||||
; it can accept the following format:
|
|
||||||
; - %{bytes}M (default)
|
|
||||||
; - %{kilobytes}M
|
|
||||||
; - %{kilo}M
|
|
||||||
; - %{megabytes}M
|
|
||||||
; - %{mega}M
|
|
||||||
; %n: pool name
|
|
||||||
; %o: output header
|
|
||||||
; it must be associated with embraces to specify the name of the header:
|
|
||||||
; - %{Content-Type}o
|
|
||||||
; - %{X-Powered-By}o
|
|
||||||
; - %{Transfert-Encoding}o
|
|
||||||
; - ....
|
|
||||||
; %p: PID of the child that serviced the request
|
|
||||||
; %P: PID of the parent of the child that serviced the request
|
|
||||||
; %q: the query string
|
|
||||||
; %Q: the '?' character if query string exists
|
|
||||||
; %r: the request URI (without the query string, see %q and %Q)
|
|
||||||
; %R: remote IP address
|
|
||||||
; %s: status (response code)
|
|
||||||
; %t: server time the request was received
|
|
||||||
; it can accept a strftime(3) format:
|
|
||||||
; %d/%b/%Y:%H:%M:%S %z (default)
|
|
||||||
; The strftime(3) format must be encapsulated in a %{<strftime_format>}t tag
|
|
||||||
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
|
|
||||||
; %T: time the log has been written (the request has finished)
|
|
||||||
; it can accept a strftime(3) format:
|
|
||||||
; %d/%b/%Y:%H:%M:%S %z (default)
|
|
||||||
; The strftime(3) format must be encapsulated in a %{<strftime_format>}t tag
|
|
||||||
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
|
|
||||||
; %u: remote user
|
|
||||||
;
|
|
||||||
; Default: "%R - %u %t \"%m %r\" %s"
|
|
||||||
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{milli}d %{kilo}M %C%%"
|
|
||||||
|
|
||||||
; A list of request_uri values which should be filtered from the access log.
|
|
||||||
;
|
|
||||||
; As a security precuation, this setting will be ignored if:
|
|
||||||
; - the request method is not GET or HEAD; or
|
|
||||||
; - there is a request body; or
|
|
||||||
; - there are query parameters; or
|
|
||||||
; - the response code is outwith the successful range of 200 to 299
|
|
||||||
;
|
|
||||||
; Note: The paths are matched against the output of the access.format tag "%r".
|
|
||||||
; On common configurations, this may look more like SCRIPT_NAME than the
|
|
||||||
; expected pre-rewrite URI.
|
|
||||||
;
|
|
||||||
; Default Value: not set
|
|
||||||
;access.suppress_path[] = /ping
|
|
||||||
;access.suppress_path[] = /health_check.php
|
|
||||||
|
|
||||||
; The log file for slow requests
|
|
||||||
; Default Value: not set
|
|
||||||
; Note: slowlog is mandatory if request_slowlog_timeout is set
|
|
||||||
;slowlog = log/$pool.log.slow
|
|
||||||
|
|
||||||
; The timeout for serving a single request after which a PHP backtrace will be
|
|
||||||
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
|
|
||||||
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
|
|
||||||
; Default Value: 0
|
|
||||||
;request_slowlog_timeout = 0
|
|
||||||
|
|
||||||
; Depth of slow log stack trace.
|
|
||||||
; Default Value: 20
|
|
||||||
;request_slowlog_trace_depth = 20
|
|
||||||
|
|
||||||
; The timeout for serving a single request after which the worker process will
|
|
||||||
; be killed. This option should be used when the 'max_execution_time' ini option
|
|
||||||
; does not stop script execution for some reason. A value of '0' means 'off'.
|
|
||||||
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
|
|
||||||
; Default Value: 0
|
|
||||||
;request_terminate_timeout = 0
|
|
||||||
|
|
||||||
; The timeout set by 'request_terminate_timeout' ini option is not engaged after
|
|
||||||
; application calls 'fastcgi_finish_request' or when application has finished and
|
|
||||||
; shutdown functions are being called (registered via register_shutdown_function).
|
|
||||||
; This option will enable timeout limit to be applied unconditionally
|
|
||||||
; even in such cases.
|
|
||||||
; Default Value: no
|
|
||||||
;request_terminate_timeout_track_finished = no
|
|
||||||
|
|
||||||
; Set open file descriptor rlimit.
|
|
||||||
; Default Value: system defined value
|
|
||||||
;rlimit_files = 1024
|
|
||||||
|
|
||||||
; Set max core size rlimit.
|
|
||||||
; Possible Values: 'unlimited' or an integer greater or equal to 0
|
|
||||||
; Default Value: system defined value
|
|
||||||
;rlimit_core = 0
|
|
||||||
|
|
||||||
; Chroot to this directory at the start. This value must be defined as an
|
|
||||||
; absolute path. When this value is not set, chroot is not used.
|
|
||||||
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
|
|
||||||
; of its subdirectories. If the pool prefix is not set, the global prefix
|
|
||||||
; will be used instead.
|
|
||||||
; Note: chrooting is a great security feature and should be used whenever
|
|
||||||
; possible. However, all PHP paths will be relative to the chroot
|
|
||||||
; (error_log, sessions.save_path, ...).
|
|
||||||
; Default Value: not set
|
|
||||||
;chroot =
|
|
||||||
|
|
||||||
; Chdir to this directory at the start.
|
|
||||||
; Note: relative path can be used.
|
|
||||||
; Default Value: current directory or / when chroot
|
|
||||||
;chdir = /var/www
|
|
||||||
|
|
||||||
; Redirect worker stdout and stderr into main error log. If not set, stdout and
|
|
||||||
; stderr will be redirected to /dev/null according to FastCGI specs.
|
|
||||||
; Note: on highloaded environment, this can cause some delay in the page
|
|
||||||
; process time (several ms).
|
|
||||||
; Default Value: no
|
|
||||||
;catch_workers_output = yes
|
|
||||||
|
|
||||||
; Decorate worker output with prefix and suffix containing information about
|
|
||||||
; the child that writes to the log and if stdout or stderr is used as well as
|
|
||||||
; log level and time. This options is used only if catch_workers_output is yes.
|
|
||||||
; Settings to "no" will output data as written to the stdout or stderr.
|
|
||||||
; Default value: yes
|
|
||||||
;decorate_workers_output = no
|
|
||||||
|
|
||||||
; Clear environment in FPM workers
|
|
||||||
; Prevents arbitrary environment variables from reaching FPM worker processes
|
|
||||||
; by clearing the environment in workers before env vars specified in this
|
|
||||||
; pool configuration are added.
|
|
||||||
; Setting to "no" will make all environment variables available to PHP code
|
|
||||||
; via getenv(), $_ENV and $_SERVER.
|
|
||||||
; Default Value: yes
|
|
||||||
;clear_env = no
|
|
||||||
|
|
||||||
; Limits the extensions of the main script FPM will allow to parse. This can
|
|
||||||
; prevent configuration mistakes on the web server side. You should only limit
|
|
||||||
; FPM to .php extensions to prevent malicious users to use other extensions to
|
|
||||||
; execute php code.
|
|
||||||
; Note: set an empty value to allow all extensions.
|
|
||||||
; Default Value: .php
|
|
||||||
;security.limit_extensions = .php .php3 .php4 .php5 .php7
|
|
||||||
|
|
||||||
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
|
|
||||||
; the current environment.
|
|
||||||
; Default Value: clean env
|
|
||||||
;env[HOSTNAME] = $HOSTNAME
|
|
||||||
;env[PATH] = /usr/local/bin:/usr/bin:/bin
|
|
||||||
;env[TMP] = /tmp
|
|
||||||
;env[TMPDIR] = /tmp
|
|
||||||
;env[TEMP] = /tmp
|
|
||||||
|
|
||||||
; Additional php.ini defines, specific to this pool of workers. These settings
|
|
||||||
; overwrite the values previously defined in the php.ini. The directives are the
|
|
||||||
; same as the PHP SAPI:
|
|
||||||
; php_value/php_flag - you can set classic ini defines which can
|
|
||||||
; be overwritten from PHP call 'ini_set'.
|
|
||||||
; php_admin_value/php_admin_flag - these directives won't be overwritten by
|
|
||||||
; PHP call 'ini_set'
|
|
||||||
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
|
|
||||||
|
|
||||||
; Defining 'extension' will load the corresponding shared extension from
|
|
||||||
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
|
|
||||||
; overwrite previously defined php.ini values, but will append the new value
|
|
||||||
; instead.
|
|
||||||
|
|
||||||
; Note: path INI options can be relative and will be expanded with the prefix
|
|
||||||
; (pool, global or /usr/local)
|
|
||||||
|
|
||||||
; Default Value: nothing is defined by default except the values in php.ini and
|
|
||||||
; specified at startup with the -d argument
|
|
||||||
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
|
|
||||||
php_flag[display_errors] = off
|
|
||||||
php_admin_value[error_log] = /var/log/fpm-php.www.log
|
|
||||||
php_admin_flag[log_errors] = on
|
|
||||||
;php_admin_value[memory_limit] = 32M
|
|
||||||
Reference in New Issue
Block a user