Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Nginx compiles newly added modules

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

1. Install the compilation environment

Yum-y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel

two。 Download source packages and modules that are consistent with the nginx version

# this is version 1.16.1, and the source code package also needs to be downloaded and modified.

Wget http://nginx.org/download/nginx-1.16.1.tar.gz

# download the source package

Wget https://github.com/openresty/echo-nginx-module/archive/v0.61.tar.gz

# download the echo module package. Note that the version of the module here also corresponds to nginx, otherwise it will not be compiled.

3. Compile

Tar-xvf nginx-1.16.1

# decompress the source package

Tar-xvf v0.61.tar.gz

# decompression module package

Cd nginx-1.16.1/

# cd to the nginx source package folder

. / configure-- add-module=/root/echo-nginx-module-0.61

# configure the parameter "--add-module", followed by the path of the nginx module

Make

Compile

# compilation completed

# cd run. / nginx-V in the objs folder to check the compilation options. You can see the module information here, indicating that the compilation is successful.

Add-on module installed by 4.yum

Nginx-V # View nginx compilation options for yum installation

# just copy it to debug, the following one will report an error, and the mod of "google_perftools" should be removed.

# optimized compilation options

# you can finish running, you can report it correctly

Make-J4

# compile,-j4 compile 4 faster

Make install

# installation

Nginx-V

# check the compilation options again

# you can see the new modules in the last row

Test it

Vim / etc/nginx/nginx.conf

# modify nginx configuration file

# add ehco statement to test the function of echo module

# curl the resources. Ehco functions normally.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report