当前位置:首页 » 好文分享 » 详情

    Bt(宝塔面板)常用命令大全

    Bt(宝塔面板)的面板很好用,但是我们不排除面板出现问题,不能登陆,这种情况我们就只能利用ssh登陆来输入命令解决很多的问题,博客之家这里收罗了一点常用命令,不过我看到他们官方也是有的。博客之家这里也就是记录一下,方便自己平时查阅。

    一:安装宝塔

    宝塔Linux面板5.9(稳定版)安装命令:

    Centos安装脚本

    yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh

    Ubuntu/Deepin安装脚本

    wget -O install.sh http://download.bt.cn/install/install-ubuntu.sh && sudo bash install.sh

    Debian安装脚本

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

    Fedora安装脚本

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

    二:管理宝塔面板

    停止面板

    /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.pyc root 123456

    修改面板密码,如要改成123456

    cd /www/server/panel && python tools.pyc 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} start

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

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

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

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

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

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

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

    /www/server/php/{52|53|54|55|56|70|71|72}/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

    十:Linux面板6.X安装命令

    Centos安装命令:

    yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh

    Ubuntu/Deepin安装命令:

    wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh

    Debian安装命令:

    wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh

    Fedora安装命令:

    wget -O install.sh http://download.bt.cn/install/install_6.0.sh && bash install.sh

    十一:5.x平滑升级到6.x命令

    curl http://download.bt.cn/install/update_to_6.sh|bash

    注意:

    1、Centos6请勿执行此升级命令,仅限于Centos7系统平滑升级

    2、升级过程耗时较长且可能会受网络因素影响导致升级失败

    3、如果升级后无法正常启动面板,请重新执行升级命令

    4、升级有一定的风险,生产环境请谨慎升级

    十二:宝塔面板卸载命令

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

    卸载教程:宝塔面板(linux)卸载的一些方法的整理以及卸载之后一些文件的删除

    十三:更新证书

    "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh"

    强制更新所有let证书

    "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" --force

    十四:提示ip地址获取失败

    面板绑定宝塔账号提示ip地址获取失败:

    echo "125.88.182.170 www.bt.cn" >> /etc/hosts

    十五:bt命令

    宝塔面板新增快捷命令,SSH中输入bt直接调出来16个小工具,其中包括重启面板、修改面板密码、修改MYSQL密码、取消绑定域名限制等。
    打赏
    X
    打赏方式:
    • 支付宝
    • 微信
    • QQ红包

    打开支付宝扫一扫
    日期:2019年05月06日 15:14:07 星期一   分类:好文分享   浏览(35885)   评论(1)
    本文地址:https://www.blogs.hk/post-4405.html   [百度已收录]
    声明:本页信息由网友自行发布或来源于网络,真实性、合法性由发布人负责,请仔细甄别!本站只为传递信息,我们不做任何双方证明,也不承担任何法律责任。文章内容若侵犯你的权益,请联系本站删除!
    版权所有:《博客之家
    文章标题:《Bt(宝塔面板)常用命令大全
    除非注明,文章均为 《博客之家》 原创
    转载请注明本文短网址:https://www.blogs.hk/post-4405.html  [生成短网址]

    留言咨询

    自动获取QQ

    昵称

    邮箱

    网址

        站点统计

        • 收录网址:3370 个
        • 发布文章:3008 条
        • 在线人数:1人
        • 总访问量:270553448次
        • 本站运行:12年5月3天
        Copyright © 2025 博客之家 版权所有  
        關於本站免責聲明sitemap新站登錄