In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces in detail the process of installing Nginx+Lua development environment and the configuration of nginx+lua, which is very detailed and recommended to friends here.
First of all, we choose to use OpenResty, which is composed of Nginx core and many third-party modules. its biggest highlight is the default integration of the Lua development environment, so that Nginx can be used as a Web Server. With the help of Nginx's event-driven model and non-blocking IO, high-performance Web applications can be implemented. And OpenResty provides a large number of components such as Mysql, Redis, Memcached and so on, which makes it more convenient and simple to develop Web applications on Nginx. At present, Nginx+Lua architecture is being used in JD.com, such as real-time price, second kill, dynamic service, item page, list page, etc., and other companies, such as Taobao, Qunar, and so on.
Installation environment
You can refer to http://openresty.org/#Installation for installation steps.
1. Create a directory / usr/servers, and later we will install all the software in this directory
The copy code is as follows:
Mkdir-p / usr/servers
Cd / usr/servers/
2. Installation dependency (my environment is ubuntu. You can install it using the following command. For others, you can refer to the openresty installation steps)
The copy code is as follows:
Apt-get install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl
3. Download ngx_openresty-1.7.7.2.tar.gz and decompress it
The copy code is as follows:
Wget http://openresty.org/download/ngx_openresty-1.7.7.2.tar.gz
Tar-xzvf ngx_openresty-1.7.7.2.tar.gz
The ngx_openresty-1.7.7.2/bundle directory stores the nginx core and many third-party modules, such as Lua and LuaJIT that we need.
3. Install LuaJIT
The copy code is as follows:
Cd bundle/LuaJIT-2.1-20150120 /
Make clean & & make & & make install
Ln-sf luajit-2.1.0-alpha / usr/local/bin/luajit
4. Download the ngx_cache_purge module, which is used to clean the nginx cache
The copy code is as follows:
Cd / usr/servers/ngx_openresty-1.7.7.2/bundle
Wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz
Tar-xvf 2.3.tar.gz
Download the nginx_upstream_check_module module, which is used for ustream health check
The copy code is as follows:
Cd / usr/servers/ngx_openresty-1.7.7.2/bundle
Wget https://github.com/yaoweibin/nginx_upstream_check_module/archive/v0.3.0.tar.gz
Tar-xvf v0.3.0.tar.gz
6. Install ngx_openresty
The copy code is as follows:
Cd / usr/servers/ngx_openresty-1.7.7.2
. / configure-- prefix=/usr/servers-- with-http_realip_module-- with-pcre-- with-luajit-- add-module=./bundle/ngx_cache_purge-2.3/-- add-module=./bundle/nginx_upstream_check_module-0.3.0/-J2
Make & & make install
-with*** installs some built-in / integrated modules
-with-http_realip_module fetch user's real ip module
-with-pcre Perl compatible reach module
-with-luajit integrated luajit module
Article source: http://www.iis7.com/b/ssyqdq/
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.