1、安装宝塔
官网:https://www.bt.cn/download/linux.html
命令:yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
有时候无法访问的原因是防火墙端口未开
防火墙关闭Centos7:systemctl stop firewalld
开放端口:https://blog.youkuaiyun.com/yanzanjie2018/article/details/109145102
firewall-cmd --zone=public --add-port=8888/tcp --permanent
2、使用
在安装完后会有一个URL,这是是带权值的地址
打开后在面板中安装一个nginx后可使用,上传只需要打包前端上传就可,然后配置好相关配置就可
server
{
listen 8881;
listen 12457;
listen 80;
server_name 192.168.31.XXX 192.168.253.XXX;
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/192.168.253.XXX;
location / {
root /www/wwwroot/192.168.253.XXX/XXX_ui/;
}
location /XXX_ui/ {
alias /www/wwwroot/192.168.253.XXX/XXX_ui/;
index index.html;
}
#添加跳转配置
location ~* ^/(code|auth|admin|gen|daemon|tx|job|act|common|party|command|crowd|work|project|region|external|event|patrol|mp|veteran|rpa-robot)
{
proxy_pass http://192.168.253.XXX:9999;
proxy_connect_timeout 25s;
proxy_send_timeout 25s;
proxy_read_timeout 25s;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~* ^/(minio)
{
proxy_pass http://192.168.253.XXX:9000;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
这样就可以访问了