虽然目前宝塔面板开始收费,但是免费版本功能还是够用的。至少目前还没有其他相对好的免费面板替换,所以如果希望使用在Linux服务器可视化面板,还是建议使用宝塔面板的。云计算优惠在平时有帮助网友解决有服务器中安装宝塔面板的问题时候,有需要查看宝塔面板特定的脚本命令。
所以,在这篇文章中将宝塔面板常用的脚本整理出来,这样下次不用再去搜索。其实我们在做任何事情的时候,记忆力或者不想记,可以记录下来,以便以后使用的时候直接寻找文档。
第一、宝塔面板安装
Centos安装脚本
yums 5 / h c 2 | c ! install -y wget && wget -O install.sh http://download.bt.cn/install/` ` [ t K p w #install.sh && sh install.sh
Ubuntu/Deepx h R 4 } g pin安装脚本
wget -O install.sh http://download.bt.cn/install/install-ubuntu.sh &T z d Y n S Qamp;&b f ] sudo bash install.sh
Debian安装脚本
wget -O install.sh http://download.bt.cn/installg L | 9 1/install-x ~ _ n ( V Iubuntu.sh && bash install.sh
Fedora安装脚本
wgz ? v %et -O install.sh http://download * C + * 8 P . :d.bt.cn/install/install.sh && bash install.sh
第二、宝塔面板管理
停止
/etv Y z + . k 8 :c/init.d/bt stop
启动
/etc/init.d/bt start
重启
/etc/init.d/bt restart
卸载
/etc/init.d/bt stop &K 3 o O 1;& chkconfig --del bt && rm -f /etc/init.d/bt && rm -rf /www/serd 1 ^ver/panel
查看当前面板端口
cat /www/server/panel/data/port.pl
修改面, : b ; &板端口,如要改成8881(centos 6 系统)
echo '8881' > /www/server/panel/data/port.pl &&a^ [ m X P / pmp; /etc/init.d/bt restart iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 8881 -# 7 9 d O [ Oj ACCEPT service iptables save service iptables restart
修改面板端口,如要改成8881(centos 7 系统)
echo '8881' > /www/server/panel/. s 2 ; 4 N 8 :data/port.pl &T / y .;&amH T L Q 7 ) _p; /etc/init.d/bt restao 0 s = ~ 0ry = % E * { ~ e Zt firewall-cmd --G C ? rpermanent --zone=public --add-port=8881/tcp firewall-cmd --reload
强制修改MySQL管理(root)密码,如! S 2 n X G N |要改成123456
cd /www/server/panel && python tools.pyc root 123456
修改面板密码,如要改成123456
cd /www: @ k w p o i/server/panel && pythonf F n # R P ] K tools.pyc panel 123N 2 = f456
查看宝塔日志
cat /tmp/panelBoot.pl
查看软件安装日志
cat /tmp/panelExec.log
站点配置W u u ! i文件位置
/www/server/panel/vhost
删除域名绑定面板
rm -f /www/servK $ V 8 : s qer/panel/? A / o 6 )data/domain.conf
清理登陆限制
rm -f /www/server/panelx G N ( 6 d/data/*.login
查看面- z U = 5 ` !板授权IP
cat /www/serverD 0 = v 5/panel/data/limP o ]itip.conf
关闭访问限制
rm -f /www/server/pat Q & f %nel/data/limitip.conf
查看许可域名
cat /www/serverv 3 0 7 2 v i 3 u/panel/data/domain.conf
关闭面板SSL
rm -f /wwwB L a x J/server/panel/data/ssl.pl && /etc/init.d/bt restL 7 8 A Hart
查看面板错误日志
cat /tmp/panelBoot
查看数据库错误日志
cat /www/server/data/*.err
站点配置文件目录(nginx)
/www/server/panel/) ( q Ivho* x . c z d & / Gst/n k K , uginx
站点配置文件目录(apache)
/www/server/pai I wnel/vhost/apache
站点默认目录
/www/wwwroot
数据库备份目录
/www/backup/database
站点备份目录
/www/backup/site
站 u 3 Q )点日志
/www/wwwlogs
第三、Nginx服务器管理
nginx安装目录
/www/server/nginx
启动
/e6 v ut{ l !c/init.d/nginx start- A D : H * j
停止
/etc/init.d/ngJ . l | N * ~ j :inx stop
重启
/etc/init.d/nginx reY [ 7 a fstart
启载
/etc/init.d/nginx reload
nginx配置文件
/www/server/nginx/conf/nginx.c= A n x k l 2 Wonf
第四、Apache服务管理
apache安装_ B ^ O L )目: 5 n Z `录
/www/server/htt8 , ^ s n ) | Tpd
启动
/etc/init.d/httpd start
停止
/etc/init.d/httpd stop
重启
/etc/init.d/httpd restart
启载
/etc/init.d/httpdi 8 ] j g reload
apache配置文件
/wwC p Q G b ^ z Lw/server/apache/conf/httpd.conf
第五、MySQL数据库管理
mysql安装目录
/www/serv_ U $ p S U 6 3er/mysql
phpmyadmN g A Ein安装目录
/www/server/phpmyadmin
数据存储目录
/www/server/I % a Kdata
启动
/etc/init.d/mysqld start
停止
/etc/init.d/mysqld stop
重启
/etc/init.d/@ b ` rmysn Q U eqld restart
启载
/etc/init.d/mysqld reload
mysql配置文件
/et5 ) : c l : k cc/my.cnfa y #
第六、FTP管理
ftp安装目录
/www/server/pure-ftpd
启动
/etc/init.d/pure-ftpd start
停止
/etc/init.d/pure-ftpd stop
重启
/etc/init.d/pure-ftpd reo $ V n T N Sstart
ftp配置文件
/www/servet p N 3 # : ) |r/pure-ftpd/etc/pure-ftM ! apd.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版本号做更改,例7 # i l o O w如:/etc/init.d/php-fpm-54 restart)
/etc/init.d/php-fpm-{52|53|m C ^ ( c m y R54|55|56|70|71} restart
启载(请m 5 h 6 _根据安装PHP版本号做更改,例如:/etc/init.d/php-fpm-54 reload)
/etc/init.d/php-fpm-{52|53|54|55|56|70|71} reload
配置文件(请根据安装PHP版本号做更改,例如:/www/serv} A Q l 3er/phw z A 6 up/52/etc/php.5 j e t | ,ini)
/www/server/php/{52|53|54|55|56|70|71}/etc/php.ini
第八、Redis服务管理
redis安装目录
/www/server/redis
启动
/etc/init.d/redis starL - 6 B E J / gt
停止
/etc/init.d/redis stop
redis配置文件
/www/server/redis/redis.conf
第九、Memcached服务管理
memcached安装目录
/usr/local/memcached
启动
/etc/init.& L Ld/memcached start
停止
/etc/init.d/memcached stop
重启
/etc/init.d/memcached restart
启载
/etc/init.H ! ( R / zd/memcached reload
这样,有些常用的命令记不住就记录下来,需要的时候直接打开文档。
发表评论