Installing Nginx under Linux

Source: Internet
Author: User
Tags openssl openssl library

always use nginx, but also learned a lot of nginx knowledge. Also installed in the local nginx, this is the first time in the formal environment to install nginx, these records to experience.

First, installation environment

Operating System: CentOS Release 6.4 (Final)

Nginx version:nginx-1.10.1

zlib:zlib-1.2.7

openssl:openssl-1.0.2h

pcre:pcre-8.21

Second, the installation process 1, the basic knowledge

Nginx needs to rely on the following modules:

The gzip module requires a zlib Library and we use zlib-1.2.7.

Rewrite module requires pcre Library, we use pcre-8.21

The SSL feature requires the OpenSSL Library. We use pcre-8.21

2, the installation process 2.1 decompression each package

Tar zxvf nginx-1.10.1.tar.gz (Other packages Use this command to decompress, remember where each package is placed)

TAR-XVF pcre-8.21.tar.gz

TAR-XVF zlib-1.2.7.tar.gz

TAR-XVF openssl-1.0.0a.tar.gz

2.2Configure NginxParameters

./configure--with-http_ssl_module--prefix=/liaowp/nginx--with-pcre=/liaowp/tools/pcre-8.21--with-zlib=/liaowp/ Tools/zlib-1.2.7--with-openssl=/liaowp/tools/openssl-1.0.2h--with-http_stub_status_module--with-debug

--prefix:set installation prefix set the installation directory , if not specified , the default is /usr/local/nginx

--with-pcre=dir:set Path to Pcre library sources pcre repository location

--with-zlib=dir:set Path to zlib library sources zlib repository location

location of the--with-openssl=dir:set path to OpenSSL library sources OpenSSL

--with-debug Enable debug Logging open debug log

--with-http_stub_status_module enable Ngx_http_stub_status_module to open the Stub_status module configuration method, Nginx in the Stub_ The status module is primarily used to view some of Nginx's state information.

      --with-xxx module , start the xxx function .

--without-xxx module , disable the xxx function .

After executing the above command, the following shows that the installation was successful.

Configuration Summary

+ Using PCRE library:/liaowp/tools/pcre-8.21
+ Using OpenSSL library:/liaowp/tools/openssl-1.0.2h
+ md5:using OpenSSL Library
+ sha1:using OpenSSL Library
+ using Zlib library:/liaowp/tools/zlib-1.2.7
Nginx path prefix: "/liaowp/nginx"
Nginx binary file: "/liaowp/nginx/sbin/nginx"
Nginx modules path: "/liaowp/nginx/modules"
Nginx configuration prefix: "/liaowp/nginx/conf"
Nginx configuration file: "/liaowp/nginx/conf/nginx.conf"
Nginx pid file: "/liaowp/nginx/logs/nginx.pid"
Nginx error log file: "/liaowp/nginx/logs/error.log"
Nginx HTTP access log file: "/liaowp/nginx/logs/access.log"
Nginx HTTP client request body Temporary files: "Client_body_temp"
Nginx HTTP proxy temporary files: "Proxy_temp"
Nginx http fastcgi temporary files: "Fastcgi_temp"
Nginx http Uwsgi temporary files: "Uwsgi_temp"
Nginx http scgi temporary files: "Scgi_temp"

Finally, we find that there is no sbin directory, do make and do install . The startup journal file cannot be found, and a log folder is created. The installation is complete.

        

Iii. Typical problems in the installation process 1,missingPCRE Library

  

2.missingZlib Library

  

Installing Nginx under Linux

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.