1、安裝GCC編譯環境,若是有則不須要html
1)安裝mpc庫nginx
2)安裝gmp庫瀏覽器
3)安裝mpfr庫tcp
4) 安裝GCC.net
以上GCC的安裝不綴述,可參考各類大神步驟;htm
2、安裝pcre庫blog
https://sourceforge.net/projects/pcre/files/pcre/進程
下載後解壓並在解壓文件夾目錄內ssl
./configureopenssl
make
make install
若是須要安裝的庫都安裝了在執行./configure時還報錯,則可用如下參數從新執行; ./configure --disable-shared --with-pic
3、安裝zlib庫
http://zlib.net/zlib-1.2.8.tar.gz
./configure
make
make install
4、安裝openssl庫
https://www.openssl.org/
./configure
make
make install
以上不安裝的話,在編譯會各類報錯;另外,安裝完以上後須要將其bin目錄添加到PATH中,不然編譯會因找不到全命令報錯;
5、NGINX安裝
http://nginx.org/en/download.html
一樣在解壓後進入文件夾執行三步
./configure
make
make install
如下,完成了安裝,經過 /usr/local/nginx/sbin/nginx 完成啓動;查看進程是否已經啓動:
ps -ef | grep nginx
root 19476 1 0 08:34 ? 00:00:00 nginx: master process ./nginx
nobody 19477 19476 0 08:34 ? 00:00:00 nginx: worker process
有一個主進程,有一個處理進程;
查看是否監聽80端口
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
瀏覽器輸入 http://安裝機器的IP/ ,如 http://localhost/
顯示進入到了nginx的歡迎頁面,即安裝成功。