Nginx安装

1.下载源码:

   下载地址:http://nginx.org/en/download.html

   选择相应的版本如:nginx-1.8.0.tar.gz

 

2.上传到linux服务器指定目录

3.telnet 或 ssh 至服务器,解压源文件

   tar -xzvf nginx-1.8.0.tar.gz

   解压后,当前目录生成nginx-1.8.0目录

4.配置

    $>cd nginx-1.8.0

    $>./configure --prefix=nigix安装目录   --with-pcre=../pcre-8.32  --with-zlib=../zlib-1.2.8

          --prefix 指定nigix安装目录

          --with-pcre 指pcre 包解压位置

               pcre下载地址http://www.pcre.org/ 下载包如:pcre-8.32.tar.gz,解压

           --with-zlib 指定zlib解压位置

              zlib 下载地址 http://zlib.net/  下载包如:zlib-1.2.8.tar.gz,解压

 

$ ./configure --prefix=/home/yanlei/nginx   --with-pcre=../pcre-8.32  --with-zlib=../zlib-1.2.8
checking for OS
 + Linux 2.6.32-431.el6.x86_64 x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) 
........
creating objs/Makefile

Configuration summary
  + using PCRE library: ../pcre-8.32
  + OpenSSL library is not used
  + using builtin md5 code
  + sha1 library is not found
  + using zlib library: ../zlib-1.2.8

  nginx path prefix: "/home/yanlei/nginx"
  nginx binary file: "/home/yanlei/nginx/sbin/nginx"
  nginx configuration prefix: "/home/yanlei/nginx/conf"
  nginx configuration file: "/home/yanlei/nginx/conf/nginx.conf"
  nginx pid file: "/home/yanlei/nginx/logs/nginx.pid"
  nginx error log file: "/home/yanlei/nginx/logs/error.log"
  nginx http access log file: "/home/yanlei/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"

    

 

执行成功后,会在当前目录生成 makefile 文件

          

5.编译

 

  $>make 

6.安装

  $>make install

  安装成功后,会在--prefix参数指定的目录中生成数据库程序目录:conf  html  logs  sbin

   

7.

你可能感兴趣的:(nginx)