VPS上安裝nginx來架設代理 更新中
伺服器環境:CentOS 6 64位
cd ~
下載nginx安裝包:
Bing搜尋了nginx,點開http://nginx.org/ 選擇1.7.10版本下載原始碼。
得到nginx-1.7.10.tar.gz
tar zxvf nginx-1.7.10.tar.gz
cd到資料夾裡面去
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_sub_module --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module
提示:沒有C編譯器。
yum install gcc
繼續configure
提示:沒有pcre
好吧,看看nginx官網的document中怎麼寫的configure:
http://nginx.org/en/docs/configure.html
rpm -ql pcre 出現好多路徑,配置了都不管用。只好下載原始碼。
於是去下載pcre
./configure
沒有C++
yum install gcc-c++
pcre裡面 ./configure成功。
make && make install pcre安裝成功
繼續nginx裡面./configure
提示openssl找不到
yum install openssl了 已安裝了。無奈 下載openssl的原始碼。解壓。加上:
--with-openssl=/root/openssl-1.0.2
下載zlib原始碼。解壓。加上:
--with-zlib=/root/zlib-1.2.8
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_sub_module --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-openssl=/root/openssl-1.0.2 --with-zlib=/root/zlib-1.2.8
成功。
make && make install 成功