The Nginx and PHP on the server are both compiled and installed by source code. they do not have built-in service startup scripts like ubuntu, so they do not support nginx (start | restart | stop | reload. Self-help clothes and food. The following scripts are applicable to RHEL, Fedora, and CentOS. I. Nginx startup script/etc/init. d/nginx #! /Bin/bash # Nginx and PHP on the Startupscr server are both compiled and installed by source code. unlike ubuntu, there is a built-in service startup script, therefore, nginx (start | restart | stop | reload) is not supported. Self-help clothes and food. The following scripts are applicable to RHEL, Fedora, and CentOS.
I. Nginx startup script/etc/init. d/nginx
#! /Bin/bash
#
# Startup script for Nginx-this script starts and stops the nginx daemon
#
# Chkconfig:-85 15
# Description: Nginx is an HTTP (S) server, HTTP (S) reverse proxy and IMAP/POP3 proxy server
# Processname: nginx
# Config:/usr/local/nginx/conf/nginx. conf
# Pidfile:/usr/local/nginx/logs/nginx. pid
# Source function library.
./Etc/rc. d/init. d/functions
Save the edited file and run the following command:
Sudo chmod + x/etc/init. d/nginx
Sudo/sbin/chkconfig nginx on
# Check
Sudo/sbin/chkconfig -- list nginx
Nginx 0: off 1: off 2: on 3: on 4: on 5: on 6: off
Done! Run the following command to manage Nginx:
Service nginx start
Service nginx stop
Service nginx restart
Service nginx reload
#! /Bin/bash
#
# Startup script for the PHP-FPM server.
#
# Chkconfig: 345 85 15
# Description: PHP is an HTML-embedded scripting language
# Processname: php-fpm
# Config:/usr/local/php/etc/php. ini
# Source function library.
./Etc/rc. d/init. d/functions
Save the edited file and run the following command:
Sudo chmod + x/etc/init. d/php-fpm
Sudo/sbin/chkconfig php-fpm on
# Check
Sudo/sbin/chkconfig -- list php-fpm
Php-fpm 0: off 1: off 2: on 3: on 4: on 5: on 6: off
Done! You can use the following command to manage php-fpm.
Service php-fpm start
Service php-fpm stop
Service php-fpm restart
Service php-fpm reload
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.