RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
MacOSX10.15部署Nginx

Nginx (“engine x”) 是一个高性能的 HTTP 和 反向代理 服务器 ,也是一个 IMAP/POP3/SMTP 代理 服务器 。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,第一个公开版本0.1.0发布于2004年10月4日。

创新互联公司专注于企业全网营销推广、网站重做改版、庐江网站定制设计、自适应品牌网站建设、H5建站商城建设、集团公司官网建设、成都外贸网站制作、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为庐江等各大城市提供网站开发制作服务。

下载软件

首先建个临时目录 nginx-src 并下载所需软件的源码进行配置

mkdir nginx-src
cd nginx-src
wget http://nginx.org/download/nginx-1.17.8.tar.gz
wget https://ftp.pcre.org/pub/pcre/pcre-8.41.tar.gz
wget https://www.openssl.org/source/openssl-1.1.0g.tar.gz
tar zxvf *.gz
cd nginx-1.17.8
./configure --with-pcre=../pcre-8.41/ --with-http_ssl_module --with-openssl=../openssl-1.1.0g --prefix=/Users/winterlau/nginx

这里我们将 nginx 安装在 /Users/winterlau/nginx 目录下,prefix 指定的路径请使用绝对路径

错误处理

如果在执行 configure 脚本时报如下错误:

checking for OS
+ Darwin 19.2.0 x86_64
checking for C compiler ... not found

./configure: error: C compiler cc is not found

尝试执行 gcc 出如下错误

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools),
missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

执行:xcode-select –install 根据界面提示操作

继续安装

./configure --with-pcre=../pcre-8.41/ --with-http_ssl_module --with-openssl=../openssl-1.1.0g --prefix=/Users/winterlau/nginx

可看到相关信息如下:

Configuration summary
 + using PCRE library: ../pcre-8.41/
 + using OpenSSL library: ../openssl-1.1.0g
 + using system zlib library

开始编译安装

make
make install

启动 Nginx 并测试

由于默认的 nginx 运行在 80 端口上,因此需要有管理员的权限:

cd ../../nginx
sudo sbin/nginx

打开浏览器访问 http://localhost


网站标题:MacOSX10.15部署Nginx
浏览地址:http://www.jxjierui.cn/article/dhodcee.html