top-image

OLDER ARTICLES

Windows用户无需查看,该命令仅限Linux用户使用。

管理宝塔

停止面板服务

/etc/init.d/bt stop

启动面板服务

/etc/init.d/bt start

重启面板服务

/etc/init.d/bt restart

修复面板

/etc/init.d/bt 16

卸载面板服务

/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

修改面板端口,如要改成8881(centos 7 系统)

echo '8881' > /www/server/panel/data/port.pl && /etc/init.d/bt restart

强制修改MySQL管理(root)密码,如要改成123456

cd /www/server/panel && btpython tools.py root 123456

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

cd /www/server/panel && btpython tools.py panel 123456

查看宝塔日志

cat /www/server/panel/logs/error.log

查看软件安装日志

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 /www/server/panel/logs/error.log

查看数据库错误日志

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

  • 操作系统:仅支持Windows Server 2008 R2/2012/2016/2019/2022,64位系统(暂不支持Windows家庭环境使用)

  • 确保是干净的操作系统,没有安装过其它环境带的Apache/Nginx/php/MySQL/pgsql/gitlab/java(已有环境、网站在运行的不可安装) :-: 重要的事情提前说,重要的事情说三遍,已有环境不要安装,会影响原有网站项目、数据情况!!!

  • 旧版本不支持直接升级,因为架构不一样,7.x版本基于btpython全新开发。

  • 当前仅支持中文简体,其他语言会导致各种错误

  • 配置需求:

  • 内存:2048M以上,推荐4096M(纯面板约占用系统300M左右,另外考虑Windows系统特性)

  • 硬盘:4096M以上可用磁盘空间(纯面板约占用200M,考虑安装程序、插件等)

  • CPU:1个核心,1Ghz以上,推荐2个核心,1.5Ghz以上

  • 架构:x86_64(主流服务器均是此架构),ARM不完整兼容(面板环境安装慢,部分软件可能安装不上)

  • 注意:配置要求仅供参考,结合实际情况,面板资源占用版本更新迭代多少有一点差距,几乎可以忽略。 每个商家的Windows系统的优化不同,每个Windows版本的原始配置要求不同,建议尽量安装Windows server 2012以上的系统使用最佳。

  • 操作系统:全新的操作系统,推荐使用:Centos7.x > Debian10.+ > Ubuntu 20.04 > Centos8 stream > Ubuntu 18.04 < 其它系统 (请查看以下已兼容的操作系统列表)
  • 确保是干净的操作系统,没有安装过其它环境带的Apache/Nginx/php/MySQL/pgsql/gitlab/java (已有环境、网站在运行的不可安装)

重要的事情提前说,重要的事情说三遍,已有环境不要安装,会影响原有网站项目、数据情况!!!

  • 宝塔Linux面板最新版本是基于Centos7开发的,强烈建议使用centos7.x 系统

  • 配置需求:

  • CPU最低1核

  • 内存要求最低512MB,推荐768MB以上,纯面板约占系统60MB内存

  • 硬盘:300M以上可用硬盘空间(纯面板约占20M磁盘空间)

  • 架构:x86_64(主流服务器均是此架构),ARM不完整兼容(面板环境安装慢,部分软件可能安装不上)

/www/
├── backup  ----------------------------------->宝塔面板的备份文件目录          
│   ├── database------------------------------>宝塔面板的数据库备份目录
│   ├── panel--------------------------------->宝塔面板配置自动备份目录(6.9.32版本新添加)
│   │   └── 2019-10-16----------------------->宝塔面板配置自动备份的文件,默认是以年月日格式备份,数量为15天
│   └── site---------------------------------->宝塔面板站点备份目录
├── server------------------------------------->宝塔面板服务目录(比较关键)
│   ├── data---------------------------------->mysql数据库服务的目录
		├── xindb.cn.err----------------------->数据库错误日志文件(比较重要,数据库启动不了可以将此日志文件打开,找到最新的日志发给DBA进行分析错误)
		├── xindb.cn.pid----------------------->存放数据库pid的文件
│   ├── nginx--------------------------------->nginx的主目录
│   │   ├── client_body_temp
│   │   ├── conf----------------------------->nginx的默认配置目录
│   │   ├── fastcgi_temp
│   │   ├── html
│   │   │   ├── 50x.html
│   │   │   └── index.html
│   │   ├── logs----------------------------->nginx的日志目录
│   │   │   ├── error.log
│   │   │   └── nginx.pid
│   │   ├── off
│   │   ├── proxy_cache_dir
│   │   ├── proxy_temp_dir
│   │   ├── rpm.pl
│   │   ├── sbin
│   │   │   └── nginx----------------------->nginx的启动文件
│   │   ├── scgi_temp
│   │   ├── uwsgi_temp
│   │   ├── version.pl
│   │   └── waf
│   │       ├── config.lua
│   │       ├── init.lua
│   │       └── waf.lua
│   ├── panel--------------------------------->面板文件目录(最为重要)
│   │   ├── BTPanel
│   │   ├── class
│   │   ├── config
│   │   ├── data
│   │   ├── default.pl
│   │   ├── init.sh
│   │   ├── install-------------------------->面板软件安装脚本路径
│   │   │   ├── install_soft.sh
│   │   │   ├── lib.sh
│   │   │   ├── mysql.sh
│   │   │   ├── nginx.sh
│   │   │   ├── phpmyadmin.sh
│   │   │   ├── php.sh
│   │   │   ├── public.sh------------------->安装软件主脚本
│   │   │   └── pureftpd.sh
│   │   ├── license.txt
│   │   ├── logs------------------------------>面板日志存放目录
│   │   │   ├── access.log------------------->面板访问日志文件
│   │   │   ├── certbot.log
│   │   │   ├── error.log-------------------->面板错误日志文件
(面板打不开或者软件安装不了,可以打开这个文件将最新的日志信息发到宝塔论坛)
│   │   │   ├── panel.pid
│   │   │   ├── request
│   │   │   │   └── 2019-10-16.json
│   │   │   └── task.log
│   │   ├── rewrite--------------------------->伪静态存放目录
│   │   │   ├── apache----------------------->apache默认的伪静态规则目录
│   │   │   │   ├── dedecms.conf
│   │   │   │   ├── default.conf
│   │   │   │   ├── discuzx2.conf
│   │   │   │   ├── discuzx3.conf
│   │   │   │   ├── discuzx.conf
│   │   │   │   ├── ecshop.conf
│   │   │   │   ├── EmpireCMS.conf
│   │   │   │   ├── list.txt
│   │   │   │   ├── mvc.conf
│   │   │   │   ├── phpcms.conf
│   │   │   │   ├── phpwind.conf
│   │   │   │   ├── thinkphp.conf
│   │   │   │   ├── wordpress.conf
│   │   │   │   └── zblog.conf
│   │   │   └── nginx------------------------->nginx默认的伪静态规则存放目录
│   │   │       ├── dabr.conf
│   │   │       ├── dbshop.conf
│   │   │       ├── dedecms.conf
│   │   │       ├── default.conf
│   │   │       ├── discuz.conf
│   │   │       ├── discuzx2.conf
│   │   │       ├── discuzx3.conf
│   │   │       ├── discuzx.conf
│   │   │       ├── drupal.conf
│   │   │       ├── ecshop.conf
│   │   │       ├── emlog.conf
│   │   │       ├── EmpireCMS.conf
│   │   │       ├── laravel5.conf
│   │   │       ├── maccms.conf
│   │   │       ├── mvc.conf
│   │   │       ├── niushop.conf
│   │   │       ├── phpcms.conf
│   │   │       ├── phpwind.conf
│   │   │       ├── sablog.conf
│   │   │       ├── seacms.conf
│   │   │       ├── shopex.conf
│   │   │       ├── thinkphp.conf
│   │   │       ├── typecho2.conf
│   │   │       ├── typecho.conf
│   │   │       ├── wordpress.conf
│   │   │       ├── wp2.conf
│   │   │       └── zblog.conf
│   │   ├── runconfig.py
│   │   ├── runserver.py
│   │   ├── runserver.pyc
│   │   ├── script------------------------------>面板计划任务备份脚本目录
│   │   │   ├── backup
│   │   │   ├── backup.py
│   │   │   ├── ftp.sh
│   │   │   ├── GetOS.sh
│   │   │   ├── install.sh
│   │   │   ├── logsBackup
│   │   │   ├── logsBackup.py
│   │   │   └── rememory.sh
│   │   ├── ssl---------------------------------->面板证书目录
│   │   │   ├── certificate.pem
│   │   │   └── privateKey.pem
│   │   ├── task.py
│   │   ├── tmp
│   │   ├── tools.py
│   │   ├── tools.pyc
│   │   └── vhost-------------------------------->站点配置文件目录
│   │       ├── apache--------------------------->apache 站点配置文件目录
│   │       │   ├── 0.default.conf
│   │       │   └── xindb.cn.conf
│   │       ├── cert----------------------------->站点证书目录
│   │       ├── nginx---------------------------->nginx站点配置文件目录
│   │       │   ├── 0.default.conf
│   │       │   ├── xindb.cn.conf
│   │       │   └── phpfpm_status.conf
│   │       ├── rewrite-------------------------->站点重定向配置文件目录
│   │       │   └── xindb.cn.conf
│   │       ├── template
│   │       │   ├── apache
│   │       │   └── nginx
│   │       │       ├── anti.conf
│   │       │       ├── error_page.conf
│   │       │       ├── other.conf
│   │       │       ├── proxy.conf
│   │       │       ├── redirect.conf
│   │       │       └── ssl.conf
│   │       ├── tomcat---------------------------->tomcat站点配置文件目录
│   │       └── wafconf
│   │           ├── args
│   │           ├── blockip
│   │           ├── cookie
│   │           ├── denycc
│   │           ├── post
│   │           ├── returnhtml
│   │           ├── url
│   │           ├── user-agent
│   │           ├── whiteip
│   │           └── whiteurl
│   ├── php---------------------------------------->php安装目录
│   │   └── 54
│   ├── phpmyadmin
│   ├── pure-ftpd
├── wwwlogs----------------------------------------->站点日志目录(当站点打不开或者出错,将最新错误日志发到论坛)
│   ├── access.log
│   ├── xindb.cn.error.log
│   ├── xindb.cn.log
│   ├── nginx_error.log
│   └── waf
├── wwwroot----------------------------------------->站点根目录
│   └── xindb.cn
│       ├── 404.html
│       └── index.html

问题描述:thinkphp数据库配置’charset’ =>’utf8mb4’连接mysql,报如下错误

SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers

解决方法:在mysql服务器配置文件中[mysqld]的下面添加

character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

运行报如下错误是因为docker默认安装mysql是8.0以上最新版本,需要修改mysql密码验证规则

SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

解决方法:

#进入mysql容器
docker exec -it mysql /bin/bash
#登陆数据库
mysql -u root -p
use mysql;
#开启root远程访问权限
grant all on *.* to 'root'@'%';
#修改加密规则
alter user 'root'@'localhost' identified by '123456' password expire never;
#更新密码
alter user 'root'@'%' identified with mysql_native_password by '123456';
#刷新权限
flush privileges;

问题描述:thinkphp连接mysql,报如下错误

QLSTATE[HY000] [2054] The server requested authentication method unknown to the client

解决方法:首先参照mysql8修改加密规则,然后在mysql服务器配置文件的[mysqld]下面添加

default_authentication_plugin=mysql_native_password
  1. 请检查网站服务器是否有使用waf,如果有,尝试将云WAF服务器的IP添加到白名单中或者开启CDN,再测试是否正常?
  2. 检查云WAF到网站服务器的网络是否稳定?

运行报如下错误是因为docker安装的php-fpm是没有带pdo_mysql扩展的,需要自行安装

could not find driver

解决方法:

#进入myphp容器,安装扩展
docker exec -it myphp /bin/bash
cd /usr/local/bin/
docker-php-ext-install pdo_mysql
#退出myphp容器,重启容器
Ctrl+p+q
docker restart myphp
docker restart mynginx
  1. 请检查回源服务器的网站是否设置强制HTTPS,如果有尝试关闭,浏览器使用无痕模式再访问是否正常?
  2. 请检查回源服务器的网站配置是否存在错误的URL配置,其中一个URL重定向到另一个URL,而后者又重定向回前者,导致循环重定向。
  3. 网站的重定向(伪静态)设置可能存在问题,导致无限循环重定向。
Page 947 of 1049:« First« 944 945 946 947 948 949 950 »Last »
bottom-img