nps/docs/nps_use.md
2019-12-13 08:57:00 +08:00

58 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

**提示使用web模式时服务端执行文件必须在项目根目录否则无法正确加载配置文件**
# 服务端测试
```shell
./nps test
```
如有错误请及时修改配置文件,无错误可继续进行下去
# 服务端启动
```shell
./nps start
```
**如果无需daemon运行或者打开后无法正常访问web管理去掉start查看日志运行即可**
# web管理
进入web界面公网ip:web界面端口默认8080密码默认为123
进入web管理界面有详细的说明
# 服务端配置文件重载
如果是daemon启动
```shell
./nps reload
```
**说明:** 仅支持部分配置重载,例如`allow_user_login` `auth_crypt_key` `auth_key` `web_username` `web_password` 等,未来将支持更多
# 服务端停止或重启
如果是daemon启动
```shell
./nps stop|restart
```
# 将nps安装到系统
如果需要长期并且方便的运行nps服务端可将nps安装到操作系统中可执行命令
```
(./nps|nps.exe) install
```
安装成功后对于linuxdarwin将会把配置文件和静态文件放置于/etc/nps/并将可执行文件nps复制到/usr/bin/nps或者/usr/local/bin/nps安装成功后可在任何位置执行同时也会添加systemd配置。
```
sudo systemctl enable|disable|start|stop|restart|status nps
```
systemd带有开机自启自动重启配置当进程结束后15秒会启动日志输出至/var/log/nps/nps.log。
建议采用此方式启动能够捕获panic信息便于排查问题。
```
nps test|start|stop|restart|status
```
对于windows系统将会把配置文件和静态文件放置于C:\Program Files\nps安装成功后可将可执行文件nps.exe复制到任何位置执行
```
nps.exe test|start|stop|restart|status
```