手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

CentOS 5.6 安装Nginx

[日期:2012-05-21] 来源:Linux社区  作者:sheismylife [字体:大 中 小]

Linux操作系统:CentOS 5.6

在/usr目录下执行命令下载最新Nginx源代码:

  1. wget http://nginx.org/download/nginx-1.2.0.tar.gz  

解压后可以看到nginx-1.2.0目录:

  1. tar zxvf nginx-1.2.0.tar.gz  

安装PCRE库

  1. yum -y install pcre-devel  

安装openssl库

  1. yum -y install openssl openssl-devel  

生成make file文件:

  1. ./configure --prefix=/usr/nginx  

结果要仔细看一下,有些很重要的信息:

  1. creating objs/Makefile  
  2.   
  3. Configuration summary  
  4.   + using system PCRE library  
  5.   + OpenSSL library is not used  
  6.   + md5: using system crypto library  
  7.   + sha1: using system crypto library  
  8.   + using system zlib library  
  9.   
  10.   nginx path prefix: "/usr/nginx"  
  11.   nginx binary file: "/usr/nginx/sbin/nginx"  
  12.   nginx configuration prefix: "/usr/nginx/conf"  
  13.   nginx configuration file: "/usr/nginx/conf/nginx.conf"  
  14.   nginx pid file: "/usr/nginx/logs/nginx.pid"  
  15.   nginx error log file: "/usr/nginx/logs/error.log"  
  16.   nginx http access log file: "/usr/nginx/logs/access.log"  
  17.   nginx http client request body temporary files: "client_body_temp"  
  18.   nginx http proxy temporary files: "proxy_temp"  
  19.   nginx http fastcgi temporary files: "fastcgi_temp"  
  20.   nginx http uwsgi temporary files: "uwsgi_temp"  
  21.   nginx http scgi temporary files: "scgi_temp"  

比如pid 文件,error log文件,access log文件等等。

现在编译和安装:

  1. make   
  2. make install  

进入/usr/nginx/sbin目录下,可以执行nginx程序启动。

如果要修改端口,修改/usr/nginx/conf/nginx.conf文件,比如:

  1. server {  
  2.        listen       8081;  
linux
相关资讯       CentOS安装  Nginx安装 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款