Linux under the source installation Nginx service

Source: Internet
Author: User

Nginx Installation

Linux systems need to install the necessary development packages, such as gcc,gcc-c++

1.

OpenSSL (HTTPS supported)

Https://www.openssl.org/source/openssl-1.0.2.tar.gz

TAR-ZXVF openssl-1.0.2.tar.gz # Download and unzip, then CD to the installation directory, the same as

./config--prefix=/usr/local--openssldir=/usr/local/opensslmake  
2.

Pcre: (Supports forwarding components)

3.

Nginx:

./configure--with-http_stub_status_module--with-http_ssl_module--with-http_realip_module--with-openssl=/opt/ Package/openssl-1.0.2amake &&  

Note if the./configure tip error:the HTTP gzip module requires the Zlib library ..., you can yum-y install Zlib-devel or manually install Zlib-deve L, if you do not need this feature, you can add--without-http_gzip_module to the./configure

Note:--with-openssl=/usr/local/openssl modifies the decompression directory of the OpenSSL compression pack, and my test machine is/opt/package/openssl-1.0.2a
Reference: Other nginx Common compilation options to open the Http_realip_module module

--with-http_realip_module  : Get real ip,--with-http_stub_status_module--with-http_ssl_module after Nginx agent  

Start Nginx,

Cd/usr/local/nginx/sbin./nginx  

Start no error indicating that Nginx has been operating properly

Troubleshoot error while loading shared libraries:libpcre.so.1
/usr/local/webserver/nginx/sbin/nginx:error while loading shared Libraries:libpcre.so.1:cannot open Shared object file : No such file or directory
Workaround:

Ln-s/usr/local/lib/libpcre.so.1/lib  

Other Nginx Command Reference

NGINX-T # Check that the configuration file syntax is correct nginx-s reload #重新加载修改后的配置文件 nginx-v # View compilation Parameters Nignx-v # view version

Linux under the source installation Nginx service

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.