宝塔迷 - 脚本命令 https://www.baota.me/script.html zh-CN 分享宝塔面板常用脚本命令 Wed, 31 Jul 2024 13:48:00 +0800 Wed, 31 Jul 2024 13:48:00 +0800 一键更换系统镜像源脚本工具 https://www.baota.me/post-450.html https://www.baota.me/post-450.html Wed, 31 Jul 2024 13:48:00 +0800 gacjie 简单介绍

由于centos7等系统EOL,但仍有不少业务运行在这些旧系统之上。
希望这个工具可以方便大家切换镜像源。
由于时间精力有限,暂时只做了centos EOL系统的脚本,其他的后续慢慢补齐。

演示截图

yum.png

脚本特性

1.自动测速,选择最快的镜像源地址。
2.一键换源,一键执行自动切换。

小广告

弘速云(hosuyun.com) 香港8C8G 仅需50元/月
【宝塔】送你10850元礼包
【腾讯云】云产品1折特惠专区
【阿里云】云产品爆款特惠

补充说明

1.旧镜像配置文件均备份在 脚本所在目录/mirror_sources/ 目录下
2.执行yum -y update命令后,配置文件会被恢复到官方源,需要再次执行脚本修改源配置文件。
3.该脚本目前还在开发中,纯小白+生产环境暂时不要使用,避免遇到未知错误。

centos_7换源脚本

curl --insecure -sSL -o centos_7.sh https://down.baota.me/project/mirror_sources/script/centos_7.sh && bash centos_7.sh

centos_8换源脚本

curl --insecure -sSL -o centos_8.sh https://down.baota.me/project/mirror_sources/script/centos_8.sh && bash centos_8.sh

centos_stream_8换源脚本

curl --insecure -sSL -o centos_stream_8.sh https://down.baota.me/project/mirror_sources/script/centos_stream_8.sh && bash centos_stream_8.sh

debian_10换源脚本

wget --no-check-certificate -qO debian_10.sh https://down.baota.me/project/mirror_sources/script/debian_10.sh && bash debian_10.sh

debian_11换源脚本

curl --insecure -sSL -o debian_11.sh https://down.baota.me/project/mirror_sources/script/debian_11.sh && bash debian_11.sh

debian_12换源脚本

curl --insecure -sSL -o debian_12.sh https://down.baota.me/project/mirror_sources/script/debian_12.sh && bash debian_12.sh
]]>
3 https://www.baota.me/post-450.html#comments https://www.baota.me/feed/script.html
CA根证书自动更新工具 https://www.baota.me/post-447.html https://www.baota.me/post-447.html Sat, 06 Jul 2024 18:37:00 +0800 gacjie 简单介绍

由于在一些开发测试时,域名没法解析,所以也不太方便申请正常的证书。
所以我写了这个工具,主要用于将自签CA证书更新到测试机的linux系统中。
同时也支持将系统CA证书库更新到最新版。
更新系统证书到最新也可以使用apt update && apt upgrade -y或yum makecache && yum update -y直接更新系统。

脚本命令

使用curl命令下载脚本

curl --insecure -sSL -o update_ca_cert.sh https://down.baota.me/system/linux/tools/update_ca_cert.sh && bash update_ca_cert.sh

使用wget命令下载脚本

wget --no-check-certificate -qO  update_ca_cert.sh https://down.baota.me/system/linux/tools/update_ca_cert.sh && bash update_ca_cert.sh

使用自签证书

1.固定文件路径
脚本默认会将/tmp/cacert.pem更新到系统中

2.指定文件
如您的文件路径为/root/cacert.pem 可以将文件路径添加到$1参数中 例子

bash update_ca_cert.sh /root/cacert.pem

更新日志

2024年07月06日
发布第一个版本

]]>
0 https://www.baota.me/post-447.html#comments https://www.baota.me/feed/script.html
堡塔日志分析系统安装命令 https://www.baota.me/post-389.html https://www.baota.me/post-389.html Wed, 04 Oct 2023 17:17:00 +0800 gacjie 简单介绍

可视化的日志查询分析系统,多主机日志汇总、存储,海量数据快速查询,
同时具备网站统计数据的可视化分析,拥有高度可扩展性,是运维和运营人员的好帮手。

演示图片

logs_analysis.webp

安装方法

使用 SSH 连接工具,如 堡塔SSH终端 连接到您的 Linux 服务器后,根据系统执行相应命令开始安装(大约2分钟完成面板安装)
注意:推荐使用Chrome、火狐、edge浏览器,国产浏览器(极速模式)

安装命令

URL=https://download.bt.cn/cloudwaf/scripts/install_cloudwaf.sh && if [ -f /usr/bin/curl ];then curl -sSO "$URL" ;else wget -O install_cloudwaf.sh "$URL";fi;bash install_cloudwaf.sh
]]>
0 https://www.baota.me/post-389.html#comments https://www.baota.me/feed/script.html
堡塔云WAF防火墙安装命令 https://www.baota.me/post-387.html https://www.baota.me/post-387.html Wed, 04 Oct 2023 17:11:48 +0800 gacjie 简单介绍

基于宝塔面板10年行业积累,打造的免费私有云WAF防火墙,有效拦截sql注入、xss、一句话木马、防采集等常见渗透攻击,为您的业务网站保驾护航。

演示图片

btwaf.webp

安装方法

使用 SSH 连接工具,如 堡塔SSH终端 连接到您的 Linux 服务器后,根据系统执行相应命令开始安装(大约2分钟完成面板安装)
注意:推荐使用Chrome、火狐、edge浏览器,国产浏览器(极速模式)

安装命令

URL=https://download.bt.cn/cloudwaf/scripts/install_cloudwaf.sh && if [ -f /usr/bin/curl ];then curl -sSO "$URL" ;else wget -O install_cloudwaf.sh "$URL";fi;bash install_cloudwaf.sh
]]>
0 https://www.baota.me/post-387.html#comments https://www.baota.me/feed/script.html
宝塔linux面板服务管理命令 https://www.baota.me/post-276.html https://www.baota.me/post-276.html Mon, 06 Mar 2023 15:15:00 +0800 gacjie 卸载面板
/etc/init.d/bt stop && chkconfig --del bt && rm -f /etc/init.d/bt && rm -rf /www/server/panel

卸载脚本

wget http://download.bt.cn/install/bt-uninstall.sh && bash bt-uninstall.sh

重装面板环境

rm -rf /www/server/panel/pyenv && curl https://download.bt.cn/install/update_panel.sh|bash

检查nginx网站劫持木马

curl -sSO -k https://download.bt.cn/tools/w_check.py && btpython w_check.py && rm -rf w_check.py

堡塔命令行工具箱 (仅限6.x以上版本的面板,5.x以下版本请点击右侧目录 - 旧版本管理宝塔)

bt

重启面板

bt 1

停止面板

bt 2

启动面板

bt 3

重载面板

bt 4

修改面板密码 (交互式,执行命令后回车输入新的面板密码即可,推荐密码规则:大小写字母,数字,特殊符号)

bt 5

修改面板用户名 (交互式,执行命令后回车输入新的面板用户名即可,推荐用户名规则:大小写字母,数字,特殊符号)

bt 6

修改数据库密码

bt 7

修改面板使用端口

bt 8

清除面板缓存

bt 9

清除面板登录限制

bt 10

取消域名绑定限制

bt 12

取消IP访问限制

bt 13

查看面板默认登录信息

bt 14

清理系统垃圾

bt 15

修复面板

bt 16

设置日志切割是否压缩 (默认开启,执行第一次bt 17是关闭日志压缩,再执行一次是开启日志压缩)

bt 17

设置是否自动备份面板 (默认开启,执行第一次bt 18是关闭面板自动备份,再执行一次是开启面板自动备份)

bt 18

显示面板错误日志

bt 22

关闭BasicAuth认证

bt 23

关闭动态口令认证

bt 24

设置是否保存文件历史副本 (默认开启,执行第一次bt 25是关闭文件副本功能,再执行一次是开启文件副本功能)

bt 25

关闭面板静态文件加速

rm -rf /www/server/panel/plugin/static_cdn/ && bt restart

开启面板离线模式

echo "True" >/www/server/panel/data/not_network.pl

关闭面板离线模式

rm -rf /www/server/panel/data/not_network.pl && bt restart
]]>
0 https://www.baota.me/post-276.html#comments https://www.baota.me/feed/script.html
宝塔面板修复命令 https://www.baota.me/post-242.html https://www.baota.me/post-242.html Fri, 03 Mar 2023 13:28:45 +0800 gacjie 宝塔面板修复命令其实是官方提供的更新命令,对文件进行覆盖更新。

堡塔命令行工具箱 修复面板

bt 16

普通修复命令(更新面板文件)

curl https://download.bt.cn/install/update_panel.sh|bash

重装环境修复(重装环境并更新面板文件)

rm -rf /www/server/panel/pyenv && curl https://download.bt.cn/install/update_panel.sh|bash
]]>
0 https://www.baota.me/post-242.html#comments https://www.baota.me/feed/script.html
宝塔linux面板Memcached服务管理命令 https://www.baota.me/post-284.html https://www.baota.me/post-284.html Sun, 01 Jan 2023 17:01:00 +0800 gacjie memcached安装目录
/usr/local/memcached

启动

/etc/init.d/memcached start

停止

/etc/init.d/memcached stop

重启

/etc/init.d/memcached restart

启载

/etc/init.d/memcached reload
]]>
0 https://www.baota.me/post-284.html#comments https://www.baota.me/feed/script.html
宝塔linux面板Redis服务管理命令 https://www.baota.me/post-283.html https://www.baota.me/post-283.html Sun, 01 Jan 2023 17:00:00 +0800 gacjie redis安装目录
/www/server/redis

启动

/etc/init.d/redis start

停止

/etc/init.d/redis stop

redis配置文件

/www/server/redis/redis.conf
]]>
0 https://www.baota.me/post-283.html#comments https://www.baota.me/feed/script.html
宝塔linux面板FTP服务管理命令 https://www.baota.me/post-281.html https://www.baota.me/post-281.html Sun, 01 Jan 2023 16:56:00 +0800 gacjie ftp安装目录
/www/server/pure-ftpd

启动

/etc/init.d/pure-ftpd start

停止

/etc/init.d/pure-ftpd stop

重启

/etc/init.d/pure-ftpd restart

ftp配置文件

/www/server/pure-ftpd/etc/pure-ftpd.conf
]]>
0 https://www.baota.me/post-281.html#comments https://www.baota.me/feed/script.html
宝塔linux面板PHP服务管理命令 https://www.baota.me/post-282.html https://www.baota.me/post-282.html Sun, 01 Jan 2023 16:56:00 +0800 gacjie php安装目录
/www/server/php

启动 (请根据安装PHP版本号做更改,例如:/etc/init.d/php-fpm-54 start)

/etc/init.d/php-fpm-{52|53|54|55|56|70|71|72|73|74} start

停止 (请根据安装PHP版本号做更改,例如:/etc/init.d/php-fpm-54 stop)

/etc/init.d/php-fpm-{52|53|54|55|56|70|71|72|73|74} stop

重启 (请根据安装PHP版本号做更改,例如:/etc/init.d/php-fpm-54 restart)

/etc/init.d/php-fpm-{52|53|54|55|56|70|71|72|73|74} restart

启载 (请根据安装PHP版本号做更改,例如:/etc/init.d/php-fpm-54 reload)

/etc/init.d/php-fpm-{52|53|54|55|56|70|71|72|73|74} reload

配置文件 (请根据安装PHP版本号做更改,例如:/www/server/php/52/etc/php.ini)

/www/server/php/{52|53|54|55|56|70|71|72|73|74}/etc/php.ini
]]>
0 https://www.baota.me/post-282.html#comments https://www.baota.me/feed/script.html