How Linux installs Nginx

Source: Internet
Author: User
Tags install openssl openssl openssl library sha1 install perl

Download a nginx tar.gz version from the official website.

Installation using Make installation

The first step: decompression

TAR-ZXVF nginx-1.7.4.tar.gz

Step Two: Enter nginx-1.7.4, execute./configure command

--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------

[Root@localhost nginx-1.7.4]#./configure

Checking for OS

+ Linux 2.6.32-431.el6.x86_64 x86_64

Checking for C compiler ... not found

./configure:error:c compiler cc is not found

This error occurs.

Then the GCC package is not installed. Install GCC Bar, the year of Sao.

Yum-y Install GCC

--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------

Execute again./configure

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

Can either disable the module by using--without-http_rewrite_module

option, or install the PCRE library into the system, or build the PCRE library

Statically from the source with Nginx by using--with-pcre= option.

Yum Install Pcre-devel

--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------

Execute again./configure

./configure:error:the HTTP gzip module requires the Zlib library.

Can either disable the module by using--without-http_gzip_module

option, or install the Zlib library into the system, or build the Zlib library

Statically from the source with Nginx by using--with-zlib= option.

Yum Install Zlib-devel

--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------

Execute again./configure

Configuration Summary

+ Using System PCRE Library

+ OpenSSL Library is not used

+ Using BUILTIN MD5 code

+ SHA1 Library is not found

+ Using System zlib Library

OK, now you can execute make. If you want to use the OpenSSL function, SHA1 function. Then install OpenSSL, SHA1 bar, Sao year. Install Opensslyum install OpenSSL openssl-devel installation SHA1

Yum Install perl-digest-sha1.x86_64

Open SSL module execution./configure--with-http_ssl_module

Enable the "Server+status" page to execute./configure--with-http_stub_status_module

All two start, I don't need to say. Execute./configure--with-http_stub_status_module--with-http_ssl_module

--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------

Then the configre is passed.

--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------

Execute make command

Execute make Install command

So far, Nginx executed successfully.

--------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- ------

Down to configure environment variables add in/etc/profile: Export Nginx_home=/usr/local/nginx

Export path= $PATH: $NGINX _home/sbin Save, execute source/etc/profile, make the configuration file effective. Execute nginx-v, you can see the version, indicating that Nginx installation was successful

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.