mac安装nginx

it2022-05-05  178

mac安装nginx比较简单,直接使用命令brew install nginx即可。安装过程所示:

$ brew install nginx ==> Installing dependencies for nginx: openssl and pcre ==> Installing nginx dependency: openssl ==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2s.mojave.bottl ==> Downloading from https://akamai.bintray.com/c4/c4a762d719c2be74ac686f1aafabb ==> Downloading https://www.openssl.org/source/openssl-1.0.2s.tar.gz ######################################################################## 100.0% ==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.2s --openssldir=/usr ==> make depend ==> make ==> make test ==> make install MANDIR=/usr/local/Cellar/openssl/1.0.2s/share/man MANSUFFIX=ssl ==> Caveats A CA file has been bootstrapped using certificates from the SystemRoots keychain. To add additional certificates (e.g. the certificates added in the System keychain), place .pem files in /usr/local/etc/openssl/certs and run /usr/local/opt/openssl/bin/c_rehash openssl is keg-only, which means it was not symlinked into /usr/local, because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries. If you need to have openssl first in your PATH run: echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile For compilers to find openssl you may need to set: export LDFLAGS="-L/usr/local/opt/openssl/lib" export CPPFLAGS="-I/usr/local/opt/openssl/include" ==> Summary ? /usr/local/Cellar/openssl/1.0.2s: 1,787 files, 12.0MB, built in 9 minutes 45 seconds ==> Installing nginx dependency: pcre ==> Downloading https://homebrew.bintray.com/bottles/pcre-8.43.mojave.bottle.tar ==> Downloading from https://akamai.bintray.com/08/08e7414a7641d1e184c936537ff67 ######################################################################## 100.0% ==> Pouring pcre-8.43.mojave.bottle.tar.gz ? /usr/local/Cellar/pcre/8.43: 204 files, 5.5MB ==> Installing nginx ==> Downloading https://homebrew.bintray.com/bottles/nginx-1.17.1.mojave.bottle. ==> Downloading from https://akamai.bintray.com/a1/a1114fd86181db06ebb31c5f3fb5e ######################################################################## 100.0% ==> Pouring nginx-1.17.1.mojave.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.17.1: 25 files, 2MB ==> `brew cleanup` has not been run in 30 days, running now... Pruned 0 symbolic links and 3 directories from /usr/local ==> Caveats ==> openssl A CA file has been bootstrapped using certificates from the SystemRoots keychain. To add additional certificates (e.g. the certificates added in the System keychain), place .pem files in /usr/local/etc/openssl/certs and run /usr/local/opt/openssl/bin/c_rehash openssl is keg-only, which means it was not symlinked into /usr/local, because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries. If you need to have openssl first in your PATH run: echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile For compilers to find openssl you may need to set: export LDFLAGS="-L/usr/local/opt/openssl/lib" export CPPFLAGS="-I/usr/local/opt/openssl/include" ==> nginx 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

 


最新回复(0)