Research on the configuration and deployment of high performance Web server Nginx (4) Nginx common commands

Source: Internet
Author: User

1. Start Nginx
[email protected]:sudo ./sbin/nginx
2. Stop Nginx
[email protected]:sudo ./sbin/nginx -s stop[email protected]:sudo ./sbin/nginx -s quit

-sIs the way to send a signal to Nginx.

3. Nginx Reload Configuration
[email protected]:sudo ./sbin/nginx -s reload

This is the way to send a signal to Nginx, or use:

[email protected]:service nginx reload
4. Specify the configuration file
[email protected]:sudo ./sbin/nginx -c /usr/local/nginx/conf/nginx.conf

-cIndicates configuration that the configuration file is specified.

5. View Nginx Version

There are two parameters that can be used to view Nginx version information. The first of these is as follows:

[email protected]:/usr/local/nginx$ ./sbin/nginx -vnginx: nginx version: nginx/1.0.0

Another type of display is the detailed version information:

[email protected]:/usr/local/nginx$ ./sbin/nginx -Vnginx: nginx version: nginx/1.0.0nginx: built by gcc 4.3.3 (Ubuntu 4.3.3-5ubuntu4) nginx: TLS SNI support enablednginx: configure arguments: --with-http_ssl_module --with-openssl=/home/luming/openssl-1.0.0d/
6. Check that the configuration file is correct
 [email protected]:/usr/local/nginx$./sbin/nginx-tnginx: [alert] could not open error log file:open () "/usr/local /nginx/logs/error.log "failed (13:permission denied) nginx:the configuration file/usr/local/nginx/conf/nginx.conf Syntax is ok2012/01/09 16:45:09 [Emerg] 23898#0:open () "/usr/local/nginx/logs/nginx.pid" failed (13:permission denied) n Ginx:configuration file/usr/local/nginx/conf/nginx.conf test Failed  

sudo (super user do ):

[email protected]:/usr/local/nginx$ sudo ./sbin/nginx -tnginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is oknginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

If shown above, the configuration file is correct. Otherwise, there will be hints.

7. Display Help information
[email protected]:/user/local/nginx$ ./sbin/nginx -h

Or:

[email protected]:/user/local/nginx$ ./sbin/nginx -?

These cover all the basic operations of Nginx routine maintenance, as well as the related commands that send signals to the master process, which we will see later.

Research on the configuration and deployment of high performance Web server Nginx (4) Nginx common commands

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.