centos7 phpnginxmongodb开机启动
Posted 长风
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7 phpnginxmongodb开机启动相关的知识,希望对你有一定的参考价值。
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
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
mongodbvi /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
以上是关于centos7 phpnginxmongodb开机启动的主要内容,如果未能解决你的问题,请参考以下文章