檢測是否有已安裝rpm包:node
rpm–qa | grep pcrelinux
rpm–qa | grep zlibnginx
rpm–qa | grep opensslc++
若沒有則需安裝(這些包能夠在redhat的安裝光盤貨鏡像中找到):spa
rpm -ivh zlib-1.2.3-29.el6.x86_64.rpm -f --nodeps進程
rpm -ivh zlib-devel-1.2.3-29.el6.x86_64.rpm -f --nodepsssl
rpm -ivh pcre-7.8-6.el6.x86_64.rpm -f --nodeps編譯器
rpm -ivh pcre-devel-7.8-6.el6.x86_64.rpm -f --nodepsopenssl
rpm -ivh openssl-1.0.0-27.el6.x86_64.rpm -f --nodeps編譯
rpm -ivh openssl-devel-1.0.0-27.el6.x86_64.rpm -f --nodeps
刪除rpm:
rpm –e XXXXXXX.rpm -f --nodeps
find / -name gcc
find / -name make
若未安裝gcc編譯器,或者/usr/libexec/gcc/x86_64-redhat-linux/4.4.4下並無cc1則須要安裝gcc
依次安裝以下包:
kernel-headers-2.6.32-358.el6.x86_64.rpm
glibc-headers-2.12-1.107.el6.x86_64.rpm
glibc-devel-2.12-1.107.el6.x86_64.rpm
compat-libf2c-34-3.4.6-19.el6.x86_64.rpm
mpfr-2.4.1-6.el6.x86_64.rpm
ppl-0.10.2-11.el6.x86_64.rpm
cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
cpp-4.4.7-3.el6.x86_64.rpm
libstdc++-devel-4.4.7-3.el6.x86_64.rpm
compat-gcc-34-3.4.6-19.el6.x86_64.rpm
compat-gcc-34-c++-3.4.6-19.el6.x86_64.rpm
compat-gcc-34-g77-3.4.6-19.el6.x86_64.rpm
gcc-4.4.7-3.el6.x86_64.rpm
安裝完畢後執行gcc–v 能夠看到gcc的版本號表明安裝成功
從官網下載此三個安裝包(zlib-1.2.8.tar.gz,pcre-8.36.tar.gz,openssl-1.0.2d.tar.gz)
Zlib:
至你的指定目錄解壓:tar–zxvf zlib-1.2.8.tar.gz
進入:cd zlib-1.2.8
配置:./configure
編譯:make
安裝:make install
Pcre:
至你的指定目錄解壓:tar–zxvf pcre-8.36.tar.gz
進入:cd pcre-8.36
配置:./configure
編譯:make
安裝:make install
Openssl:
至你的指定目錄解壓:tar–zxvf openssl-1.0.2d.tar.gz
進入:cd openssl-1.0.2d
配置:./config
編譯:make
安裝:make install
從官網下載此安裝包nginx-1.8.0.tar.gz
Nginx:
至你的指定目錄解壓:tar–zxvf nginx-1.8.0.tar.gz
進入:cd nginx-1.8.0
配置:./configure
編譯:make
安裝:make install
增長軟鏈接:
執行ls /lib64/ | grep pcre
會顯示以下信息:
libpcre.so.0
libpcre.so.0.0.1
而後添加軟鏈接:
執行命令ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
啓動:/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
重啓:/usr/local/nginx/sbin/nginx -s reload
中止:ps–ef | grepnginx(查看進程號)
kill -9 主進程號
kill -9 子進程號(可能有多個)