【发布时间】:2019-02-23 16:55:21
【问题描述】:
我在为 nginx 编译“geoip2”时遇到问题。我的“.so”不起作用。
我的安装方式:
- cd /opt/
- sudo add-apt-repository ppa:maxmind/ppa && apt update & sudo apt install libmaxminddb0 libmaxminddb-dev mmdb-bin
- git 克隆https://github.com/leev/ngx_http_geoip2_module.git
- wget http://nginx.org/download/nginx-1.15.8.tar.gz && tar xzfv nginx-1.15.8.tar.gz && cd nginx-1.15.8/
- ./configure --with-compat --add-dynamic-module=/opt/ngx_http_geoip2_module && make && make install
...测试! -f '/usr/local/nginx/modules/ngx_http_geoip2_module.so' \ || mv '/usr/local/nginx/modules/ngx_http_geoip2_module.so' \ '/usr/local/nginx/modules/ngx_http_geoip2_module.so.old' cp objs/ngx_http_geoip2_module.so '/usr/local/nginx/modules/ngx_http_geoip2_module.so' make[1]: 离开 目录'/opt/nginx-1.15.8 ...
cp /usr/local/nginx/modules/ngx_http_geoip2_module.so /usr/share/nginx/modules/ngx_http_geoip2_module.so
添加行 load_module "modules/ngx_http_geoip2_module.so";在我的 nginx.conf 中重启 nginx。
重启后我的nginx安装中没有加载geoip2
nginx 版本:使用 OpenSSL 1.1.1 构建的 nginx/1.15.8 2018 年 9 月 11 日 (与 OpenSSL 1.1.1a 2018 年 11 月 20 日一起运行)启用 TLS SNI 支持 配置参数:--with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-2CZdMa/nginx-1.15.8=。 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl ,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path= /usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http- proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-compat --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with -http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with -http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --with-mail=dynamic --with-mail_ssl_module --add-dynamic -module=/build/nginx-2CZdMa/nginx-1.15.8/debian/modules/http-auth-pam --add-dynamic-module=/build/nginx-2CZdMa/nginx-1.15.8/debian/modules/http-dav-ext --add-dynamic-module=/build/nginx-2CZdMa/nginx-1.15.8/debian/modules/http-echo --add-dynamic-module=/build/nginx-2CZdMa/nginx-1.15.8/debian/modules/http-upstream-fair --add-dynamic-module=/build/nginx-2CZdMa/nginx-1.15.8/debian/modules/http-subs-filter
谁是我的失败或问题?
【问题讨论】:
标签: nginx compilation geoip2