(因为之前我的服务器安装了环境,所以需要先格式化)
1.格式化阿里云的服务器磁盘。
2.找到实例磁盘-》重新初始化磁盘
![](https://img-blog.csdnimg.cn/img_convert/f77cc00a0bf747bd960d50b92601bd93.png)
![](https://img-blog.csdnimg.cn/img_convert/f9135930914a4b079410c893e3e9846b.png)
3.在服务器的安全组件-》安全组-
4.进入安全组规则页面,添加安全组规则
![](https://img-blog.csdnimg.cn/img_convert/891ceb02c1144103948a4c6a7e042cb4.png)
5.配置宝塔需要的8888端口还有其他的所需要的一些端口
![](https://img-blog.csdnimg.cn/img_convert/d96889658b684439a333dece6817cfc0.png)
6.配置完成后,远程链接工具(xshell,putty都行)链接虚拟机
![](https://img-blog.csdnimg.cn/img_convert/8e7221915faa4286843e0a7d22ff516f.png)
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh
8.安装完成会自动显示宝塔的登陆账号和密码,然后登陆宝塔
9.配置宝塔的一些相关信息
10.等到IP后面的数变为0,就结束了
![](https://img-blog.csdnimg.cn/img_convert/fc5acb82c7b04a2b9958055d60c70100.png)
常见错误:
问题情况,站点正常,但是时不时会找不到站点
![](https://img-blog.csdnimg.cn/img_convert/9cb5b322d6b44e928ba350f4f9b92049.png)
解决方法:
输入3条命令:
/etc/init.d/httpd stop
pkill -9 httpd
/etc/init.d/httpd start
LNMP TP 宝塔 require(): open_basedir restriction in effect,解决方法:关闭防跨站攻击。
![](https://img-blog.csdnimg.cn/img_convert/84e76763e8e04501b20c4c721c0ff244.png)