安装前请先修改好配置文件

请首先执行 sudo nps stop 或者 nps.exe stop 停止运行,然后

对于linux

 sudo nps-update update

对于windows
 nps-update.exe update

sudo nps start
nps.exe start

如果无法更新成功,可以直接自行下载releases压缩包然后覆盖原有的nps二进制文件和web目录

注意:nps install 之后的 nps 不在原位置,请使用 whereis nps 查找具体目录覆盖 nps 二进制文件

./nps install
./nps start

在浏览器地址栏输入ip+port检查是否启动成功
#重启/停止服务端

./nps stop|restart

然后打开地址http://ip:8080访问管理界面,具体端口以自己修改的为准,再使用密码登录进去,默认为123。

#如果打不开Web界面,就需要开启防火墙,一般CentOS系统出现情况最多
#Centos 6系统
iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
service iptables save
service iptables restart

#CentOS 7系统

firewall-cmd --zone=public --add-port=8080/tcp --permanent 
firewall-cmd --reload

对于有些服务器,比如阿里云,谷歌云等,还需要在服务器管理面板上开放Web端口才行。

配置开机自启

然后我们开始设置服务,首先打开终端,执行命令:

vim /etc/systemd/system/nps.service

按下 i 进入编辑模式,复制以下内容并粘贴到 SSH,XShell 的快捷键是 Shift + Insert ( 键盘右上角偏左边 )

[root@nbu10:/etc/nps/conf]# vim /etc/systemd/system/nps.service
[Unit]
Description=nps server
[Service]
User=root
WorkingDirectory=/etc/nps/
LimitNOFILE=4096
PIDFile=/var/run/nps/server.pid
ExecStart=/usr/bin/nps
Restart=on-failure
StartLimitInterval=600
[Install]
WantedBy=multi-user.target

然后按 Esc,接着输入 wq 保存,如果提示保存失败就试试 wq! 注意 ! 是英文的感叹号不是中文的!感叹号。
接着输入以下命令:

systemctl daemon-reload

服务就创建成功了,接下来启动服务:

systemctl start nps
JS 复制 全屏

将服务设置为开机启动

systemctl enable nps

如果要停止运行客户端,只需要输入

systemctl stop nps

如果要禁止开机启动,输入

systemctl disable nps

然后重启服务器检验

reboot
 

https://www.88531.cn/?p=36674

www.npspro.cn软师兄
软师兄 » NPS SERVER centos下更新和注册服务自动启动
50T免费网盘资源大集合【持续更中~~~~】:点击查看