溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

nginx-1.16.1安裝

發(fā)布時(shí)間:2020-09-09 13:02:58 來源:網(wǎng)絡(luò) 閱讀:375 作者:Mart_sea 欄目:系統(tǒng)運(yùn)維

一、官網(wǎng)下載源碼
http://nginx.org/en/download.html

二、上傳到指定的安裝目錄

tar vxf nginx-1.16.1.tar.gz
cd cd nginx-1.16.1 && ./config --prefix=/etc/nginx

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

安裝需要的插件

yum -y install openssl openssl-devel

checking for zlib library ... not found

./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.

安裝需要的插件

yum install zlib-devel -y

./configure --prefix=/usr/local/nginx

make

三、啟動(dòng)nginx
./sbin/nginx

四、查看nginx 啟動(dòng)配置詳情
./sbin/nginx -t

五、隱藏nginx版本號(hào)
vim conf/nginx.conf
http server 路徑下添加 server_tokens off;

        vim conf/fastcgi.conf
        修改  fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
        fastcgi_param  SERVER_SOFTWARE    nginx;

        重啟或者reload nginx
        pkill nginx && ./sbin/nginx
向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI