Linux服务器(CentOS 6.5)Nginx服务器的安装

在Linux上面编译和安装Nginx服务器需要的条件:

    磁盘空间:   10M以上的剩余空间,nginx安装完毕后会占据大概4MB左右的空间,实际的磁盘空间需求会因为便宜设置和是否安装第三方模块而有所不同。

    依赖包安装: 

    gcc                   # Linux许上软件安装编译工具:支持c、c++、Objective-c、Fortran、Java语言的编译。

    gcc-c++        

    automake         #自动创建功能完善的 Makefile(编译)

    autoconf          #自动创建功能完善的 Makefile(配置)

    zlib                  #第三方扩展(gzip)支持

    zlib-devel      

    openssl            #第三方扩展SSL

    openssl-devel 

    pcre                #rewrite模块需要的pcre库支持

    pcre-devel

    以下是安装这些库文件的Linux shell 指令:

yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre pcre-devel


安装前配置(注意配置文件和pid文件位置的位置)

./configure  
--prefix=/usr/local/nginx \
--conf-path=/etc/nginx/nginx.conf  \
--error-log-path=/var/log/nginx/error.log  \
--http-log-path=/var/log/nginx/access.log  \
--pid-path=/var/run/nginx/nginx.pid  \
--lock-path=/var/lock/nginx.lock  \
--user=nginx  \
--group=nginx  \
--with-http_ssl_module  \
--with-http_flv_module  \
--with-http_stub_status_module  \
--with-http_gzip_static_module  \
--http-client-body-temp-path=/var/tmp/nginx/client/  \
--http-proxy-temp-path=/var/tmp/nginx/proxy/  \
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi/  \
--with-pcre
#如果出现如下信息,表明安装成功!


Configuration summary
  + using system PCRE library
  + using system OpenSSL library
  + md5: using OpenSSL library
  + sha1: using OpenSSL library
  + using system zlib library

  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx configuration prefix: "/etc/nginx"
  nginx configuration file: "/etc/nginx/nginx.conf"
  nginx pid file: "/var/run/nginx/nginx.pid"
  nginx error log file: "/var/log/nginx/error.log"
  nginx http access log file: "/var/log/nginx/access.log"
  nginx http client request body temporary files: "/var/tmp/nginx/client/"
  nginx http proxy temporary files: "/var/tmp/nginx/proxy/"
  nginx http fastcgi temporary files: "/var/tmp/nginx/fcgi/"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"
然后执行编译和安装:
make && make install

转载于:https://my.oschina.net/atlantisay/blog/465535

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值