跳转到主要内容

Linux安装

下载

前往https://github.com/helloxz/GoPower/releases下载您对应操作系统的最新版本并解压到任意目录。

安装

进入GoPower所在目录下,执行下面的命令(需要root权限):

#添加执行权限
chmod +x GoPower
#初始化GoPower
./GoPower init

修改配置文件

配置文件在当前目录下的config.ini内容如下:

[servers]
port = :886
RunMode = debug
webui = off

[infos]
key = xxxxxxxx
  • port = :886运行端口,默认为886端口,可自行修改
  • RunMode = debug是调试模式,正式环境建议改成release
  • webui = off是否开启WEBUI,一般情况下多台内网计算机安装了GoPower的情况下只需要一台机器开启WEBUI即可
  • key = xxxxxxxx密钥参数,这个请务必设置一个复杂的字符串,后续调用接口需要

放行端口

请根据自身使用的防火墙放行GoPower所使用的监听端口(默认886

#如果使用的firewalld
firewall-cmd --zone=public --add-port=886/tcp --permanent
firewall-cmd --reload
#如果使用的ufw
ufw allow 886

启动GoPower

#启动
systemctl start gopower
#停止
systemctl stop gopower
#重启
systemctl restart gopower
#查看状态
systemctl status gopower
#设置开机启动
systemctl enable gopower

访问

如果您配置中开启了WEBUI,访问http://localhost:886/会看到WEB界面