MAC OS X 10.9 下 Nginx的安装笔记(为后续搞Nginx+Redis+Tomcat集群做准备)

来源:互联网 发布:交大软件工程硕士 在职 编辑:程序博客网 时间:2024/05/21 06:44

    

    Nginx的强大不必说了,必须要用,搞起!!


 



1,先安装PCRE库,这个是Nginx rewrite 反向代理需要依赖的正则表达式库

   我下载的是8.33版本,www.pcre.org 

  下载在/opt/pcre-8.33.tar.gz  执行:如下命令

cd ~/opttar xvzf pcre-8.33.tar.gzcd pcre-8.33sudo ./configure --prefix=/usr/localsudo makesudo make install

2,下载安装Nginx

我这里采用   nginx-1.5.2 下载地址:http://nginx.org/download/nginx-1.5.2.tar.gz

同样存放在/opt下,然后执行:


tar -zvxf nginx-1.5.2.tar.gzcd nginx-1.5.2
安装前配置
./configure --prefix=/usr/local --sbin-path=/usr/local/sbin --conf-path=/etc/nginx --pid-path=/var/run --error-log-path=/var/log/nginx--http-log-path=/var/log/nginx

然后编译和安装

make make instal
编译后的一些日志
Configuration summary+ using system PCRE library+ OpenSSL library is not used+ md5: using system crypto library+ sha1: using system crypto library+ using system zlib library # 默认编译参数对应的安装路径(*_temp 为目录)nginx path prefix: "/usr/local/nginx"nginx binary file: "/usr/local/nginx/sbin/nginx"nginx configuration prefix: "/usr/local/nginx/conf"nginx configuration file: "/usr/local/nginx/conf/nginx.conf"nginx pid file: "/usr/local/nginx/logs/nginx.pid"nginx error log file: "/usr/local/nginx/logs/error.log"nginx http access log file: "/usr/local/nginx/logs/access.log"nginx http client request body temporary files: "client_body_temp"nginx http proxy temporary files: "proxy_temp"nginx http fastcgi temporary files: "fastcgi_temp"nginx http uwsgi temporary files: "uwsgi_temp"nginx http scgi temporary files: "scgi_temp"


接下来

 ~/.bash_profile export PATH=/usr/local/bin:/usr/local/sbin:$PATH

如果发现


.bash_profile文件不存在,则touch.bash_profile新建,然后vim编辑设置环境变量即可ok,最后一步  来到 /usr/local/nginx/sbin下 执行 sudo nginx   启动Nginx 搞定默认端口是80 打开浏览器 http://localhost/


搞定了! 初步安装好,还需要后续的配置。

  

0 0
原创粉丝点击