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

How to compile and upgrade OpenResty

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

Share

Shulou(Shulou.com)05/31 Report--

This article is to share with you about how to compile and upgrade OpenResty, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

Tutorial definition version

For later maintenance convenience, continue to define the version, here the version will be modified to the demon updated new software version number.

# VersionOpenSSLVersion='openssl-1.1.0g';NginxCTVersion='1.3.2';PageSpeedVersion='1.12.34.2';SystemBit='X64';OpenRestyVersion='openresty-1.13.6.1'

Update view of the above software version: OpenSSL, Nginx-CT, PageSpeed, OpenResty

Download the source code cd / root/srcwget https://www.openssl.org/source/$OpenSSLVersion.tar.gztar xzf $OpenSSLVersion.tar.gzwget https://github.com/grahamedgecombe/nginx-ct/archive/v$NginxCTVersion.tar.gztar xzf v$NginxCTVersion.tar.gzgit clone https://github.com/google/ngx_brotli.gitcd ngx_brotligit submodule update-- initcd.. / wget https://github.com/pagespeed/ngx_pagespeed/archive/v$PageSpeedVersion-beta.zipunzip v$PageSpeedVersion-beta.zipcd ngx_pagespeed-$PageSpeedVersion-beta / wget https://dl.google.com/dl/page-speed/psol/1.12.34.2-$SystemBit.tar.gztar-xzvf $PageSpeedVersion-$SystemBit.tar.gzcd.. / wget-c https://openresty.org/download/$OpenRestyVersion.tar.gztar zxf $OpenRestyVersion.tar.gz upgrade cd $OpenRestyVersion./configure-prefix=/usr/local/openresty\-user=www-data-group=www-data\-add-module=../ngx_brotli\-add-module=../nginx-ct -$NginxCTVersion\-add-module=../ngx_pagespeed-$PageSpeedVersion-beta\-with-http_v2_module\-with-http_ssl_module\-with-http_gzip_static_module\-with-openssl=../$OpenSSLVersion\-with-ld-opt='-ljemalloc'makemv / usr/local/openresty/nginx/sbin/nginx { `date +% m% d`} nginx.old # backup existing nginxmake installkill-USR2 `cat / run/ openresty.pid`sleep 1kill-QUIT `cat / run/ openresty.pid.oldbin` explanation

After make, run

Mv / usr/local/openresty/nginx/sbin/nginx {, `date +% m% d`}

To back up old binary Nginx files. Why run make install? Because it is different from Nginx,OpenResty in addition to Nginx Core, there is also luajit and so on, so you still have to go through make install.

Kill-USR2 `cat / run/ openresty.pid`

Is to delete the old version of the running process.

View

Run the following command to see if the existing nginx.conf file meets the requirements of the existing version.

Ngint-t

Then use the following command to see if the version has been updated to the latest version.

Nginx-V

As Web software, OpenResty is the first layer for visitors to contact the website. Its security is self-evident, and Nginx and its derivatives are particularly prone to DOS vulnerabilities, so we must pay attention to vulnerability intelligence and version patches in time to avoid security problems.

The above is how to compile and upgrade OpenResty. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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