七达网-安全的软件、游戏下载基地!

关于我们最近更新热门排行

首页 游戏库 软件 游戏 应用 文章 专题

新闻资讯软件应用软件教程 编程开发操作系统游戏攻略安卓应用安卓游戏
当前位置:首页 ›› 软件教程 ›› Mac下 Nginx 环境变量配置文件(Mac Nginx 配置文件)

Mac下 Nginx 环境变量配置文件(Mac Nginx 配置文件)

2018-04-11 15:17   作者:佚名   来源:本站整理   浏览:5655   评论:2  

Nginx 是一个轻量级的高性能HTTP 以及反向代理服务器,今天在MAC 上成功安装。我是通过brewhome 来安装的,过程很简单。brew install nginx 一路安装很顺畅。

首先通过 git 安装 brewhome

sudo chown $USER /usr/local
cd /usr/local
git clone https://github.com/mxcl/homebrew.git
cd homebrew/bin
./brew -v
file brew
cat brew | moresudo 
./brew update
sudo ln -s /usr/local/homebrew/bin/brew /usr/bin/brew

如果“brew update”命令执行出错,请确保文件夹/usr/local的所有者权限是你本人而不是root:

sudo chown $USER /usr/local

./brew updat

export PATH=$PATH:/usr/local/homebrew/bin

然后安装 Nginx,下面的安装信息

7downdeMacBook-Pro:bin 7down$ ./brew install nginx
==> Installing dependencies for nginx: pcre, makedepend, openssl
==> Installing nginx dependency: pcre
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/pcre-8.36.m
######################################################################## 100.0%
==> Pouring pcre-8.36.mavericks.bottle.tar.gz
 /usr/local/homebrew/Cellar/pcre/8.36: 146 files, 5.9M
==> Installing nginx dependency: makedepend
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/makedepend-
######################################################################## 100.0%
==> Pouring makedepend-1.0.5.mavericks.bottle.tar.gz
 /usr/local/homebrew/Cellar/makedepend/1.0.5: 7 files, 92K
==> Installing nginx dependency: openssl
Warning: Building source; cellar of openssl's bottle is /usr/local/Cellar
==> Downloading https://www.openssl.org/source/openssl-1.0.1j.tar.gz

curl: (28) Operation timed out after 5247 milliseconds with 0 out of 0 bytes received
Trying a mirror...
==> Downloading https://raw.githubusercontent.com/DomT4/LibreMirror/master/OpenS
######################################################################## 100.0%
==> perl ./Configure --prefix=/usr/local/homebrew/Cellar/openssl/1.0.1j --openss
==> make depend
==> make
==> make test
==> make install MANDIR=/usr/local/homebrew/Cellar/openssl/1.0.1j/share/man MANS
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/homebrew/etc/openssl/certs

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

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

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

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/homebrew/opt/openssl/lib
    CPPFLAGS: -I/usr/local/homebrew/opt/openssl/include

==> Summary
 /usr/local/homebrew/Cellar/openssl/1.0.1j: 431 files, 15M, built in 3.9 minutes
==> Installing nginx
Warning: Building source; cellar of nginx's bottle is /usr/local/Cellar
==> Downloading http://nginx.org/download/nginx-1.6.2.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/homebrew/Cellar/nginx/1.6.2 --with-http_ssl_
==> make
==> make install
==> Caveats
Docroot is: /usr/local/homebrew/var/www

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


To have launchd start nginx at login:
    ln -sfv /usr/local/homebrew/opt/nginx/*.plist ~/Library/LaunchAgents
Then to load nginx now:
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
Or, if you don't want/need launchctl, you can just run:
    nginx
==> Summary
 /usr/local/homebrew/Cellar/nginx/1.6.2: 7 files, 912K, built in 87 seconds
7downdeMacBook-Pro:bin 7down$

备注: sudo ln -s /usr/local/homebrew/Cellar/nginx/1.6.2/bin/nginx /usr/bin/nginx 做了个软连接。

启动nginx:sudo nginx ;访问localhost:8080 发现已出现nginx的欢迎页面了。

常用的指令有:
nginx -V 查看版本,以及配置文件地址
nginx -v 查看版本
nginx -c filename 指定配置文件
nginx -h 帮助
nginx -s [reload\reopen\stop\quit]

brewhome 常用的指令:
brew search mysql : 搜索具体的程序包
brew install mysql : 安装具体的程序包
brew info mysql : 查看具体程序的信息
brew uninstall mysql : 卸载具体的应用(这里只是用mysql 作个例子)

我这里的配置文件地址:/usr/local/homebrew/etc/nginx/nginx.conf

编辑内容,可以制定web 目录,以及PHP 、python 等。。

    1. 图像处理软件(PC)图像处理软件

      七达网下载提供图像处理软件,所谓图像处理就是利用计算机对图像信息进行加工以满足人的视觉心理或者应用需求的行为。图像处理用计算机对图像进行分析,以达到所需结果的技术。又称影像处理。图像处理一般指数字图像...

    软件评论

    请自觉遵守互联网相关政策法规,评论内容只代表网友观点,与本站立场无关!

        登录   注册
    猜你喜欢