美文网首页云时代架构
mac环境下安装tengine

mac环境下安装tengine

作者: 尹小凯 | 来源:发表于2017-09-11 13:24 被阅读0次

        笔者最近需要在tengine上进行lua开发,所以在闲暇时间希望在本地mac上搞一套环境,本以为是件很轻松惬意的事情,but碰到了些坑(只有趟过的同学才知道),这里把他分享出来,希望能给其他同学带来一些帮助。

1.关闭mac下的Rootles,开机按住Command + R,在终端下调用csrutil disable

2.终端下openssl version查看版本,隐约记得是0.9.8

3. sudo rm -rf /usr/bin/openssl删除自带的openssl

4.下载最新opensslhttps://www.openssl.org

5.下载zlibhttp://www.zlib.net

6.下载pcrehttps://sourceforge.net/projects/pcre/files/pcre/

7.安装openssl,mac下可以用brew install

8.解压tengine,进入目录开始配置,调用:./configure --prefix=/usr/local/tengine --with-pcre=/Users/starkevin/Downloads/pcre-8.39 --with-zlib=/Users/starkevin/Downloads/zlib-1.2.8 --with-openssl=/Users/starkevin/Downloads/openssl-1.0.2j --with-http_gzip_static_module --with-http_realip_module --with-http_stub_status_module --with-http_concat_module --with-http_footer_filter_module=shared --with-http_limit_req_module=shared --with-cc-opt="-Wno-deprecated-declarations”

备注:—prefix指定了安装目录

--with-cc-opt="-Wno-deprecated-declarations用于解决'OSAtomicAdd64' is deprecated: first deprecated in macOS 10.12问题

8.配置成功过后,修改objs/Makefile文件,大概在1332行(搜索./config),修改把./config替换成./Configure darwin64-x86_64-cc

9.编译,调用  sudo make

10.编译成功后安装,调用  sudo make install

11.检测是否有nginx命令,如果没有,调用:sudo ln -s /usr/local/tengine/sbin/nginx /usr/bin/nginx

12.启动,调用  sudo nginx

13.访问127.0.0.1

14.开启Rootles csrutil enable

相关文章

网友评论

    本文标题:mac环境下安装tengine

    本文链接:https://www.haomeiwen.com/subject/bxxfsxtx.html