zoukankan      html  css  js  c++  java
  • centos7 php、nginx、mongodb开机启动

    php

    vi /lib/systemd/system/php-fpm.service

    [Unit]
    Description=php-fpm
    After=network.target
    [Service]
    Type=forking
    ExecStart=/etc/init.d/php-fpm -c /usr/local/php/etc/php.ini
    PrivateTmp=true
    [Install]
    WantedBy=multi-user.target


    nginx

    vi /lib/systemd/system/nginx.service

    [Unit]
    Description=nginx
    After=network.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 quit
    PrivateTmp=true
    [Install]
    WantedBy=multi-user.target

    mongodb
    vi /lib/systemd/system/mongod.service

    [Unit]
    Description=mongodb
    After=network.target remote-fs.target nss-lookup.target
    [Service]
    Type=forking
    ExecStart=/etc/init.d/mongod --dbpath /data/mongodb --logpath /usr/local/mongodb/logs --auth --fork
    ExecReload=/bin/kill -s HUP $MAINPID
    ExecStop=/etc/init.d/mongod --dbpath /data/mongodb  --shutdown
    PrivateTmp=true
    [Install]
    WantedBy=multi-user.target


    修改对应的ExecStart   ExecReload  ExecStop的值保存就可以

    加入开机启动

    systemctl enable php-fpm.service

    systemctl enable nginx.service

    systemctl enable mongod.service

  • 相关阅读:
    @override报错
    idea快捷键
    java中getAttribute与getParameter的区别
    localStorage基于浏览器的本地存储
    js画布组件(<canvas></canvas>)
    easyui
    关于Bootstrap
    使用layUI美化的登录功能
    EXT JS
    ★一些文章链接
  • 原文地址:https://www.cnblogs.com/changfengSven/p/7235315.html
Copyright © 2011-2022 走看看