对于刚接触建站的人来说可视化管理的宝塔面板是最合适不过的了。本文以 CentOS 7.6 为例安装宝塔面板。
宝塔 (BT.CN) 是东莞市百塔网络科技有限公司旗下品牌,是一家专门从事服务器相关软件及服务研发的公司。
教程
本文以 CentOS 7.6 为例安装宝塔面板。
SSH
在SSH中输入以下代码以安装
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
输入 y 以进行下一步。

宝塔面板安装成功。

使用 SSH 提供的登录信息登录宝塔面板。

正式环境推荐使用编译安装。

安装进度会在任务列表中显示。

安装完毕。
安装要求
- 内存:512M +
- 硬盘:100M +
- 系统:CentOS 7.1 + (Ubuntu16.04 +、Debian9.0 +),纯净系统
面板特色
- 一键配置服务器环境( LAMP / LNMP )
- 一键安全重启
- 一键创建管理网站、FTP、数据库
- 一键配置(定期备份、数据导入、伪静态、301、SSL、子目录、反向代理、切换 PHP 版本)
- 一键安装常用PHP扩展(fileinfo、intl、opcache、imap、memcache、apc、redis、ioncube、imagick)
- 数据库一键导入导出
- 系统监控(CPU、内存、磁盘 IO、网络 IO)
- 防火墙端口放行
- SSH 开启 与关闭及 SSH 端口更改
- 禁 Png 开启或关闭
- 方便高效的文件管理器(上传、下载、压缩、解压、查看、编辑等等)
- 计划任务(定期备份、日志切割、Shell 脚本)
- 软件管理(一键安装、卸载、版本切换)
安装宝塔
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 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} start
停止 (请根据安装 PHP 版本号做更改,例如:/etc/init.d/php-fpm-54 stop)
/etc/init.d/php-fpm-{52|53|54|55|56|70|71} stop
重启 (请根据安装 PHP 版本号做更改,例如:/etc/init.d/php-fpm-54 restart)
/etc/init.d/php-fpm-{52|53|54|55|56|70|71} restart
启载 (请根据安装 PHP 版本号做更改,例如:/etc/init.d/php-fpm-54 reload)
/etc/init.d/php-fpm-{52|53|54|55|56|70|71} reload
配置文件 (请根据安装 PHP 版本号做更改,例如:/www/server/php/52/etc/php.ini)
/www/server/php/{52|53|54|55|56|70|71}/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
宝塔面板 搭建 云尚发卡系统 教程 – No Bug In
https://nobugin.com/bt-panel-building-yunshang-system-tutorial.html
使用宝塔面板搭建 WebStack-Laravel 教程 – No Bug In
https://nobugin.com/building-webstack-laravel-tutorial-using-bt-panel.html
[…] 宝塔面板安装教程:简单好用的 Linux / Windows 服务器管理面板 […]