Php
vi /lib/systemd/system/php-fpm.service
[unit]description=php-fpmafter=Network.target[service]type=Forkingexecstart =/etc/init.d/php-fpm-c/usr/local/php/etc/php.iniprivatetmp=true[Install]wantedby =multi-user.target
Nginx
vi /lib/systemd/system/nginx.service
[Unit]description=nginxafter=Network.target[service]type=Forkingexecstart= /usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.confexecreload=/usr/local/nginx/sbin/nginx- s Reloadexecstop=/usr/local/nginx/sbin/nginx-s quitprivatetmp=true[Install] Wantedby=multi-user.target
Mongodb
vi /lib/systemd/system/mongod.service
[Unit]description=mongodbafter=network.target remote-fs.target nss-Lookup.target[service] Type=forkingexecstart=/etc/init.d/mongod--dbpath/data/mongodb--logpath/usr/local/mongodb/logs-- Auth--forkexecreload=/bin/kill -s HUP $MAINPIDExecStop=/etc/init.d/mongod--dbpath/data /mongodb --shutdownprivatetmp=true[Install]wantedby=multi-user.target
Modify the value of the corresponding Execstart execreload execstop to save the
Join boot Start
Systemctl Enable Php-fpm.service
Systemctl Enable Nginx.service
Systemctl Enable Mongod.service
Centos7 php, Nginx, MongoDB boot