Amaze UI Logo

码动指尖



Mac下编译安装nginx

在Mac下安装nginx的时候,可能会非常顺利,但是也可能把你坑的哭起来,我当然就成为了后者。

WRNING! If you wish to build 64-bit library, then you have to

invoke ‘./Configure darwin64-x86_64-cc' *manually*.


第一步当然是进行下载,百度或者google搜索nginx 点击官网进入,点击进入下载选择界面,选择源码下载。

下载为什么压缩包都无所谓。看个人喜好。

然后解压。

sudo tar -xvf nginx压缩包


然后进入解压出来的nginx文件夹

cd nginx文件夹


执行./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-file-aio --with-debug --with-openssl=openssl源码解压的目录位置

configure完成之后

需要注意,在make过程中,会提示你


WRNING! If you wish to build 64-bit library, then you have to

invoke ‘./Configure darwin64-x86_64-cc' *manually*.


这是由于安装包默认的并没有认为你是64bit的(综合网上所说)

那么最直接的解决办法,也就是我成功了的办法如下:

第一步是下载openssl源码,解压,记住位置

然后进入解压后的nginx目录

vim /objs/Makefile

查找


config –prefix=openssl下载位置/.openssl


改成


Configure darwin64-x86_64-cc –prefix=openssl解压目录位置/.openssl


再执行make语句即可


这里主要引用到了这篇文章,欢迎大家去浏览参考

https://m.jb51.net/article/79899.htm


 nginx

作者  :  奕弈

喵喵喵,你在心上



评论


About ME

about me

奕弈

为了最初的心,努力奋斗,从不懈怠的学习。

我不想成为一个庸俗的人。十年百年后,当我们死去,质疑我们的人同样死去,后人看到的是裹足不前、原地打转的你,还是一直奔跑、走到远方的我?

Contact ME