centos6.5編譯安裝nginx
阿新 • • 發佈:2017-09-07
php 相關 oca module eve tar 瀏覽器 reat nss
一、下載nginx安裝包,官網下載中心http://nginx.org/download
[[email protected] software]# wget http://nginx.org/download/nginx-1.10.1.tar.gz
二、解壓nginx安裝包
[[email protected] software]# tar -xzvf nginx-1.10.1.tar.gz
三、安裝相關庫和安裝依賴(gzip模塊需要 zlib 庫,rewrite模塊需要 pcre 庫,ssl 功能需要openssl庫)
[[email protected] software]# yum -y install gcc pcre-devel zlib-devel openssl-devel
四、執行configure命令(--prefix是打算將Nginx安裝路徑)
[[email protected] nginx-1.10.1]# ./configure --prefix=/usr/local/nginx
//執行configure成功後,顯示的信息。 checking for zlib library ... found creating objs/Makefile Configuration summary + using system PCRE library + OpenSSL library is not used + using builtin md5 code + sha1 library is not found + using system zlib library nginx path prefix: "/usr/local/nginx" nginx binary file: "/usr/local/nginx/sbin/nginx" nginx modules path: "/usr/local/nginx/modules" 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"
五、編譯安裝(make && make install)
[[email protected] nginx-1.10.1]# make && make install
六、啟動nginx服務
[[email protected] nginx-1.10.1]# cd /usr/local/nginx/ [[email protected] nginx]# ./sbin/nginx
七、安裝成功(通過瀏覽器訪問,記得開放80端口或者關閉防火墻)
centos6.5編譯安裝nginx