• centos 7 开机启动配置



    centos 7 开机启动


    1 开机启动配置文件位于/usr/lib/systemd/system/

    2 nginx的配置
    [Unit]
    Description=nginx - high performance web server
    After=network.target remote-fs.target nss-lookup.target

    [Service]
    Type=forking
    ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
    ExecReload=/usr/local/nginx/sbin/nginx -s reload
    ExecStop=/usr/local/nginx/sbin/nginx -s stop

    [Install]
    WantedBy=multi-user.target

    3 常用命令
    设置开机自启动
    systemctl enable nginx.service

    停止开机自启动
    systemctl disable nginx.service

    启动nginx服务
    systemctl start nginx.service

    停止nginx服务
    systemctl stop nginx.service

    查看服务当前状态
    systemctl status nginx.service

    重新启动服务
    systemctl restart nginx.service

    查看所有已启动的服务
    systemctl list-units --type=service

  • 相关阅读:
    Java注释
    加强版记事本
    Git简单使用
    Git简单使用
    Hadoop 2.6.0动态添加节点
    Hadoop 2.6.0动态添加节点
    ZooKeeper3.4.6配置
    ZooKeeper3.4.6配置
    SSH连接问题
    SSH连接问题
  • 原文地址:https://www.cnblogs.com/mingzhang/p/7562662.html
Copyright © 2020-2023  润新知