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

Teach you how to replace nginx perfectly with openresty

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This tutorial teaches you how to replace nginx perfectly with openresty. 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 and install openresty

View the compiled configuration of the current nginx

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 openresty and add the previous configuration to the "configure" command. If you need to use lua, you can add "--with-luajit".

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

Gmake is GNU make, and the reason for using it is that non-GNU platforms may take up make commands, and you don't have to think about it on linux systems. GNU, after the invention of the Unix system, began to appear closed-source fee software, so someone launched a free software project, that is, GNU project, to promote the spirit of open source, editor Emacs and compiler GCC belong to the project under GNU, but the lack of system kernel under GNU, and then coincidentally collaborated with Linux to release GNU/Linux.

Replace Profil

Move the original 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 the original nginxnginx-s stop start openresty/usr/local/openresty/bin/openresty

If you prompt "nginx: [warn] the" ssl "directive is deprecated, use the" listen. Ssl "", because the nginx1.15 version and the future do not need to use the ssl on command, can be removed.

Soft link to the bin directory

If you find the command inconvenient to use, you can directly soft link to the bin directory and rename it to nginx.

Ln-s / usr/local/openresty/bin/openresty / usr/local/bin/nginx

The original text is from: https://www.linuxprobe.com/openresty-nginx.html

Editor: Zhou Xiaoxue

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