# keentune_ui
**Repository Path**: anolis/keentune_ui
## Basic Information
- **Project Name**: keentune_ui
- **Description**: keentune-ui源码仓
- **Primary Language**: Unknown
- **License**: MulanPSL-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 9
- **Forks**: 5
- **Created**: 2022-07-05
- **Last Updated**: 2024-12-02
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
## 1. KeenTune UI 组件部署
### 方式一:使用rpm 包进行部署
如果环境没有开启yum 源(否则跳过配置源),以Anolis8环境为例,首先启用yum 的plus 源
```bash
sed -i "s/enabled=.*/enabled=1/g" /etc/yum.repos.d/AnolisOS-Plus.repo
yum clean all
yum makecache
```
然后安装ui 组件及其依赖
```bash
yum install -y httpd
yum install -y mod_ssl (用于支持https)
yum install -y keentune-ui
```
### 方式二:使用源码打包部署
```bash
# 1.拉取代码
git clone https://gitee.com/anolis/keentune_ui.git
cd keentune_ui
git checkout dev-2.1.0
# 2.安装依赖,请使用 node >= 18.0.0 版本。
yarn
# 3.打包
npm run build
```
将打包产生的build包,如将build 包放入 /usr/share/keentune/html目录下; 再在build包里面创建一个.htaccess 文件,防止/home等404。
.htaccess文件内容
```bash
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
```
## 2. 配置环境
### 修改 httpd.conf
```bash
sed -i "0,/Require all denied*/s//#Require all denied/" /etc/httpd/conf/httpd.conf
sed -i ':a;N;$!ba;s%CustomLog \"logs/access_log\" combined*%#CustomLog \"logs/access_log\" combined%' /etc/httpd/conf/httpd.conf
sed -i "s%# LoadModule foo_module modules/mod_foo.so%LoadModule ssl_module modules/mod_ssl.so%" /etc/httpd/conf/httpd.conf
sed -i "0,/LogLevel warn*/s//LogLevel crit/" /etc/httpd/conf/httpd.conf
```
### 新增配置文件 /etc/httpd/conf.d/keentune.conf 或者 /etc/httpd/conf.d/keentune-ssl.conf
(仅源码安装时需要手动执行,rpm安装无需此操作)
1. 新增 /etc/httpd/conf.d/keentune.conf
```bash
Listen 8082
ServerName localhost
ServerAlias localhost
ProxyPreserveHost On
ProxyRequests On
DocumentRoot "/usr/share/keentune/html/build"
Options FollowSymLinks
AllowOverride FileInfo
DirectoryIndex index.html
AliasMatch "^/(var|etc)/keentune(/keentuned)?(.*)$" "/$1/keentune/keentuned$3"
Require all granted
AliasMatch "^/var/log/keentune(.*)$" "/var/log/keentune$1"
Require all granted
ProxyPassMatch /(cmd|read|write) http://localhost:9871/$1
AllowOverride None
Order Deny,Allow
Allow from all
```
2. 新增 /etc/httpd/conf.d/keentune-ssl.conf
```bash
Listen 8083 https
ServerName localhost
ServerAlias localhost
ProxyPreserveHost On
ProxyRequests On
DocumentRoot "/usr/share/keentune/html/build" # 这个目录是放置UI的根目录,根据需要做调整
Options FollowSymLinks
AllowOverride FileInfo
DirectoryIndex index.html
AliasMatch "^/(var|etc)/keentune(/keentuned)?(.*)$" "/$1/keentune/keentuned$3"
Require all granted
AliasMatch "^/var/log/keentune(.*)$" "/var/log/keentune$1"
Require all granted
ProxyPassMatch /(cmd|read|write) http://localhost:9871/$1
AllowOverride None
Order Deny,Allow
Allow from all
SSLCertificateFile /etc/pki/ssl/keentune.crt
SSLCertificateKeyFile /etc/pki/ssl/keentune.key
```
## 3. 启动服务
ui 组件使用的httpd进行代理服务,直接启动httpd 即可
```bash
systemctl start httpd
```
## 4. 使用
访问:http://ip:8082 或者 https://ip:8083 即可访问keentune ui页面。
具体的使用,详见语雀《keentune 使用手册》 的 [前端UI界面操作](https://aliyuque.antfin.com/per8ai/paxfos/dsyygpw2qdg19h96) 章节的内容。