为什么80%的码农都做不了架构师?>>>
1、安装 nginx
下载http://nginx.org/en/download.html
解压tar -xvf nginx-1.10.3.tar.gz
2、安装 luajit(轻量级 lua)
http://luajit.org/download.html
修改 makefile 里面的安装路径export PREFIX= /usr/local/luajit
然后安装make &make install
3、安装nginx_lua_module
下载https://github.com/openresty/lua-nginx-module
解压
4、 安装ngx_devel_kit
(NDK提供函数和宏处理一些基本任务,减轻第三方模块开发的代码量)
下载https://github.com/simpl/ngx_devel_kit/
5、wget https://github.com/oupula/ngx_image_thumb/archive/master.zip
解压:unzip
6、useradd nginx -s /sbin/nologin -M 添加nginx用户组
export LUAJIT_LIB=/usr/local/luajit/lib export LUAJIT_INC=/usr/local/luajit/include/luajit-2.0
7、./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --add-module=/home/live/software/lua-nginx-module --add-module=/home/live/software/ngx_devel_kit --add-module=/home/live/software/ngx_image_thumb-master
8、ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/nginx
9、启动nginx,如果报错出现/usr/local/nginx/sbin/nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory,find / -name libluajit-5.1.so.2 软连接到/lib64/libluajit-5.1.so
10、配置nginx.conf如下: