nginx安装

nginx安装

一、安装环境

安装环境:mac os

二、下载安装

执行命令brew install nginx安装nginx。

安装最终位置:/usr/local/etc/nginx

安装命令执行流程如下:

➜ brew install nginx
==> Installing dependencies for nginx: pcre, openssl
==> Installing nginx dependency: pcre
==> Downloading https://homebrew.bintray.com/bottles/pcre-8.39.yosemite.bottle.tar.gz

curl: (6) Could not resolve host: homebrew.bintray.com
Error: Failed to download resource "pcre"
Download failed: https://homebrew.bintray.com/bottles/pcre-8.39.yosemite.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading https://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.bz2
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/pcre/8.39 --enable-utf8 --enable-pcre8 --enable-
==> make
==> make test
==> make install
��  /usr/local/Cellar/pcre/8.39: 203 files, 5.4M, built in 1 minute 41 seconds
==> Installing nginx dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2h_1.yosemite.bottle.tar.g
######################################################################## 100.0%
==> Pouring openssl-1.0.2h_1.yosemite.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local.

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include

==> Summary
��  /usr/local/Cellar/openssl/1.0.2h_1: 1,691 files, 12.0M
==> Installing nginx
==> Downloading https://homebrew.bintray.com/bottles/nginx-1.10.1.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring nginx-1.10.1.yosemite.bottle.tar.gz
==> Caveats
Docroot is: /usr/local/var/www

The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.

nginx will load all files in /usr/local/etc/nginx/servers/.

To have launchd start nginx now and restart at login:
  brew services start nginx
Or, if you don't want/need a background service you can just run:
  nginx
==> Summary
��  /usr/local/Cellar/nginx/1.10.1: 7 files, 976.2K
二、验证成功

访问:http://localhost:8080/ 出现如下页面即安装成功:

nginx

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值