Linux環境下安裝Nginx+Pcre+OpenSSL

Nginx需要其他第三方庫的支持,比如rewrite模塊需要pcre庫,ssl需要openssl庫

1、  PCRE庫的安裝:

官網:http://www.pcre.org/

選擇最新版本下載:

ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.10.tar.gz

解壓:

tar –zxvf pcre-8.10.tar.gz,解壓目錄爲:pcre-8.10

然後進入到 cd pcre-8.10,進行配置、編譯、安裝

./configure && make && make install


2、  OpenSSL庫的安裝

官網:http://www.openssl.org

下載頁面:http://www.openssl.org/source/

選擇最新版本下載

http://www.openssl.org/source/openssl-1.0.0a.tar.gz

tar –zxvf openssl-1.0.0.tar.gz,解壓目錄爲:openssl-1.0.0

然後進入到 cd openssl-1.0.0,進行配置、編譯、安裝

./configure && make && make install


3、  nginx安裝

官網:http://nginx.org

下載頁面:http://nginx.org/en/download.html

選擇最新版本下載:

http://nginx.org/download/nginx-0.8.53.tar.gz

解壓:

tar –zxvf nginx-0.8.53.tar.gz,解壓目錄爲:nginx-0.8.53

然後進入到 cd nginx-0.8.53,進行配置、編譯、安裝

按照一般的說明,也就是通過./config或./configure直接進行配置了,但配置後,在編譯make的時候很可能會報:

*** No rule to make target `clean’.  Stop.

等這樣的錯誤,所以僅僅通過./configure來進行配置是不夠的,至少在配置的時候需要指定openssl的安裝目錄,比如我的openssl安裝目錄是:openssl-1.0.0,則在配置的時候應該爲:

./configure –with-http_stub_status_module –with-http_ssl_module

–with-openssl=/usr/local/openssl-1.0.0 –with-http_gzip_static_module

這樣在編譯的時候纔會成功,接下來就是安裝:make install

安裝成功後,會生成一個nginx的目錄。

最後附完整安裝例子語句:

./configure –with-http_stub_status_module –with-http_ssl_module –with-openssl=/usr/local/openssl-1.0.0e –with-pcre=/usr/local/pcre-8.13 –with-http_gzip_static_module


如果用yum 安裝就這樣

yum -y install pcre-devel

yum -y install openssl-devel


./configure --user=refresh --group=refresh  --with-http_stub_status_module --with-http_ssl_module


make && make install



用yum安裝庫 的安裝腳本

echo '......install nginx........'
wget http://nginx.org/download/nginx-1.4.1.tar.gz
tar xvf nginx-1.4.1.tar.gz
cd nginx-1.4.1
yum -y install pcre-devel
yum -y install openssl-devel
./configure --user=refresh --group=refresh  --with-http_stub_status_module --with-http_ssl_module
make && make install
cd ..

wget https://pdsh.googlecode.com/files/pdsh-2.29.tar.bz2
tar xvf  pdsh-2.29.tar.bz2 && cd pdsh-2.29
./configure --with-ssh --without-rsh && make && make install


發佈了32 篇原創文章 · 獲贊 3 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章