nginx在mac中的配置
来源:互联网 发布:javascript编程题目 编辑:程序博客网 时间:2024/06/03 08:43
本文介绍 nginx 在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/sbin/nginx /usr/bin/nginx 做了个软连接。
常用的指令有:
复制代码 代码如下:
nginx -V 查看版本,以及配置文件地址
nginx -v 查看版本
nginx -c filename 指定配置文件
nginx -h 帮助
nginx -s [reloadreopenstopquit]
brewhome 常用的指令:
复制代码 代码如下:
brew search mysql : 搜索具体的程序包
brew install mysql : 安装具体的程序包
brew info mysql : 查看具体程序的信息
brew uninstall mysql : 卸载具体的应用(这里只是用mysql 作个例子)
配置文件地址:/usr/local/etc/nginx/nginx.conf
编辑内容,可以制定web 目录,以及PHP 、 python 等。
sudo nginx -s reload
======================
- nginx在mac中的配置
- Nginx在Mac上的安装配置
- Yaf框架在nginx虚拟主机中的配置
- NGINX location 在配置中的优先级
- nginx location在配置中的优先级
- NGINX location 在配置中的优先级
- tomcat+nginx在centos中的配置
- nginx 在windows中的安装和配置
- Nginx中 location 在配置中的优先级
- mac 上配置nginx过程中的问题记录
- mac 配置nginx+php
- mac pro nginx配置
- mac配置nginx+php
- mac nginx配置虚拟主机
- mac下配置nginx
- mac Nginx+Nodejs配置
- MAC下Nginx 配置
- Nginx在Mac下的配置和文件结构讲解
- 飞思卡尔IMX6修改uboot默认启动参数
- pop 到指定vc
- 第十二章 线程控制
- unity3d TextMesh清晰字体
- 区块链技术原理
- nginx在mac中的配置
- 执笔微小说之单爱
- Eclipse的Servers视图中无法添加Tomcat7
- Java对象创建过程
- 圆角矩形的UIButton
- R-CNN 学习笔记
- ubuntu下面的git服务器搭建
- 12. 试用vSphere 6(一):安装ESXi 6 RC版
- HighCharts定时刷新图表