CentOS6编译安装Nginx

64位操作系统请先安装libunwind库,32位操作系统不要安装。libunwind库为基于64位CPU和操作系统的程序提供了基本的堆栈辗转开解功能,其中包括用于输出堆栈跟踪的API、用于以编程方式辗转开解堆栈的API以及支持C++异常处理机制的API。

[root@test software]# tar zxvf libunwind-1.1.tar.gz

[root@test software]# cd libunwind-0.99-alpha

[root@test libunwind-0.99-alpha]# CFLAGS=-fPIC ./configure

[root@test libunwind-0.99-alpha]# make CFLAGS=-fPIC

[root@test libunwind-0.99-alpha]# make CFLAGS=-fPIC install

[root@test software]# tar zxvf libunwind-1.1.tar.gz [root@test software]# cd libunwind-0.99-alpha [root@test libunwind-0.99-alpha]# CFLAGS=-fPIC ./configure [root@test libunwind-0.99-alpha]# make CFLAGS=-fPIC [root@test libunwind-0.99-alpha]# make CFLAGS=-fPIC install


安装google-perftools

[root@test software]# tar -zxvf gperftools-2.1.tar.gz

[root@test software]# cd gperftools-2.1

[root@test gperftools-2.1]# ./configure

[root@test gperftools-2.1]# make

[root@test gperftools-2.1]# make install

[root@test gperftools-2.1]# echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf

[root@test gperftools-2.1]# /sbin/ldconfig

[root@test software]# tar -zxvf gperftools-2.1.tar.gz [root@test software]# cd gperftools-2.1 [root@test gperftools-2.1]# ./configure [root@test gperftools-2.1]# make [root@test gperftools-2.1]# make install [root@test gperftools-2.1]# echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf [root@test gperftools-2.1]# /sbin/ldconfig


安装nginx

[root@test software]# tar -zxvf nginx-1.5.7.tar.gz

[root@test software]# cd nginx-1.5.7

[root@test nginx-1.5.7]# ./configure --prefix=/service/nginx --with-http_stub_status_module --with-google_perftools_module --with-pcre --with-http_ssl_module --lock-path=/service/nginx/nginx.lock --pid-path=/service/nginx/nginx.pid

........................

Configuration summary

+ using PCRE library: /service/pcre

+ using system OpenSSL library

+ md5: using OpenSSL library

+ sha1: using OpenSSL library

+ using system zlib library

nginx path prefix: "/service/nginx"

nginx binary file: "/service/nginx/sbin/nginx"

nginx configuration prefix: "/service/nginx/conf"

nginx configuration file: "/service/nginx/conf/nginx.conf"

nginx pid file: "/service/nginx/nginx.pid"

nginx error log file: "/service/nginx/logs/error.log"

nginx http access log file: "/service/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"

[root@test nginx-1.5.7]# make

[root@test nginx-1.5.7]# make install

[root@test software]# tar -zxvf nginx-1.5.7.tar.gz [root@test software]# cd nginx-1.5.7 [root@test nginx-1.5.7]# ./configure --prefix=/service/nginx --with-http_stub_status_module --with-google_perftools_module --with-pcre --with-http_ssl_module --lock-path=/service/nginx/nginx.lock --pid-path=/service/nginx/nginx.pid ........................ Configuration summary + using PCRE library: /service/pcre + using system OpenSSL library + md5: using OpenSSL library + sha1: using OpenSSL library + using system zlib library nginx path prefix: "/service/nginx" nginx binary file: "/service/nginx/sbin/nginx" nginx configuration prefix: "/service/nginx/conf" nginx configuration file: "/service/nginx/conf/nginx.conf" nginx pid file: "/service/nginx/nginx.pid" nginx error log file: "/service/nginx/logs/error.log" nginx http access log file: "/service/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" [root@test nginx-1.5.7]# make [root@test nginx-1.5.7]# make install


测试nginx

[root@test sbin]# ./nginx -t

nginx: the configuration file /service/nginx/conf/nginx.conf syntax is ok

nginx: configuration file /service/nginx/conf/nginx.conf test is successful

[root@test sbin]# ./nginx -v

nginx version: nginx/1.5.7

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/7ecea9c2408b51017fbd0ee164cc02ce.html