安装 Libgd
sudo apt-get install -y libgd-dev
安装 lua & luajit
sudo apt install -y lua5.1 liblua5.1-0-dev luajit libluajit-5.1-dev
环境变量设置
export LUAJIT_LIB=/usr/lib/x86_64-linux-gnu export LUAJIT_INC=/usr/include/luajit-2.0
clone 最新版 lua_ngx
git clone https://github.com/openresty/lua-nginx-module.git
下载 Nginx 1.11.x
wget http://nginx.org/download/nginx-1.11.13.tar.gz tar -xzf nginx-1.11.13.tar.gz cd nginx-1.11.13/
Nginx 1.13.8 在 Ubuntu 18.04 也可以通过编译
Nginx 1.18.1 在 Ubuntu 20.04 也可以通过编译
配置编译Nginx
./configure --user=ubuntu --group=ubuntu \ --prefix=/usr/local/nginx \ --conf-path=/etc/nginx/nginx.conf \ --pid-path=/var/run/nginx.pid \ --with-http_stub_status_module \ --with-http_ssl_module \ --with-http_v2_module \ --with-http_image_filter_module \ --with-ld-opt="-Wl,-rpath,/usr/lib/x86_64-linux-gnu" \ --add-module=../lua-nginx-module make -j2 make install