Nginx installation details, nginx details

Source: Internet
Author: User
Tags openssl library

Nginx installation details, nginx details
I. Environment:

1. Linux: centos6.4 (32-bit)

2. Gcc compiling environment. Use the make command to edit the file.

Yum install gcc-c ++

3. PCRE

PCRE (Perl Compatible Regular Expressions) is a Perl library, including a perl-Compatible Regular Expression Library. The http module of nginx uses pcre to parse regular expressions. Therefore, you need to install the pcre Library on linux.

Yum install-y pcre-devel

Note: pcre-devel is a secondary development library developed using pcre. Nginx also needs this library.

4. zlib

The zlib library provides many compression and decompression methods. nginx uses zlib to perform gzip on the http package content. Therefore, you need to install the zlib library on linux.

Yum install-y zlib-devel

5. openssl

OpenSSL is a powerful secure socket-layer cryptographic library that includes major cryptographic algorithms, common keys, certificate encapsulation management functions, and SSL protocols, and provides a wide range of applications for testing or other purposes.

Nginx not only supports http protocol, but also https (Transmission of http over ssl protocol). Therefore, you need to install the openssl library in linux.

Yum install-y openssl-devel

II, Installation Steps

Step 1: Upload the Nginx installation package to linux.

Step 2: Decompress the package.

[Root @ bogon ~] # Tar-zxf nginx-1.8.0.tar.gz

Step 3: Go to the source code directory.

The parameter settings are as follows:

./Configure \

-- Prefix =/usr/local/nginx \

-- Pid-path =/var/run/nginx. pid \

-- Lock-path =/var/lock/nginx. lock \

-- Error-log-path =/var/log/nginx/error. log \

-- Http-log-path =/var/log/nginx/access. log \

With-http_gzip_static_module \

-- Http-client-body-temp-path =/var/temp/nginx/client \

-- Http-proxy-temp-path =/var/temp/nginx/proxy \

-- Http-fastcgi-temp-path =/var/temp/nginx/fastcgi \

-- Http-uwsgi-temp-path =/var/temp/nginx/uwsgi \

-- Http-scgi-temp-path =/var/temp/nginx/scgi

Step 4: make

Step 5: make install

Note: Specify the temporary file directory as/var/temp/nginx. Create the temp and nginx directories under/var.

III, Start and Stop Nginx

There is an executable nginx file under the nginx installation directory (/usr/local/nginx/sbin.

Start: [root @ bogon sbin] #./nginx

 

Access test: http: // 192.168.25.htm

 

Close the service:

[Root @ bogon sbin] #./nginx-s stop

Reload the configuration file:

[Root @ bogon sbin] #./nginx-s reload

Disable firewall: [root @ bogon sbin] # service iptables stop

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.