宝塔面板 9.2.0 安装命令

Centos安装命令:根据系统执行框内命令开始安装(大约2分钟完成面板安装)


yum install -y wget && wget -O install.sh https://yun.iwmyx.cn/bt9/installoss.sh && bash install.sh

yum install -y wget && wget -O install.sh https://y.cdn.iwmyx.cn/baota/installoss.sh && bash install.sh

yum install -y wget && wget -O install.sh https://yun.iwmyx.cn/bt9/install.sh && bash install.sh

# 修改centos 源

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
 
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

yum clean all
yum makecache
sudo yum update

yum clean all &&  yum makecache &&  yum update -y
yum install -y wget && yum install -y ca-certificates && yum install -y unzip && yum install -y vim
#清理history的命令
history -c && history -w
yum install -y wget && wget -O install.sh http://v820.hostcli.com/install/install_6.0.sh && sh install.sh    
        

 yum install -y wget && wget -O install.sh https://yun.iwmyx.cn/bt9/installoss.sh && bash install.sh
 yum install -y wget && wget -O install.sh https://yun.iwmyx.cn/bt9/install.sh && bash install.sh
 yum install -y wget && wget -O install.sh https://yun.iwmyx.cn/bt/install8.sh && bash install.sh
 yum install -y wget && wget -O install.sh https://yun.iwmyx.cn/bt/install.sh && bash install.sh
 yum install -y wget && yum install -y ca-certificates
 wget -O install.sh https://y.cdn.iwmyx.cn/baota/install.sh && bash install.sh
 yum install -y wget && wget -O install.sh https://yun.iwmyx.cn/ltd/install/install_6.0.sh && sh install.sh
       
 yum install -y wget && wget -O install.sh https://yun.iwmyx.cn/install/install_6.0.sh && sh install.sh
       
 yum install -y wget && wget -O install.sh http://v820.hostcli.com/install/install_6.0.sh && sh install.sh
       
 yum install -y wget && wget -O install.sh http://v7.hostcli.com/install/install_6.0.sh && sh install.sh
       
 yum install -y wget && wget -O install.sh http://io.bt.sy/install/install_6.0.sh && sh install.sh
       
 
       yum install -y wget && wget -O install.sh http://v920.hostcli.com/install/install_6.0.sh && sh install.sh
       
       # 9.2.0通用/万能安装脚本 (推荐)
       if [ -f /usr/bin/curl ];then curl -sSO http://v920.hostcli.com/install/install_6.0.sh;else wget -O install_6.0.sh http://v920.hostcli.com/install/install_6.0.sh;fi;bash install_6.0.sh www.HostCLi.com
       
       
 
       # 8.x版本升级宝塔纯净版9.2.0
        if [ -f /usr/bin/curl ];then curl -sSO http://v920.hostcli.com/install/install_6.0.sh;else wget -O install_6.0.sh http://v920.hostcli.com/install/install_6.0.sh;fi;bash install_6.0.sh www.HostCLi.com
       
       
 
       wget -O install.sh http://f.cccyun.cc/bt/install_6.0.sh && bash install.sh
       
       cd /www/server/panel/BTPanel/ 
       wget https://y.cdn.iwmyx.cn/baota/wmyxtemp.tar.gz 
       tar -zxf wmyxtemp.tar.gz -C /www/server/panel/BTPanel/
       rm -f wmyxtemp.tar.gz 
       
       
       cd /www/server/panel/BTPanel/ 
       wget https://y.cdn.iwmyx.cn/baota/yffstemp.zip
       unzip yffstemp.zip -d /www/server/panel/BTPanel/
       rm -f yffstemp.zip
       
       
       cd /www/server/panel/BTPanel/ 
       wget https://y.cdn.iwmyx.cn/baota/yffsstatic.tar.gz
       wget https://devimg.chem960.com/files/bt/yffsstatic.tar.gz
       tar -zxf yffsstatic.tar.gz -C /www/server/panel/BTPanel/
       rm -f yffsstatic.tar.gz
       
       yum install -y wget && wget -O install.sh http://www.aapanel.com/script/install_6.0_en.sh && bash install.sh forum
       
       // 下载docker-ce的yum源
       sudo wget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
       // 安装Docker
       sudo yum -y install docker-ce
       // 启动Docker服务,并设置开机自启动
       sudo systemctl start docker
       sudo systemctl enable docker
       // 查看Docker是否启动
       sudo systemctl status docker
       # 查看docker版本
       docker -v

       // 安装1panel
       curl -sSL https://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && sh quick_start.sh

       
        //Linux面板 8.0.2 升级企业版命令 1(所有官方版 / 开心版 包括低版本 都可以执行这个升级到 8.0.2 开心版):
        curl https://io.bt.sy/install/update_panel.sh|bash
        //Linux面板 8.0.2 升级企业版命令 2(所有官方版 / 开心版 包括低版本 都可以执行这个升级到 8.0.2 开心版):
        curl http://io.bt.sy/install/update6.sh|bash
       

试验性Centos/Ubuntu/Debian安装命令 独立运行环境(py3.7) 可能存在少量兼容性问题 不断优化中:极速安装方式 (安装时间1至10分钟)

curl -sSO https://yun.iwmyx.cn/install/install_panel.sh && bash install_panel.sh

异常处理


            # 修改centos 源
            /*
            Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
            14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"
            */
            
            # 1. 备份当前的CentOS-Base.repo
            mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
             
            # 2. 下载新的CentOS源配置文件到/etc/yum.repos.d/
            # 以阿里云源为例
            curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
            
            # 阿里云
            wget -O /etc/yum.repos.d/CentOS-Aliyun.repo http://mirrors.aliyun.com/repo/Centos-7.repo
            
            # 华为云
            curl -o /etc/yum.repos.d/CentOS-Huawei.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo 

            # 清华
            curl -o /etc/yum.repos.d/CentOS-tsinghua.repo https://devimg.chem960.com/files/gcc/tsinghua.repo
            curl -o /etc/yum.repos.d/CentOS-tsinghua.repo https://y.cdn.iwmyx.cn/soft/tsinghua.repo
            
            # 3. 清除缓存并生成新的缓存
            yum clean all
            yum makecache
            
            # 4. 更新源包
            sudo yum update
			
	yum clean all &&  yum makecache &&  yum update

	yum install -y wget && yum install -y ca-certificates && yum install -y unzip && yum install -y vim
            
            # 5. 常用工具
            yum install -y git
            yum install -y dnf
            dnf install -y unzip
            yum install -y git
            yum install -y bzip2
        

解除面板时间限制

依次进入 /www/server/panel/data/ 目录,然后双击编辑 plugin.json 文件
Ctrl + F 打开搜索框
查找:"endtime": -1
替换为:"endtime": 1751299200
点击全部替换按钮
查找:is_user_status
点击查找按钮
请移动 查找/替换 窗口,防止窗口盖住查找内容
观察查找内容,代码颜色不太明显,需详细查看
关闭 查找/替换 窗口
将 “ltd”: -1 和 “pro”: -1 这两个 -1 都改为 0
解释:ltd 是企业版,pro 是专业版;-1 表示暂无授权,0 表示专业版永久授权 时间戳: 7258086000 表示2199-12-31
时间戳: 1751299200 表示 2025-7-1
Ctrl + S 保存内容,关闭编辑器即可
回到执行命令部分 复制命令 直接回车即可
添加保护
chattr +i /www/server/panel/data/plugin.json
解除保护
chattr -i /www/server/panel/data/plugin.json

Ubuntu/Deepin安装命令:极速安装方式 (安装时间1至10分钟)

wget -O install.sh https://yun.iwmyx.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh

Debian安装命令:极速安装方式 (安装时间1至10分钟)

wget -O install.sh https://yun.iwmyx.cn/install/install-ubuntu_6.0.sh && bash install.sh

Fedora安装命令:极速安装方式 (安装时间1至10分钟)

wget -O install.sh https://yun.iwmyx.cn/install/install_6.0.sh && bash install.sh

已经安装面板

Linux面板7.7.0升级命令:极速安装方式 (安装时间1至10秒)

 curl https://yun.iwmyx.cn/install/update6.sh|bash
        

收费版Nginx防火墙脚本

收费Nginx防火墙(面板先安装在执行脚本):

直接面板安装防火墙使用,不在出现不显示拦截问题,不需要在配合bt命令!

Apache防火墙脚本

收费Apache防火墙(面板先安装在执行脚本):

直接面板安装防火墙使用,不在出现不显示拦截问题,不需要在配合bt命令!

管理宝塔

宝塔工具箱(包含下列绝大部分功能 直接ssh中执行bt命令 仅限6.x以上版本面板)
bt
停止
/etc/init.d/bt stop
启动
/etc/init.d/bt start
重启
/etc/init.d/bt restart
卸载
/etc/init.d/bt stop && chkconfig --del bt && rm -f /etc/init.d/bt && rm -rf /www/server/panel
查看当前面板端口
cat /www/server/panel/data/port.pl
修改面板端口,如要改成8881(centos 6 系统)
echo '8881' > /www/server/panel/data/port.pl && /etc/init.d/bt restart
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 8881 -j ACCEPT
service iptables save
service iptables restart
修改面板端口,如要改成8881(centos 7 系统)
echo '8881' > /www/server/panel/data/port.pl && /etc/init.d/bt restart
firewall-cmd --permanent --zone=public --add-port=8881/tcp
firewall-cmd --reload
强制修改MySQL管理(root)密码,如要改成123456
cd /www/server/panel && python tools.py root 123456
修改面板密码,如要改成123456
cd /www/server/panel && python tools.py panel 123456
查看宝塔日志
cat /tmp/panelBoot.pl
查看软件安装日志
cat /tmp/panelExec.log
站点配置文件位置
/www/server/panel/vhost
删除域名绑定面板
rm -f /www/server/panel/data/domain.conf
清理登陆限制
rm -f /www/server/panel/data/*.login
查看面板授权IP
cat /www/server/panel/data/limitip.conf
关闭访问限制
rm -f /www/server/panel/data/limitip.conf
查看许可域名
cat /www/server/panel/data/domain.conf
关闭面板SSL
rm -f /www/server/panel/data/ssl.pl && /etc/init.d/bt restart
查看面板错误日志
cat /tmp/panelBoot
查看数据库错误日志
cat /www/server/data/*.err
站点配置文件目录(nginx)
/www/server/panel/vhost/nginx
站点配置文件目录(apache)
/www/server/panel/vhost/apache
站点默认目录
/www/wwwroot
数据库备份目录
/www/backup/database
站点备份目录
/www/backup/site
站点日志
/www/wwwlogs

Nginx服务管理

nginx安装目录
/www/server/nginx
启动
/etc/init.d/nginx start
停止
/etc/init.d/nginx stop
重启
/etc/init.d/nginx restart
启载
/etc/init.d/nginx reload
nginx配置文件
/www/server/nginx/conf/nginx.conf

Apache服务管理

apache安装目录
/www/server/httpd
启动
/etc/init.d/httpd start
停止
/etc/init.d/httpd stop
重启
/etc/init.d/httpd restart
启载
/etc/init.d/httpd reload
apache配置文件
/www/server/apache/conf/httpd.conf

MySQL服务管理

mysql安装目录
/www/server/mysql
phpmyadmin安装目录
/www/server/phpmyadmin
数据存储目录
/www/server/data
启动
/etc/init.d/mysqld start
停止
/etc/init.d/mysqld stop
重启
/etc/init.d/mysqld restart
启载
/etc/init.d/mysqld reload
mysql配置文件
/etc/my.cnf

FTP服务管理

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

PHP服务管理

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

Redis服务管理

redis安装目录
/www/server/redis
启动
/etc/init.d/redis start
停止
/etc/init.d/redis stop
redis配置文件
/www/server/redis/redis.conf

Memcached服务管理

memcached安装目录
/usr/local/memcached
启动
/etc/init.d/memcached start
停止
/etc/init.d/memcached stop
重启
/etc/init.d/memcached restart
启载
/etc/init.d/memcached reload
绕过宝塔强制绑定宝塔账号
sed -i "s|bind_user == 'True'|bind_user == 'XXXX'|" /www/server/panel/BTPanel/static/js/index.js

https://www.hostcli.com/ http://v7.hostcli.com/install/update/LinuxPanel-7.9.0.zip

https://support.hostcli.com/ 宝塔纯净版 8.2.0版本

http://download.fenhao.me/

https://fenhao.me

CentOS 8 上安装软件时,遇到如下报错:

CentOS Linux 8 – AppStream 错误:为仓库 ‘appstream’ 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist

         cd /etc/yum.repos.d
         ls
         wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
         yum makecache
     
         {"uid": 1000, "address": "1.1.1.1", "access_key": "N5LeYU6cadsdasdasdUfKYnOrh8dj8p", "secret_key": "yrCSQAnQRzVvYnWq1fsafasfsadfsdaOGH7ST9pBt76Oxo555J", "addtime": 1625384382, "username": "13988889999", "idc_code": "", "serverid": "85080fb76a4045b70aef409a38576710c5e7cd86e37668fc5bd6935b938f41cf"}
     

Ubuntu 特殊安装:

       
       # 复制所有命令粘贴到终端
sudo su
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
iptables-save
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh ed8484bec
btpip install gevent
btpip install flask
btpip install gevent-websocket
btpip install psutil
wget https://raw.githubusercontent.com/MBRjun/btpanel-v7.7.0/main/install/install_panel.sh
bash install_panel.sh
sed -i "s|if (bind_user == 'True') {|if (bind_user == 'REMOVED') {|g" /www/server/panel/BTPanel/static/js/index.js
btpip install requests
rm install_panel.sh

     

CentOS 配置IP地址网关:

        //1、配置IP地址网关
cd /etc/sysconfig/network-scripts/    //进入到network-scripts目录下  
 
vi ifcfg-ens33  //注意:显示有ip addr查看,编辑对应的ensxx
 
//修改以下内容
BOOTPROTO=static  //启用静态IP地址
ONBOOT=yes      //开启自动启用网络连接
 
 
//添加vmnet8的子网掩码和网关,ip要保证在192.168.126.x,还要保证唯一性
IPADDR=192.168.126.124    //设置IP地址
NETMASK=255.255.255.0   //子网掩码
GATEWAY=192.168.126.2   //设置网关


//2、设置DNS地址
vi /etc/resolv.conf    //编辑 resolv.conf文件 
search localdomain
nameserver 192.168.1.1
nameserver 114.114.114.114   //添加DNS地址

//3、重启网卡

systemctl restart network

     

无法验证 yun.iwmyx.cn 的由 “/C=US/O=Let's Encrypt/CN=R3” 颁发的证书: 颁发的证书已经过期。

 
      yum install -y wget && yum install -y ca-certificates && wget -O install.sh https://yun.iwmyx.cn/bt/install.sh && bash install.sh
     
 
     # SSH登录的命令行工具
     yum install -y sshpass
     # 举例
     sshpass -p '密码' ssh -o StrictHostKeyChecking=no root@192.168.1.110 
     sshpass -p '密码' ssh -o StrictHostKeyChecking=no root@192.168.1.110  "cd /k8s/wordpress && kubectl set image -n default deployment wordpress-www-deployment app-wordpress-www=star.cn-hangzhou.personal.cr.aliyuncs.com/web/wordpress:$image_tag && kubectl get pod,svc"
     
     

将gcc/g++ 升级为14.2 版本

 
     #将gcc/g++ 升级为14.2 版本
     wget https://devimg.chem960.com/files/gcc/gcc-14.2.0.tar.gz
     tar -zxvf gcc-14.2.0.tar.gz
     rm -rf gcc-14.2.0.tar.gz
     cd gcc-14.2.0 
     
     yum install -y bzip2
     yum install -y m4
     yum install -y gmp-devel
     
     
     
     ./contrib/download_prerequisites
     
     wget  -O download https://devimg.chem960.com/files/gcc/download
     chmod 755 download
     ./download
     ll
     
     
     #编译依赖项
     # -j8为当前服务器每颗物理CPU中的核心数,以实际为准。 make -j$(nproc) 所有可用的 CPU 核心
     
     cd gettext-0.22/
    ./configure --prefix=/usr/local/gettext-0.22
    make -j8 && make install
    
    cd ../gmp-6.2.1/
    ./configure --prefix=/usr/local/gmp-6.2.1
    # 提示error: m4 not found
    # yum install -y m4
    make -j8 && make install
    
    cd ../mpfr-4.1.0
    ./configure --prefix=/usr/local/mpfr-4.1.0 --with-gmp=/usr/local/gmp-6.2.1
    make -j8 && make install
    
    cd ../mpc-1.2.1
    ./configure --prefix=/usr/local/mpc-1.2.1 --with-gmp=/usr/local/gmp-6.2.1 --with-mpfr=/usr/local/mpfr-4.1.0
    make -j8 && make install
    
    cd ../isl-0.24
    ./configure --prefix=/usr/local/isl-0.24  --with-gmp=/usr/local/gmp-6.2.1
    
    # 提示error: gmp.h header not found
    # yum install -y gmp-devel
    make -j8 && make install
    
    rm gettext-0.22 -rf && rm gmp-6.2.1 -rf && rm mpfr-4.1.0 -rf && rm mpc-1.2.1 -rf && rm isl-0.24 -rf

    # 编译安装GCC
    ## 编译前还需要老版本的gcc/g++ : 
    ### yum install -y gcc 
    ### yum install -y gcc-c++
    cd ../
    mkdir build && cd build
    ../configure --prefix=/usr/local/gcc-14.2.0 --with-gmp=/usr/local/gmp-6.2.1 --with-mpfr=/usr/local/mpfr-4.1.0 --with-mpc=/usr/local/mpc-1.2.1 --with-isl=/usr/local/isl-0.24 --with-gettext=/usr/local/gettext-0.22 --enable-threads=posix --enable--long-long --enable-languages=c,c++ --disable-checking --disable-multilib
     
    make -j 8 && make install
     
      
    gcc --version
    g++ -v && gcc -v
    
    ## 异常处理
    
    # ./gcc/cc1plus: error while loading shared libraries: libisl.so.23: cannot open shared object file: No such file or directory
# 共享库找不到,是因为当前安装目录不在扫描范围内
sudo ln -s /usr/local/isl-0.24/lib/libisl.so.23.1.0 /usr/lib64/libisl.so.23 && sudo ln -s /usr/local/mpfr-4.1.0/lib/libmpfr.so.6.1.0 /usr/lib64/libmpfr.so.6
# 其他找不到问题解决方式相同
yum -y remove gcc gcc-c++	# 安装前卸载原来的GCC
make install