当前位置:首页 > 服务器技术 > nginx

MacOS 安装配置nginx

运行环境:

            uname -a
Darwin 192.168.0.108 19.0.0 Darwin Kernel Version 19.0.0: Wed Oct 23 18:29:05 PDT 2019; root:xnu-6153.41.3~44/RELEASE_X86_64 x86_64

make出现的问题:

            在编译过程中出现大约5s的暂停,编译完成后出现错误:
ld
: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

nginx附加依赖库:pcre-8.43.tar.gz zlib-1.2.11.tar.gz openssl-1.0.2u.tar.gz 分别解压

问题分析:

翻看编译记录发现问题出现在openssl编译 经过大神指导说是默认不能编译为x86_64内核支持(默认似乎是i386,但因为本地是x86_64,两个平台不一致)

 解决方法:

第一步:重新配置

                ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/nginx --modules-path=/usr/local/nginx/modules --conf-path=/usr/local/nginx/conf/nginx.conf --error-log-path=/usr/local/nginx/logs/errors.log --pid-path=/usr/local/nginx/logs/nginx.pid --lock-path=/usr/local/nginx/logs/nginx.lock --with-select_module --with-poll_module --with-threads --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --http-client-body-temp-path=/usr/local/nginx/temp/client_body_temp --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module  --with-http_secure_link_module --with-http_degradation_module  --with-http_slice_module --with-http_stub_status_module  --with-http_perl_module  --with-http_perl_module=dynamic  --with-perl_modules_path=/usr/local/nginx/modules --with-perl=/usr/bin/perl--http-log-path=/usr/local/nginx/logs/access.log --http-proxy-temp-path=/usr/local/nginx/temp/proxy_temp --http-fastcgi-temp-path=/usr/local/nginx/temp/fastcgi_temp --http-uwsgi-temp-path=/usr/local/nginx/temp/uwsgi_temp --http-scgi-temp-path=/usr/local/nginx/temp/scgi_temp --with-mail --with-mail=dynamic --with-mail_ssl_module --with-stream --with-stream=dynamic  --with-stream_ssl_module  --with-stream_realip_module --with-stream_ssl_preread_module --with-pcre  --with-pcre=/Users/pawn/Downloads/pcre-8.43--with-pcre-jit --with-zlib=/Users/pawn/Downloads/zlib-1.2.11--with-openssl=/Users/pawn/Downloads/openssl-1.0.2u--with-debug
            

第二步:修改上一步生成的编译文件 objs/Makefile,找到openssl配置

技术分享图片

 

技术分享图片

 

 

保存然后进行编译即可

原文:https://www.cnblogs.com/2019PawN/p/12114909.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!