nginx原始碼安裝
安裝環境:
作業系統:ubuntu 12.04
nginx: v1.4.2
pcre: v8.33
zlib: v1.2.8
1. 安裝zlib
(1)解壓縮
[plain]
tdtc100@ubuntu:~$ tar zxvf zlib-1.2.8.tar.gz
(2)安裝
[plain]
tdtc100@ubuntu:~$ cd zlib-1.2.8
tdtc100@ubuntu:~/zlib-1.2.8$ ./configure
tdtc100@ubuntu:~/zlib-1.2.8$ make
tdtc100@ubuntu:~/zlib-1.2.8$ sudo make install
2. 安裝pcre
(1) 安裝依賴包
c++[plain]
sudo apt-get install build-essential
注:如果不安裝,在進行(3)時,會出現:
[plain]
configure: error: you need a c++ compiler for c++ support.
(2)解壓縮
[plain]
tdtc100@ubuntu:~$ tar zxvf pcre-8.33.tar.gz
(3)安裝
[plain]
tdtc100@ubuntu:~$ cd pcre-8.33
tdtc100@ubuntu:~/pcre-8.33$ ./configure
tdtc100@ubuntu:~/pcre-8.33$ make
tdtc100@ubuntu:~/pcre-8.33$ sudo make install
3. 安裝nginx
(1)安裝依賴包
open-ssl library
[plain]
sudo apt-get install libcurl4-openssl-dev
注:如果不安裝,在進行(3)時,會出現:
[plain]
./configure: error: ssl modules require the openssl library.
you can either do not enable the modules, or install the openssl library
into the system, or build the openssl library statically from the source
with nginx by using --with-openssl=option.
(2)解壓縮
[plain]
tdtc100@ubuntu:~$ tar zxvf nginx-1.4.2.tar.gz
(3)安裝
參考官方文件
-------------------------安裝完畢-----------------------xiaobin_hlj80-------------------------------------------
執行:[plain]
tdtc100@ubuntu:/usr/local/nginx$ sudo ./nginx
執行效果:
Nginx原始碼安裝
解壓 tar zxvf nginx 1.10.0.tar.gz 執行下面的命令安裝nginx的依賴庫 yum y install gcc pcre pcre devel zlib zlib devel openssl openssl devel我這裡只配置安裝到 opt目錄下,其它選項可執行.con...
nginx 原始碼安裝
缺少 pcre 安裝包 筆者用的是ubuntu apt install libpcre3 libpcre3 dev 缺少 openssl 安裝包 筆者用的是ubuntu apt install openssl apt install libssl dev 再次執行 nginx 指令碼內容 1 bin...
Nginx 原始碼安裝
安裝pcre庫是為了讓nginx支援具備uri重寫功能的rewrite模組 root www yum install pcre pcre devel y root www rpm qa pcre pcre devel安裝nginx 依賴的包 openssl devel root www yum in...