下载依赖
下载nginx
wget http://nginx.org/download/nginx-1.20.1.tar.gz
tar -xf nginx-1.20.1.tar.gz
下载ngx_devel_kit
wget https://github.com/simplresty/ngx_devel_kit/archive/v0.3.0.tar.gz
tar -xf v0.3.0.tar.gz
下载lua-nginx-module
wget https://github.com/openresty/lua-nginx-module/archive/v0.10.13.tar.gz
tar -xf v0.10.13.tar.gz
下载LuaJIT
wget http://luajit.org/download/LuaJIT-2.0.5.tar.gz
tar -xf LuaJIT-2.0.5.tar.gz
安装依赖
安装LuaJIT
cd LuaJIT-2.0.5/
sudo make install PREFIX=/usr/local/LuaJIT
cd ~
export LUAJIT_LIB=/usr/local/LuaJIT/lib
export LUAJIT_INC=/usr/local/LuaJIT/include/luajit-2.0
安装编译依赖
sudo yum install -y gcc gcc-c++ make libtool zlib zlib-devel pcre pcre-devel readline-devel openssl-devel libxml2 libxml2-devel.x86_64 libxslt-devel gperftools-devel gd-devel perl-ExtUtils-Embed
配置编译
cd ~/nginx-1.20.1
./configure --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/home/ec2-user/nginx/conf/nginx.conf --error-log-path=/home/ec2-user/nginx/log/error.log --http-log-path=/home/ec2-user/log/nginx/access.log --http-client-body-temp-path=/home/ec2-user/nginx/tmp/client_body --http-proxy-temp-path=/home/ec2-user/nginx/tmp/proxy --http-fastcgi-temp-path=/home/ec2-user/nginx/tmp/fastcgi --http-uwsgi-temp-path=/home/ec2-user/nginx/tmp/uwsgi --http-scgi-temp-path=/home/ec2-user/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=ec2-user --group=ec2-user --with-compat --with-debug --with-file-aio --with-google_perftools_module --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_degradation_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_mp4_module --with-http_perl_module=dynamic --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_xslt_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --with-threads --with-cc-opt='-Wno-error -Wno-deprecated-declarations -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E' --with-ld-opt=-Wl,-rpath,/usr/local/LuaJIT/lib --add-module=/home/ec2-user/ngx_devel_kit-0.3.0 --add-module=/home/ec2-user/lua-nginx-module-0.10.13
编译
sudo make
sudo make install
使用
sudo mkdir -p /home/ec2-user/nginx/tmp/client_body
sudo /usr/sbin/nginx
注意事项
配置文件路径 /home/ec2-user/nginx/conf/nginx.conf
Nginx集成LuaJIT与ngx_devel_kit及lua-nginx-module的安装教程
该文详细介绍了如何下载并安装Nginx、ngx_devel_kit、lua-nginx-module以及LuaJIT,包括依赖的安装、配置编译过程,最后启动Nginx的步骤,适用于系统优化和Web服务器扩展。
1263

被折叠的 条评论
为什么被折叠?



