Install nginx-1.6.2 under centos7 (64-bit)

Source: Internet
Author: User
Tags openssl library
: This article mainly introduces centos7 (64-bit) under the installation of nginx-1.6.2, for PHP tutorials interested in students can refer. Centos 64-bit for linux

Step 1: Download the corresponding version from http://nginx.org/download/( or wget http://nginx.org/download/nginx-1.5.9.tar.gzdirectly on linux)

Step 2: unzip tar-zxvf nginx-1.5.9.tar.gz

Step 3: Set the configuration information./configure -- prefix =/usr/local/nginx, or do not execute this step.

Step 4:

Make compilation (The make process is to convert source code files written in various languages into executable files and various library files)

Make install (make install copies the compiled executable files and library files to appropriate places)

When configuring information, that is, in step 3, an error occurs:


Error:./configure: error: the HTTP rewrite module requires the PCRE library.

Install pcre-devel to solve the problem
Yum-y install pcre-devel

It is also possible that:


Install zlib-devel to solve the problem
Yum-y install zlib-devel

It is also possible that:

Error message:./configure: error: the HTTP cache module requires md5 functions
From OpenSSL library. You can either disable the module by using
-- Without-http-cache option, or install the OpenSSL library into the system,
Or build the OpenSSL library statically from the source with nginx by using
-- With-http_ssl_module -- with-openssl = Options.

Solution:

Yum-y install openssl-devel

After installation, start and disable nginx in linux:

Start operation

/Usr/nginx/sbin/nginx (/usr/nginx/sbin/nginx-t to check whether the configuration information is correct)

Web interface: http: // 192.168.189.136: 80/

Stop operation
The stop operation is performed by sending a signal to the nginx process (for more information about the signal, see The linux chapter ).
Step 1: query the nginx master process number
Ps-ef | grep nginx
Find the master process in the process List. its number is the master process number.
Step 2: send signals
Stop Nginx with ease:
Kill-QUIT master process number
Stop Nginx quickly:
Kill-TERM Master process number
Force stop Nginx:
Pkill-9 nginx
In addition, if the pid file storage path is configured in nginx. conf, the file stores the Nginx main process number. If no pid file is specified, the file is placed in the nginx logs directory. With the pid file, we do not need to first query the main process Number of Nginx, but directly send a signal to Nginx. the command is as follows:
Kill-signal type '/usr/nginx/logs/nginx. pid'
Smooth restart
If you change the configuration, restart Nginx. do you need to disable Nginx before enabling Nginx? No. you can send a signal to Nginx to restart Nginx smoothly.
Smooth restart command:
Kill-HUP enters the title or process number file path

Or use

/Usr/nginx/sbin/nginx-s reload


The above introduces centos7 (64-bit) under the installation of nginx-1.6.2, including the content of the aspect, hope to be interested in PHP Tutorial friends help.

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.