代码拉取完成,页面将自动刷新
如果环境没有开启yum 源(否则跳过配置源),以Anolis8环境为例,首先启用yum 的plus 源
sed -i "s/enabled=.*/enabled=1/g" /etc/yum.repos.d/AnolisOS-Plus.repo
yum clean all
yum makecache
然后安装ui 组件及其依赖
yum install -y httpd
yum install -y mod_ssl (用于支持https)
yum install -y keentune-ui
# 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文件内容
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
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
(仅源码安装时需要手动执行,rpm安装无需此操作)
Listen 8082
<VirtualHost *:8082>
ServerName localhost
ServerAlias localhost
ProxyPreserveHost On
ProxyRequests On
DocumentRoot "/usr/share/keentune/html/build"
<Directory "/usr/share/keentune/html/build">
Options FollowSymLinks
AllowOverride FileInfo
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
AliasMatch "^/(var|etc)/keentune(/keentuned)?(.*)$" "/$1/keentune/keentuned$3"
<DirectoryMatch "/(var|etc)/keentune/keentuned">
Require all granted
</DirectoryMatch>
AliasMatch "^/var/log/keentune(.*)$" "/var/log/keentune$1"
<DirectoryMatch "/var/log/keentune">
Require all granted
</DirectoryMatch>
ProxyPassMatch /(cmd|read|write) http://localhost:9871/$1
<proxy http://localhost:9871/(cmd|read|write)>
AllowOverride None
Order Deny,Allow
Allow from all
</proxy>
</VirtualHost>
Listen 8083 https
<VirtualHost *:8083>
ServerName localhost
ServerAlias localhost
ProxyPreserveHost On
ProxyRequests On
DocumentRoot "/usr/share/keentune/html/build" # 这个目录是放置UI的根目录,根据需要做调整
<Directory "/usr/share/keentune/html/build">
Options FollowSymLinks
AllowOverride FileInfo
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
AliasMatch "^/(var|etc)/keentune(/keentuned)?(.*)$" "/$1/keentune/keentuned$3"
<DirectoryMatch "/(var|etc)/keentune/keentuned">
Require all granted
</DirectoryMatch>
AliasMatch "^/var/log/keentune(.*)$" "/var/log/keentune$1"
<DirectoryMatch "/var/log/keentune">
Require all granted
</DirectoryMatch>
ProxyPassMatch /(cmd|read|write) http://localhost:9871/$1
<proxy http://localhost:9871/(cmd|read|write)>
AllowOverride None
Order Deny,Allow
Allow from all
</proxy>
SSLCertificateFile /etc/pki/ssl/keentune.crt
SSLCertificateKeyFile /etc/pki/ssl/keentune.key
</VirtualHost>
ui 组件使用的httpd进行代理服务,直接启动httpd 即可
systemctl start httpd
访问:http://ip:8082 或者 https://ip:8083 即可访问keentune ui页面。 具体的使用,详见语雀《keentune 使用手册》 的 前端UI界面操作 章节的内容。
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。