CentOS5.4上安装Nginx过程

==========安装==========
1、从http://nginx.org/en/download.html下载适合的 tar.gz包。(wget 命令)
2、解压到随意的目录,但是不要使用安装目录。(本人安装的目录是/usr/local/nginx,解压目录为/usr/local/nginx_install)
3、进入目录中并运行命令:
    ./configure --prefix=/usr/local/nginx
问题1:新机器上需要有gcc。
    yum install gcc
问题2:the HTTP rewrite module requires the PCRE library.
    yum -y install pcre-devel
问题3:the HTTP gzip module requires the zlib library.
    yum install -y zlib-devel
问题4:OpenSSL library is not used
    暂时用不到,当有https的请求时需要添加。
执行结果:
 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
 
  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"
4、继续执行命令:

    make           

    make install
==========配置环境变量=========
vim /etc/profile
    在PATH后面添加上 ":/usr/local/nginx/sbin"
source /etc/profile
    配置文件生效
==========常用操作=========
1、启动
   nginx
2、停止
   nginx -s stop
3、重启
   nginx -s reload
posted @ 2013-03-29 13:43  赵国勇  阅读(205)  评论(0)    收藏  举报