for testing. After the installation is complete, record the steps below. If you do not use an automatic installation script such as Lnmp, if you do not understand the installation details, you can do it yourself, understand the installation process of the required components, and gain a deeper understanding of each part of the system.
Operating system version: Ubuntu 12.04 64bit
Use the root account to log on to the system and create related directories.
Download path
/Home/ubuntu/down
Installa
First download the latest version of the relevant software installation files.Nginx:http://nginx.org/en/download.htmlLuajit:http://luajit.org/download.htmllua-nginx-module:https://github.com/openresty/lua-nginx-module/releases/tag/v0.9.16ngx_devel_kit:https://github.com/simpl/ngx_devel_kit/releases/tag/v0.2.19[email protected] src]# LL-Ttotal22408-rw-r--r--.1Root root65029Sep - the:xxngx_devel_kit-0.2. +. tar.gz-rw-r--r--.1Root root523900Sep - the:x
It's kind of like wampserver. One-Stop installation packagewget http://openresty.org/download/ngx_openresty-1.7.10.1.tar.gztar-zxvf ngx_openresty-1.7 . 10.1 . TAR.GZCD ngx_openresty-1.7. 10.1 . / make installRelated components to install before configureYum-y Install pcre--y install gcc zlib zlib-devel OpenSSL openssl-develThe installation directory defaults to thecd/usr/local/openresty/Test that the LUA environment is healthyluaprint ("hello")Test Ng
/nginx-modules-ngx_lua, the use ofLn-s/usr/local/lib/libluajit-5.1.so.2/lib64/This solves the problem, but it is equivalent to a remediation method.Reference question Https://github.com/openresty/lua-nginx-module/issues/8 Agentzh's answerHello! On Sat, 4 at 1:16 PM, Maanas --with-ld-optCan resolve problems directly in the compile phase reference NG official installation document definition http://nginx.org/en/docs/configure.html--with-ld-opt=parameter
The Nginx configuration file sets the response header by using the Add_header directive.Here's how:Add_header Key valueAdd_header Cache-control no-storeadd_header Content-encoding gzipTo change the Content-type is special, you can set the type and also specify the charset, but there is a semicolon between content-type and CharSet, so we need to add this.Add_header 'text/html; charset=utf-8';This allows you to add the specified properties to the Content-type of the responent header.For example:N
Ngx_lua Lua into Nginx, let Nginx run Lua script. High concurrency, non-clogging process for various requests.The URL requires Nginxserver, and LUA queries Redis to return the JSON data.I. Installation Lua-nginx-moduleSee the architecture of LNMLGCTwo. Installing the Redis2-nginx-module moduleGet Https://github.com/openresty/echo-nginx-moduleGet Https://github.com/openresty/redis2-nginx-moduleGet Https://gi
Come in learning and Chun of the openresty, the individual to Lua is not very skilled, will inevitably encounter a lot of strange problems, here is a little record of some small problems encountered, for others reference.Internet search related information, most of the information is just to call Lua require or dofile, and the details of the difference between the life, not to say useless, but did not answer my question-how to implement the variable b
Github Project address https://github.com/openresty/lua-nginx-module
Openresty and nginxconf call the lua script. Why is nil always reported when the lua script loads dynamic libraries?
After you install LUA, add the library path to the system variable path.Generally \ Lua \ 5.1 \ clibs DownloadLua Rocks provides a simple solution to upgrade and update the Lua extension Library (similar to the yum function
Install the ngx_pagespeed module in Nginx 1.91. About pagespeed
Ngx_pagespeed is an Nginx extension module that can accelerate your website and reduce page loading time, it automatically applies some practices for improving web performance to webpages and related resources (CSS, JS, and images) without modifying the content and process.
Features:Image optimization: stripping meta-data, dynamic resizing, recompressionCSS JavaScript compression and mergeInline of small resourcesDelay image and JS
, the access will be blocked for half an hour. The collector's ip address may change, so it will not be blocked until now.
1. Install nginx_lua Module
See the previous blog http://blog.csdn.net/yanggd1987/article/details/46679989 for nginx and lua
2. lua-resty-redis module Installation
Cd/usr/local/srcwget https://github.com/openresty/lua-resty-redis/archive/master.zipunzip master.zip cd lua-resty-redis-mastermkdir-p/usr/local/nginx/lua # copy lib to
Ngx_lua embeds Lua into nginx and enables nginx to execute Lua scripts to process various requests with high concurrency and non-blocking.
The URL requests the nginx server, Lua queries redis, and returns JSON data.
1. Install LUA-nginx-Module
See lnmlgc Architecture
2. Install redis2-nginx-module ModuleGet https://github.com/openresty/echo-nginx-module
Get https://github.com/openresty/redis2-nginx-module
1. Installation GraphicsMagick
Cd/usr/local/src
wget http://sourceforge.net/projects/graphicsmagick/files/graphicsmagick/1.3.20/GraphicsMagick-1.3.20.tar.gz/download
TAR-ZXVF graphicsmagick-1.3.20.tar.gz
CD GraphicsMagick-1.3.20
./configure--prefix=/usr/local/graphicsmagick
Make make install
2, download Luajit
wget http://luajit.org/download/LuaJIT-2.0.2.tar.gz
TAR-ZXVF luajit-2.0.2.tar.gz
CD LuaJIT-2.0.2
Make make install Prefix=/usr/local/lj2
LN-SF Luajit-2.0.2/usr/local/lj2/bin/
ServerNginxInstalling Nginx1. Mac this direct executionBrew Install Homebrew/nginx/openresty, refer to Http://openresty.org/cn/installation.html2. The MAC has its own python, and the 2.7 series is available. Install Pip, execute sudo easy_install pip3. After the installation is complete, modify the server. Open it/usr/local/etc/openresty/nginx.conf, copy the following code into the fileserver {Listen 6060;
There is a module in the nginx that has this function, (the previous article expands, here is called the module, after the unification is called the module, the module may be accurate point, because the extension is the individual file, but the module is embeds in the main file), this module is called Drizzle-nginx-module, the download address is:
Https://github.com/openresty/drizzle-nginx-module
To compile this is not easy, the above address also h
Use the Kong Community Edition (Community edition v1.3.0) to build a load balancer, since Kong is based on Openresty and Openresty is a two-time package for Nginx, all many of the configuration items are similar to Nginx.
To see a more typical Nginx load balancing configuration
Upstream Hello {
server localhost:3000 weight=100;
Server localhost:3001 weight=50;
}
server {
listen ;
Location/
than IP more limited speed meaning. The meaning of the following configuration is/hello this request, LAN parameters of the same request can only be requested once per second, you can compare LAN parameters as the user's IP, each IP can only be successfully accessed one server per second to understand.
Here can also be extended to use nginx can get the parameter speed limit, for example, through the IP address +ua speed limit, through the header of the special mark +ip speed limit, and more com
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.