软件准备
- 操作系统:Mac OS X 10.11.6
- Nginx:1.10.2
- OpenSSL:1.1.0c
- Zlib:1.2.3
- PCre:8.30
系统库:
shell
yum -y install gcc pcre-devel
zlib-devel
openssl-devel
编译参数:
shell
./configure
--prefix=/usr/local/nginx
--with-threads
--with-file-aio
--with-http_v2_module
--with-http_realip_module
--with-http_sub_module
--with-http_flv_module
--with-http_dav_module
--with-http_mp4_module
--with-http_gunzip_module
--with-http_gzip_static_module
--with-http_stub_status_module
--with-http_addition_module
--without-http_rewrite_module
--with-stream
--with-http_ssl_module
--with-stream_ssl_module
--with-stream_realip_module
--with-pcre=/Users/zhenqin/temp/pcre-8.30
--with-openssl=/Users/zhenqin/temp/openssl-1.1.0c
--with-zlib=/Users/zhenqin/temp/zlib-1.2.3
编译良久,报错。貌似是 Openssl 的问题,把 nginx/objs/Makefile 1334 行左右:
shell
./config --prefix=****
改为
shell
./Configure darwin64-x86_64-cc
然后对 nginx make
, 通过。
QA
Linux 系统安装后配置后无法访问页面,出现如下错误:
[error] 43163#43163: *11 "index.html" is forbidden (13: Permission denied),
执行如下配置:
shell
setenforce 0
setsebool -P httpd_can_network_connect 1