CENTOS7 (64-bit) Install the nginx-1.6.2

Source: Internet
Author: User
Tags install openssl openssl library
Linux system for CentOS 64-bit

First step: Download the corresponding version from http://nginx.org/download/(or wget http://nginx.org/download/nginx-1.5.9.tar.gz directly on Linux)

Step two: Unzip TAR-ZXVF nginx-1.5.9.tar.gz

Step three: Set the configuration information./configure--prefix=/usr/local/nginx, or do not perform this step, direct default configuration

Fourth Step:

Make compile (making is the process of writing source files in various languages into executables and various library files)

Make install installation (made install to copy these compiled executables and library files to the appropriate place)

At the time of configuration information, in the third step, there was an error:


The error is:./configure:error:the HTTP Rewrite module requires the PCRE library.

Installing Pcre-devel to solve problems
Yum-y Install Pcre-devel

There is also the possibility of:


Installing zlib-devel to solve problems
Yum-y Install Zlib-devel

There is also the possibility of:

Error message:./configure:error:the HTTP Cache module requires MD5 functions
From the 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.

Workaround:

Yum-y Install OpenSSL Openssl-devel

After installation, start and close Nginx under Linux:

Start action

/usr/nginx/sbin/nginx (/usr/nginx/sbin/nginx-t See if the configuration information is correct)

Web interface: http://192.168.189.136 : 80/

Stop operation
The stop operation is done by sending a signal to the nginx process (see the Linux article for a signal)
Step 1: Query the Nginx main process number
Ps-ef | grep nginx
Find the master process in the list of processes, whose number is the main process number.
Step 2: Send a signal
Calmly stop Nginx:
Kill-quit Main process Number
Quick Stop Nginx:
Kill-term Main process Number
forced stop nginx:
pkill-9 nginx
In addition, if the PID file storage path is configured in nginx.conf, the file is stored in the Nginx main process number , if not specified, is placed in the Nginx logs directory. With the PID file, we do not have to query the Nginx main process number, and directly send a signal to Nginx, the command is as follows:
kill-Signal class Type '/usr/nginx/logs/nginx.pid '
smooth restart
If you change the configuration to restart Nginx, you need to turn off the nginx before opening? No, can send a signal to nginx, smooth restart.
Smooth restart command:
Kill-hup live in title or process number file path

or use

/usr/nginx/sbin/nginx-s Reload


The above describes the CENTOS7 (64-bit) under the installation of nginx-1.6.2, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    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.