安装宝塔面板
首先购买了阿里云的学生机,服务器的系统是centos 7。通过阿里云的控制台建立远程连接。
输入命令
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh
安装宝塔面板。
在成功的提示中会有登录宝塔面板的网址、用户名和密码,登录宝塔面板后会提示要安装什么环境,选择LAMP。安装过程需要一段时间。安装完成后做一些必要的修改,如用户名、密码等。
安装Xshell和Xftp
Xshell可以远程连接服务器;Xftp可以实现和服务器的文件传输。在官网可以申请免费使用的“家庭/学校免费版”。下载安装后填写好服务器的公网ip,用户名,密码就可以登录了,两个软件的登录过程差不多。
宝塔面板的基本操作命令
宝塔面板的基本操作命令:
停止:
/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
查看宝塔日志
cat /tmp/panelBoot.pl
站点配置文件位置
/www/server/panel/vhost
删除域名绑定面板
rm -f /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
站点配置文件目录(apache)
/www/server/panel/vhost/apache
站点默认目录
/www/wwwroot
数据库备份目录
/www/backup/database
站点备份目录
/www/backup/site
站点日志
/www/wwwlogs
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
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
完整信息见宝塔linux面板命令大全