Chuyện của sys

DevOps Blog

Hướng dẫn compile nginx support gRPC trên Centos 7 March 26, 2018

Nginx đã bắt đầu hỗ trợ gRPC từ bản 1.13.10, tuy nhiên vẫn trang trên mainline, chưa stable, thông tin được cập nhật từ trang chủ https://www.nginx.com/blog/nginx-1-13-10-grpc/
Sau đây, mình sẽ hướng dẫn các bạn complie nginx từ source theo document https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-open-source/ trên Centos 7.
Fact:
cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
Cài các gói phụ thuộc cần thiết bao gồm, openssl, zlib, pcre

$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
$ tar -zxf pcre-8.41.tar.gz
$ cd pcre-8.41
$ ./configure
$ make
$ make install
$ wget http://zlib.net/zlib-1.2.11.tar.gz
$ tar -zxf zlib-1.2.11.tar.gz
$ cd zlib-1.2.11
$ ./configure
$ make
$ make install
$ wget http://www.openssl.org/source/openssl-1.0.2k.tar.gz
$ tar -zxf openssl-1.0.2k.tar.gz
$ cd openssl-1.0.2k
$ ./config–prefix=/usr
$ make
$ make install

Download source

$ wget http://nginx.org/download/nginx-1.13.10.tar.gz
$ tar zxf nginx-1.13.10.tar.gz
$ cd nginx-1.13.10
Nhớ thêm 2 module –with-http_ssl_module –with-http_v2_module
./configure –sbin-path=/usr/local/nginx/nginx –conf-path=/usr/local/nginx/nginx.conf –pid-path=/usr/local/nginx/nginx.pid –with-http_ssl_module –with-stream –with-pcre=../pcre-8.41 –with-openssl=../openssl-1.0.2k –with-zlib=../zlib-1.2.11 –with-http_v2_module
$make
$make install

/usr/local/nginx/nginx -v
nginx version: nginx/1.13.10
Như vậy là đã hoàn thành.

No Comments on Hướng dẫn compile nginx support gRPC trên Centos 7
Categories: Tài liệu