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 replace nginx with openresty

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article is a detailed introduction to "how to replace nginx with openrest". The content is detailed, the steps are clear, and the details are properly handled. I hope this article "how to replace nginx with openrest" can help you solve your doubts. Let's go deeper and learn new knowledge together with the ideas of the small editor.

OpenResty, also known as ngx_openresty, is a core Web application server based on Nginx. OpenResty is a high-performance Web platform based on Nginx and Lua. OpenResty effectively turns Nginx into a powerful general purpose Web application platform by aggregating various well-designed Nginx modules.

Download openrestywget https://openresty.org/download/openresty-1.15.8.1.tar.gztar zxvf openresty-1.15.8.1.tar.gzcd openresty-1.15.8.1 Install openresty

View current nginx build configuration

nginx -V

As shown below,"configure arguments" is the configuration when compiling nginx

nginx version: nginx/1.14.0built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)built with OpenSSL 1.0.2k-fips 26 Jan 2017TLS SNI support enabledconfigure arguments: --with-http_ssl_module

Compile openrest, add the configuration just now to the "configure" command, if you need to use lua can also add "-with-luajit"

./ configure --with-http_ssl_module --with-luajitgmake && gmake install

gmake stands for GNU make, and the reason for using it is that non-GNU platforms may take up the make command, which is not considered under Linux. GNU, after the invention of Unix system, began to appear closed-source fee software, so someone launched a free software project, namely GNU project, to promote the spirit of open source, editor Emacs and compiler GCC belong to GNU projects, but GNU under the lack of system kernel, and later coincidentally with Linux cooperation, released GNU/Linux.

Change configuration file

Move the existing nginx configuration file to the openresty directory

mv /usr/local/nginx/conf/*.conf /usr/local/openresty/confmv /usr/local/nginx/conf/conf.d /usr/local/openresty/conf stop original nginx-s stop start openresty/usr/local/openresty/bin/openresty

If the prompt "nginx: [warn] the "ssl" directive is deprecated, use the "listen... ssl"", the reason is that nginx version 1.15 and later no longer need to use ssl on command, you can remove it.

Soft link to bin directory

If you feel that the command is inconvenient to use, you can directly soft link to the bin directory and rename it nginx

ln -s /usr/local/openrest/bin/openrest/usr/local/bin/nginx Read here, this article "how to replace nginx openrest" article has been introduced, want to master the knowledge points of this article also need to be used by yourself to understand, if you want to know more about related content articles, welcome to pay attention to 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

Development

Wechat

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

12
Report