- 安裝NGINX
? ? - 安裝gcc g++的依賴庫
? ? ? ? * apt-get install build-essential
? ? ? ? * apt-get install libtool
? ? - 安裝 pcre依賴庫
? ? ? ? * sudo apt-get update
? ? ? ? * sudo apt-get install libpcre3 libpcre3-dev
? ? - 安裝 zlib依賴庫(http://www.zlib.net)
? ? ? ? * apt-get install zlib1g-dev
? ? - 安裝 ssl依賴庫
? ? ? ? * apt-get install openssl
? ? - 安裝Nginx(http://nginx.org)
? ? ? ? - 下載最新版本:
? ? ? ? ? ? * wget http://nginx.org/download/nginx-1.11.3.tar.gz
? ? ? ? - 解壓:
? ? ? ? ? ? * tar -zxvf nginx-1.11.3.tar.gz
? ? ? ? - 進(jìn)入解壓目錄:
? ? ? ? ? ? * cd nginx-1.11.3
? ? ? ? - 配置:
? ? ? ? ? ? * ./configure --prefix=/usr/local/nginx
? ? ? ? - 編輯NGINX:
? ? ? ? ? ? * make
? ? ? ? ? ? [注意:這里可能會(huì)報(bào)錯(cuò)芽唇,提示“pcre.h No such file or directory”,具體詳見:http://stackoverflow.com/questions/22555561/error-building-fatal-error-pcre-h-no-such-file-or-directory
需要安裝 libpcre3-dev,命令為:sudo apt-get install libpcre3-dev]
? ? ? ? - 安裝nginx:
? ? ? ? ? ? * sudo make install
? ? ? ? - 啟動(dòng)nginx:
? ? ? ? ? ? * sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
? ? ? ? ? ? ! 注意:-c 指定配置文件的路徑茎截,不加的話料滥,nginx會(huì)自動(dòng)加載默認(rèn)路徑的配置文件髓霞,可以通過 -h查看幫助命令。
? ? ? ? - 查看nginx進(jìn)程:
? ? ? ? ? ? * ps -ef|grep nginx
? ? ? ? - nginx管理操作(啟動(dòng)/關(guān)閉/ 管理)
? ? ? ? ? ? * ../sbin