2019-03-28 19:44:41 +08:00
|
|
|
|
# 前端部署文档
|
|
|
|
|
|
2019-04-17 23:21:33 +08:00
|
|
|
|
前端有3种部署方式,分别为自动化部署,手动部署和编译源码部署
|
2019-04-12 11:17:42 +08:00
|
|
|
|
|
2019-04-17 23:21:33 +08:00
|
|
|
|
## 1、准备工作
|
2019-04-25 19:56:29 +08:00
|
|
|
|
#### 下载安装包
|
2019-04-12 11:17:42 +08:00
|
|
|
|
|
2019-04-26 19:54:19 +08:00
|
|
|
|
目前最新安装包版本是1.0.2,下载地址: [码云下载](https://gitee.com/easyscheduler/EasyScheduler/attach_files/)
|
2019-04-12 11:17:42 +08:00
|
|
|
|
|
2019-04-28 18:21:30 +08:00
|
|
|
|
下载 escheduler-ui-1.0.2.tar.gz 后,解压`tar -zxvf escheduler-ui-1.0.2.tar.gz ./`后,进入`escheduler-ui`目录
|
|
|
|
|
|
2019-04-12 11:17:42 +08:00
|
|
|
|
|
|
|
|
|
|
2019-03-28 19:44:41 +08:00
|
|
|
|
|
2019-04-17 23:21:33 +08:00
|
|
|
|
## 2、部署
|
|
|
|
|
以下两种方式任选其一部署即可,推荐自动化部署
|
|
|
|
|
### 2.1 自动化部署
|
2019-03-28 19:44:41 +08:00
|
|
|
|
|
2019-04-28 18:21:30 +08:00
|
|
|
|
在`escheduler-ui`目录下编辑安装文件`vi install-escheduler-ui.sh`
|
2019-04-10 17:17:02 +08:00
|
|
|
|
|
2019-04-12 09:30:40 +08:00
|
|
|
|
更改前端访问端口和后端代理接口地址
|
2019-04-10 17:17:02 +08:00
|
|
|
|
|
|
|
|
|
```
|
2019-04-12 09:30:40 +08:00
|
|
|
|
# 配置前端访问端口
|
|
|
|
|
esc_proxy="8888"
|
2019-04-10 17:17:02 +08:00
|
|
|
|
|
2019-04-12 09:30:40 +08:00
|
|
|
|
# 配置代理后端接口
|
2019-04-17 23:21:33 +08:00
|
|
|
|
esc_proxy_port="http://192.168.xx.xx:12345"
|
2019-04-10 17:17:02 +08:00
|
|
|
|
```
|
|
|
|
|
|
2019-04-28 18:21:30 +08:00
|
|
|
|
>前端自动部署基于linux系统`yum`操作,部署之前请先安装更新`yum`
|
2019-04-12 09:30:40 +08:00
|
|
|
|
|
2019-04-28 18:21:30 +08:00
|
|
|
|
在该目录下执行`./install-escheduler-ui.sh`
|
2019-04-12 09:30:40 +08:00
|
|
|
|
|
2019-04-10 17:17:02 +08:00
|
|
|
|
|
2019-04-17 23:21:33 +08:00
|
|
|
|
### 2.2 手动部署
|
2019-03-28 19:44:41 +08:00
|
|
|
|
|
|
|
|
|
安装epel源 `yum install epel-release -y`
|
|
|
|
|
|
|
|
|
|
安装Nginx `yum install nginx -y`
|
|
|
|
|
|
|
|
|
|
|
2019-04-17 23:21:33 +08:00
|
|
|
|
> #### nginx配置文件地址
|
2019-03-28 19:44:41 +08:00
|
|
|
|
```
|
2019-04-17 23:21:33 +08:00
|
|
|
|
/etc/nginx/conf.d/default.conf
|
2019-03-28 19:44:41 +08:00
|
|
|
|
```
|
2019-04-17 23:21:33 +08:00
|
|
|
|
> #### 配置信息(自行修改)
|
2019-03-28 19:44:41 +08:00
|
|
|
|
```
|
|
|
|
|
server {
|
|
|
|
|
listen 8888;# 访问端口
|
|
|
|
|
server_name localhost;
|
|
|
|
|
#charset koi8-r;
|
|
|
|
|
#access_log /var/log/nginx/host.access.log main;
|
|
|
|
|
location / {
|
2019-04-17 23:21:33 +08:00
|
|
|
|
root /xx/dist; # 上面前端解压的dist目录地址(自行修改)
|
2019-03-28 19:44:41 +08:00
|
|
|
|
index index.html index.html;
|
|
|
|
|
}
|
|
|
|
|
location /escheduler {
|
2019-04-17 23:21:33 +08:00
|
|
|
|
proxy_pass http://192.168.xx.xx:12345; # 接口地址(自行修改)
|
2019-03-28 19:44:41 +08:00
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header x_real_ipP $remote_addr;
|
|
|
|
|
proxy_set_header remote_addr $remote_addr;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
proxy_connect_timeout 4s;
|
|
|
|
|
proxy_read_timeout 30s;
|
|
|
|
|
proxy_send_timeout 12s;
|
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
|
}
|
|
|
|
|
#error_page 404 /404.html;
|
|
|
|
|
# redirect server error pages to the static page /50x.html
|
|
|
|
|
#
|
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
|
|
location = /50x.html {
|
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
> #### 重启Nginx服务
|
|
|
|
|
```
|
|
|
|
|
systemctl restart nginx
|
|
|
|
|
```
|
|
|
|
|
|
2019-04-17 23:21:33 +08:00
|
|
|
|
#### nginx命令
|
2019-03-28 19:44:41 +08:00
|
|
|
|
|
2019-04-17 23:21:33 +08:00
|
|
|
|
- 启用 `systemctl enable nginx`
|
2019-04-10 17:17:02 +08:00
|
|
|
|
|
2019-04-17 23:21:33 +08:00
|
|
|
|
- 重启 `systemctl restart nginx`
|
2019-04-10 17:17:02 +08:00
|
|
|
|
|
2019-04-17 23:21:33 +08:00
|
|
|
|
- 状态 `systemctl status nginx`
|
2019-04-12 11:17:42 +08:00
|
|
|
|
|
|
|
|
|
|
2019-04-17 23:21:33 +08:00
|
|
|
|
## 前端常见问题
|
2019-03-28 19:44:41 +08:00
|
|
|
|
#### 1. 上传文件大小限制
|
|
|
|
|
编辑配置文件 `vi /etc/nginx/nginx.conf`
|
|
|
|
|
```
|
|
|
|
|
# 更改上传大小
|
|
|
|
|
client_max_body_size 1024m
|
2019-04-26 19:54:19 +08:00
|
|
|
|
```
|