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/sbin/nginx /usr/bin/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/etc/nginx/nginx.conf
          編輯內容,可以制定web 目錄,以及PHP 、python 等。。
          posted on 2011-11-04 15:34 -274°C 閱讀(15201) 評論(1)  編輯  收藏 所屬分類: mac


          FeedBack:
          # re: mac 下 nginx 環境的搭建
          2011-11-10 15:23 | tb
          收藏了  回復  更多評論
            

          常用鏈接

          留言簿(21)

          隨筆分類(265)

          隨筆檔案(242)

          相冊

          JAVA網站

          關注的Blog

          搜索

          •  

          積分與排名

          • 積分 - 914173
          • 排名 - 40

          最新評論

          主站蜘蛛池模板: 东平县| 黄山市| 宣武区| 榆树市| 冀州市| 修武县| 宣化县| 新干县| 专栏| 乐安县| 玉龙| 大宁县| 宣城市| 岳阳县| 洛隆县| 玉屏| 韩城市| 乳源| 盐池县| 尼勒克县| 安新县| 贵德县| 隆安县| 金寨县| 龙江县| 潞西市| 嘉禾县| 商都县| 贵定县| 白山市| 安多县| 芜湖市| 斗六市| 奉贤区| 贵州省| 东乌| 安庆市| 宜阳县| 华亭县| 孟连| 左云县|