mac 下 nginx 环境的搭建
2016-07-06 11:52
537 查看
nginx 是一个轻量级的高性能HTTP 以及反向代理服务器,今天在MAC 上安装成功。
我是通过brewhome 来安装的,很简单。brew install nginx 一路顺畅。。。
下面是安装信息。
hematoMacBook-Pro:~ hechangmin$
brew search nginx
nginx
hematoMacBook-Pro:~ hechangmin$
brew install nginx
==> Installing nginx dependency: pcre
==> Downloading ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.13.
######################################################################## 100.0%
######################################################################## 100.0%==> ./configure --prefix=/usr/local/Cellar/pcre/8.13 --enable-utf8 --enable-unic
==> make test
==> make install
/usr/local/Cellar/pcre/8.13: 111 files, 2.9M, built in 54 seconds
==> Installing nginx
==> Downloading http://nginx.org/download/nginx-1.0.8.tar.gz
######################################################################## 100.0%
==> Patching
patching file auto/lib/pcre/conf
patching file conf/nginx.conf
==> ./configure --prefix=/usr/local/Cellar/nginx/1.0.8 --with-http_ssl_module --with-pcre --conf-path=/usr/local/etc/nginx/nginx.conf --pid-path=/usr/local/var/run/nginx.pid --lock-path=/usr/local/var/ngi
==> make install
==> Caveats
In the interest of allowing you to run `nginx` without `sudo`, the default
port is set to localhost:8080.
If you want to host pages on your local machine to the public, you should
change that to localhost:80, and run `sudo nginx`. You'll need to turn off
any other web servers running port 80, of course.
You can start nginx automatically on login running as your user with:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/nginx/1.0.8/org.nginx.nginx.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.nginx.nginx.plist
Though note that if running as your user, the launch agent will fail if you
try to use a port below 1024 (such as http's default of 80.)
Warning: /usr/local/sbin is not in your PATH
You can amend this by altering your ~/.bashrc file
==> Summary
/usr/local/Cellar/nginx/1.0.8: 6 files, 616K, built in 19 seconds
hematoMacBook-Pro:~ hechangmin$
启动nginx ,sudo nginx ;访问localhost:8080
发现已出现nginx的欢迎页面了。
备注:ln -s /usr/local/Cellar/nginx /Users/wangzhan/demo
做了个软连接。
常用的指令有:
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/etc/nginx/nginx.conf
编辑内容,可以制定web 目录,以及PHP 、python 等
摘自 :-274°c
来源:http://www.2cto.com/os/201111/111009.html
我是通过brewhome 来安装的,很简单。brew install nginx 一路顺畅。。。
下面是安装信息。
hematoMacBook-Pro:~ hechangmin$
brew search nginx
nginx
hematoMacBook-Pro:~ hechangmin$
brew install nginx
==> Installing nginx dependency: pcre
==> Downloading ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.13.
######################################################################## 100.0%
######################################################################## 100.0%==> ./configure --prefix=/usr/local/Cellar/pcre/8.13 --enable-utf8 --enable-unic
==> make test
==> make install
/usr/local/Cellar/pcre/8.13: 111 files, 2.9M, built in 54 seconds
==> Installing nginx
==> Downloading http://nginx.org/download/nginx-1.0.8.tar.gz
######################################################################## 100.0%
==> Patching
patching file auto/lib/pcre/conf
patching file conf/nginx.conf
==> ./configure --prefix=/usr/local/Cellar/nginx/1.0.8 --with-http_ssl_module --with-pcre --conf-path=/usr/local/etc/nginx/nginx.conf --pid-path=/usr/local/var/run/nginx.pid --lock-path=/usr/local/var/ngi
==> make install
==> Caveats
In the interest of allowing you to run `nginx` without `sudo`, the default
port is set to localhost:8080.
If you want to host pages on your local machine to the public, you should
change that to localhost:80, and run `sudo nginx`. You'll need to turn off
any other web servers running port 80, of course.
You can start nginx automatically on login running as your user with:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/nginx/1.0.8/org.nginx.nginx.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.nginx.nginx.plist
Though note that if running as your user, the launch agent will fail if you
try to use a port below 1024 (such as http's default of 80.)
Warning: /usr/local/sbin is not in your PATH
You can amend this by altering your ~/.bashrc file
==> Summary
/usr/local/Cellar/nginx/1.0.8: 6 files, 616K, built in 19 seconds
hematoMacBook-Pro:~ hechangmin$
启动nginx ,sudo nginx ;访问localhost:8080
发现已出现nginx的欢迎页面了。
备注:ln -s /usr/local/Cellar/nginx /Users/wangzhan/demo
做了个软连接。
常用的指令有:
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/etc/nginx/nginx.conf
编辑内容,可以制定web 目录,以及PHP 、python 等
摘自 :-274°c
来源:http://www.2cto.com/os/201111/111009.html
相关文章推荐
- nginx代理指定目录
- 访问Nginx发生SSL connection error的一种情况
- Nginx+Naxsi部署专业级Web应用防火墙
- CentOS 6.2实战部署Nginx+MySQL+PHP
- nginx中http核心模块的配置指令2
- nginx中http核心模块的配置指令3
- nginx中http核心模块的配置指令4
- nginx中http的fastcgi模块的配置指令1
- Nginx 学习笔记(一)
- 网站502与504错误分析
- 用zabbix监控nginx_status状态
- 艰难完成 nginx + puma 部署 rails 4的详细记录
- 把Lua编译进nginx步骤方法
- web 应用中常用的各种 cache详解
- Linux系统上配置Nginx+Ruby on Rails+MySQL超攻略
- window+nginx+php环境配置 附配置搭配说明
- 解析CI即CodeIgniter框架在Nginx下的重写规则
- 将PHP从5.3.28升级到5.3.29时Nginx出现502错误
- 基于Nginx0.8.54+PHP5.3.4+MySQL5.5.8的全新LNMP稳定版架构搭建的VPS