Nginx start, stop, restart, config file check

Source: Internet
Author: User

nginx Start command

1, the first method format : Ngin address-C nginx configuration file location

A. Command/usr/local/nginx/sbin/nginx-c /usr/local/nginx/conf/nginx.conf

2, Nginx Stop Command (3 methods 2 ways)

A, calmly stop need to know the process number

To view the Nginx Process number command: Ps-ef|grep nginx only need to see the master's process number

Stop command Kill-quit process number

B, fast stop kill-term process number or kill-int process number

C, forced stop pkill-9 Nginx

3.nginx Restart command

Sometimes we reboot because we modified the Conf file, so we need to verify that the configuration file is correct before rebooting.

A, the first method of restart

Enter the sbin directory command cd/usr/local/nginx/sbin

Restart the command./nginx-s Reload

B. Restart the second method

Restart command Kill-hup process number

4. Verify that the configuration file is the correct command:

A, method one

       /usr/local/nginx/sbin/nginx-t-C /usr/local/nginx/ conf/nginx.conf

B. Enter the sbin directory command cd/usr/local/nginx/sbin

The validation command is./nginx-t

The XXXXXX is OK indicates the configuration file is not a problem


Nginx start, stop, restart, config file check

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.