macbook上怎么使用nginx
1个回答
展开全部
在终端输入命令: MacBook-Air:~ wgyp$ brew install nginx
结果:
==> Installing dependencies for nginx: pcre, openssl==> Installing nginx dependency: pcre==> Downloading https://homebrew.bintray.com/bottles/pcre-8.36.mavericks.bottle.curl: (7) Failed connect to d29vzk4ow07wi7.cloudfront.net:443; Operation now in progressError: Failed to download resource "pcre"Download failed: https://homebrew.bintray.com/bottles/pcre-8.36.mavericks.bottle.tar.gzWarning: Bottle installation failed: building from source.==> Downloading https://downloads.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.bz2######################################################################## 100.0%==> ./configure --prefix=/usr/local/Cellar/pcre/8.36 --enable-utf8 --enable-pcre8 --enable-pcre16 --ena==> make==> make test==> make install🍺 /usr/local/Cellar/pcre/8.36: 146 files, 5.9M, built in 103 seconds==> Installing nginx dependency: openssl==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2.mavericks.bottle.tar.gzcurl: (7) Failed connect to d29vzk4ow07wi7.cloudfront.net:443; Operation now in progressError: Failed to download resource "openssl"Download failed: https://homebrew.bintray.com/bottles/openssl-1.0.2.mavericks.bottle.tar.gzWarning: Bottle installation failed: building from source.Error: /usr/local/opt/makedepend not present or brokenPlease reinstall makedepend. Sorry :(
上面的结果现实,ngnix依赖pcre和openssl,而openssl的下载链接失败。
然后去网上查找资料,看到了一个命令brew install nginx --build-from-source
输入终端后,可以正常安装,结果为:
==> Installing dependencies for nginx: pkg-config, makedepend, openssl==> Installing nginx dependency: pkg-config==> Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz######################################################################## 100.0%==> ./configure --prefix=/usr/local/Cellar/pkg-config/0.28 --disable-host-tool --with-internal-glib --with==> make==> make check==> make install🍺 /usr/local/Cellar/pkg-config/0.28: 10 files, 608K, built in 105 seconds==> Installing nginx dependency: makedepend==> Downloading http://xorg.freedesktop.org/releases/individual/util/makedepend-1.0.5.tar.bz2######################################################################## 100.0%==> Downloading http://xorg.freedesktop.org/releases/individual/proto/xproto-7.0.25.tar.bz2######################################################################## 100.0%==> ./configure --disable-silent-rules --prefix=/private/tmp/makedepend-oCfjyb/makedepend-1.0.5/xproto==> make install==> Downloading http://xorg.freedesktop.org/releases/individual/util/util-macros-1.18.0.tar.bz2######################################################################## 100.0%==> ./configure --prefix=/private/tmp/makedepend-oCfjyb/makedepend-1.0.5/xorg-macros==> make install==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/makedepend/1.0.5==> make install🍺 /usr/local/Cellar/makedepend/1.0.5: 7 files, 92K, built in 31 seconds==> Installing nginx dependency: openssl==> Downloading https://www.openssl.org/source/openssl-1.0.2.tar.gzcurl: (28) Operation timed out after 6259 milliseconds with 0 out of 0 bytes receivedTrying a mirror...==> Downloading https://raw.githubusercontent.com/DomT4/LibreMirror/master/OpenSSL/openssl-1.0.2.tar.gz######################################################################## 100.0%==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.2 --openssldir=/usr/local/etc/openssl no-ssl2 ==> make depend==> make==> make test==> make install MANDIR=/usr/local/Cellar/openssl/1.0.2/share/man MANSUFFIX=ssl==> CaveatsA CA file has been bootstrapped using certificates from the systemkeychain. To add additional certificates, place .pem files in /usr/local/etc/openssl/certsand run /usr/local/opt/openssl/bin/c_rehashThis formula is keg-only, which means it was not symlinked into /usr/local.Mac OS X already provides this software and installing another version inparallel can cause all kinds of trouble.Apple has deprecated use of OpenSSL in favor of its own TLS and crypto librariesGenerally there are no consequences of this for you. If you build yourown software and it requires this formula, you'll need to add to yourbuild variables: LDFLAGS: -L/usr/local/opt/openssl/lib CPPFLAGS: -I/usr/local/opt/openssl/include==> Summary🍺 /usr/local/Cellar/openssl/1.0.2: 459 files, 18M, built in 5.2 minutes==> Installing nginx==> Downloading http://nginx.org/download/nginx-1.6.2.tar.gz######################################################################## 100.0%==> ./configure --prefix=/usr/local/Cellar/nginx/1.6.2 --with-http_ssl_module --with-pcre --with-ipv6 --sb==> make==> make install==> CaveatsDocroot is: /usr/local/var/wwwThe default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so thatnginx can run without sudo.To have launchd start nginx at login: ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgentsThen to load nginx now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx.plistOr, if you don't want/need launchctl, you can just run: nginx==> Summary🍺 /usr/local/Cellar/nginx/1.6.2: 7 files, 912K, built in 37 secondswgypdeMacBook-Air:~ wgyp$
结果:
==> Installing dependencies for nginx: pcre, openssl==> Installing nginx dependency: pcre==> Downloading https://homebrew.bintray.com/bottles/pcre-8.36.mavericks.bottle.curl: (7) Failed connect to d29vzk4ow07wi7.cloudfront.net:443; Operation now in progressError: Failed to download resource "pcre"Download failed: https://homebrew.bintray.com/bottles/pcre-8.36.mavericks.bottle.tar.gzWarning: Bottle installation failed: building from source.==> Downloading https://downloads.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.bz2######################################################################## 100.0%==> ./configure --prefix=/usr/local/Cellar/pcre/8.36 --enable-utf8 --enable-pcre8 --enable-pcre16 --ena==> make==> make test==> make install🍺 /usr/local/Cellar/pcre/8.36: 146 files, 5.9M, built in 103 seconds==> Installing nginx dependency: openssl==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2.mavericks.bottle.tar.gzcurl: (7) Failed connect to d29vzk4ow07wi7.cloudfront.net:443; Operation now in progressError: Failed to download resource "openssl"Download failed: https://homebrew.bintray.com/bottles/openssl-1.0.2.mavericks.bottle.tar.gzWarning: Bottle installation failed: building from source.Error: /usr/local/opt/makedepend not present or brokenPlease reinstall makedepend. Sorry :(
上面的结果现实,ngnix依赖pcre和openssl,而openssl的下载链接失败。
然后去网上查找资料,看到了一个命令brew install nginx --build-from-source
输入终端后,可以正常安装,结果为:
==> Installing dependencies for nginx: pkg-config, makedepend, openssl==> Installing nginx dependency: pkg-config==> Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz######################################################################## 100.0%==> ./configure --prefix=/usr/local/Cellar/pkg-config/0.28 --disable-host-tool --with-internal-glib --with==> make==> make check==> make install🍺 /usr/local/Cellar/pkg-config/0.28: 10 files, 608K, built in 105 seconds==> Installing nginx dependency: makedepend==> Downloading http://xorg.freedesktop.org/releases/individual/util/makedepend-1.0.5.tar.bz2######################################################################## 100.0%==> Downloading http://xorg.freedesktop.org/releases/individual/proto/xproto-7.0.25.tar.bz2######################################################################## 100.0%==> ./configure --disable-silent-rules --prefix=/private/tmp/makedepend-oCfjyb/makedepend-1.0.5/xproto==> make install==> Downloading http://xorg.freedesktop.org/releases/individual/util/util-macros-1.18.0.tar.bz2######################################################################## 100.0%==> ./configure --prefix=/private/tmp/makedepend-oCfjyb/makedepend-1.0.5/xorg-macros==> make install==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/makedepend/1.0.5==> make install🍺 /usr/local/Cellar/makedepend/1.0.5: 7 files, 92K, built in 31 seconds==> Installing nginx dependency: openssl==> Downloading https://www.openssl.org/source/openssl-1.0.2.tar.gzcurl: (28) Operation timed out after 6259 milliseconds with 0 out of 0 bytes receivedTrying a mirror...==> Downloading https://raw.githubusercontent.com/DomT4/LibreMirror/master/OpenSSL/openssl-1.0.2.tar.gz######################################################################## 100.0%==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.2 --openssldir=/usr/local/etc/openssl no-ssl2 ==> make depend==> make==> make test==> make install MANDIR=/usr/local/Cellar/openssl/1.0.2/share/man MANSUFFIX=ssl==> CaveatsA CA file has been bootstrapped using certificates from the systemkeychain. To add additional certificates, place .pem files in /usr/local/etc/openssl/certsand run /usr/local/opt/openssl/bin/c_rehashThis formula is keg-only, which means it was not symlinked into /usr/local.Mac OS X already provides this software and installing another version inparallel can cause all kinds of trouble.Apple has deprecated use of OpenSSL in favor of its own TLS and crypto librariesGenerally there are no consequences of this for you. If you build yourown software and it requires this formula, you'll need to add to yourbuild variables: LDFLAGS: -L/usr/local/opt/openssl/lib CPPFLAGS: -I/usr/local/opt/openssl/include==> Summary🍺 /usr/local/Cellar/openssl/1.0.2: 459 files, 18M, built in 5.2 minutes==> Installing nginx==> Downloading http://nginx.org/download/nginx-1.6.2.tar.gz######################################################################## 100.0%==> ./configure --prefix=/usr/local/Cellar/nginx/1.6.2 --with-http_ssl_module --with-pcre --with-ipv6 --sb==> make==> make install==> CaveatsDocroot is: /usr/local/var/wwwThe default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so thatnginx can run without sudo.To have launchd start nginx at login: ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgentsThen to load nginx now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx.plistOr, if you don't want/need launchctl, you can just run: nginx==> Summary🍺 /usr/local/Cellar/nginx/1.6.2: 7 files, 912K, built in 37 secondswgypdeMacBook-Air:~ wgyp$
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询