宝塔面板nginx和apache (宝塔nginx是不是只能php使用)

宝塔面板 - 便捷、高效和安全的服务器站点运维面板

安装面板

  1. CentOS安装脚本
yum install ‐y wget && wget ‐O install.sh http://download.bt.cn/install/install.sh && sh install.sh
  1. Ubuntu/Deepin安装脚本
wget ‐O install.sh http://download.bt.cn/install/install‐ubuntu.sh && sudo bash install.sh
  1. Debian 安装脚本
wget ‐O install.sh http://download.bt.cn/install/install‐ubuntu.sh && bash install.sh
  1. Fedora 安装脚本
wget ‐O install.sh http://download.bt.cn/install/install.sh && bash install.sh

管理面板

  1. 启动
/etc/init.d/bt start
  1. 重启
/etc/init.d/bt restart
  1. 停止
/etc/init.d/bt stop
  1. 卸载
/etc/init.d/bt stop && chkconfig ‐‐del bt && rm ‐f /etc/init.d/bt && rm ‐rf /www/server/panel
  1. 查看面板端口
cat /www/server/panel/data/port.pl
  1. 修改面板端口
  • CentOS 6 下修改成 8881 端口
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
  • CentOS 7 下修改成 8881 端口
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
  1. 强制修改 MySQL 管理(root)密码,如要改成 123456
cd /www/server/panel && python tools.pyc root 123456
  1. 修改面板密码,如要改成123456
cd /www/server/panel && python tools.pyc panel 123456
  1. 删除域名绑定面板
rm ‐f /www/server/panel/data/domain.conf
  1. 清理面板登录限制
rm ‐f /www/server/panel/data/*.login
  1. 关闭访问限制
rm ‐f /www/server/panel/data/limitip.conf
  1. 关闭面板SSL
rm ‐f /www/server/panel/data/ssl.pl && /etc/init.d/bt restart
  1. 相关文件位置
  • 站点配置文件位置:/www/server/panel/vhost
  • nginx站点配置文件位置:/www/server/panel/vhost/nginx
  • apache站点配置文件位置:/www/server/panel/vhost/apache
  • 站点默认目录:/www/wwwroot
  • 数据库备份目录:/www/backup/database
  • 站点备份目录:/www/backup/site
  • 面板授权IP位置:/www/server/panel/data/limitip.conf
  • 许可域名位置:/www/server/panel/data/domain.conf
  • 面板日志位置:/tmp/panelBoot.pl
  • 软件安装日志位置:/tmp/panelExec.log
  • 数据库错误日志位置:/www/server/data/*.err
  • 错误日志位置:/tmp/panelBoot
  • 站点日志位置:/www/wwwlogs

Nginx 服务管理

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

Apache 服务管理

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

MySQL 服务管理

  1. 安装位置:/www/server/mysql
  2. phpmyadmin安装目录:/www/server/phpmyadmin
  3. 数据库存放目录:/www/server/data
  4. 启动
/etc/init.d/mysqld start
  1. 重启
/etc/init.d/mysqld restart
  1. 停止
/etc/init.d/mysqld stop
  1. 重新载入配置文件
/etc/init.d/mysqld reload
  1. 配置文件位置:/etc/my.cnf

FTP 服务管理

  1. 安装目录:/www/server/pure‐ftpd
  2. 启动
/etc/init.d/pure‐ftpd start
  1. 重启
/etc/init.d/pure‐ftpd restart
  1. 停止
/etc/init.d/pure‐ftpd stop
  1. 配置文件位置:/www/server/pure‐ftpd/etc/pure‐ftpd.conf

PHP 服务管理

  1. 安装目录:/www/server/php
  2. 启动
/etc/init.d/php‐fpm‐{52|53|54|55|56|70|71} start
  1. 重启
/etc/init.d/php‐fpm‐{52|53|54|55|56|70|71} restart
  1. 停止
/etc/init.d/php‐fpm‐{52|53|54|55|56|70|71} stop
  1. 重新载入配置文件
/etc/init.d/php‐fpm‐{52|53|54|55|56|70|71} reload
  1. 配置文件位置:/www/server/php/{52|53|54|55|56|70|71}/etc/php.ini

Redis 服务管理

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

Memcached 服务管理

  1. 安装目录:/usr/local/memcached
  2. 启动
/etc/init.d/memcached start
  1. 重启
/etc/init.d/memcached restart
  1. 停止
/etc/init.d/memcached stop
  1. 重新载入配置文件
/etc/init.d/memcached reload