• NPS centos下注册服务自动启动


    然后启动服务端:
    cd /nps

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

    请首先执行 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

    将服务设置为开机启动

    systemctl enable nps

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

    systemctl stop nps

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

    systemctl disable nps

    然后重启服务器检验

    reboot
     
  • 相关阅读:
    希尔排序
    插入排序
    Unity创建一个简易的弹簧(弹动)效果
    看到个美到爆的菜单,忍不住扒下来~
    用avalon实现一个完整的todomvc(带router)
    页面动态加入<script>标签并执行代码
    一个简单粗暴的前后端分离方案
    常用的HTML5、CSS3新特性能力检测写法
    犀利的background-clip:text,实现K歌字幕效果
    用canvas开发H5游戏小记
  • 原文地址:https://www.cnblogs.com/TImeroot/p/16291086.html
Copyright © 2020-2023  润新知