超碰在线91,国产第1页,国产精品99,最近中文字幕av

<video id="z2k50"><ins id="z2k50"></ins></video><small id="z2k50"><pre id="z2k50"><samp id="z2k50"></samp></pre></small>

    1. <video id="z2k50"><ins id="z2k50"></ins></video>

        nginx添加模塊與https支持

        發(fā)布時(shí)間:2024-06-12
        建站服務(wù)器
        實(shí)例1:為已安裝nginx動(dòng)態(tài)添加模塊
        以安裝rtmp媒流模塊為例:
        1)下載第三方模塊到
        [root@lnmp nginx-1.8.1]# git clone https://github.com/arut/nginx-rtmp-module.git
        2)查看nginx編譯安裝時(shí)安裝的模塊
        [root@lnmpnginx-1.8.1]#nginx-vnginxversion:nginx/1.8.1builtbygcc4.4.720120313(redhat4.4.7-18)(gcc)builtwithopenssl1.0.1e-fips11feb2013tlssnisupportenabledconfigurearguments:--user=nginx--group=nginx--prefix=/usr/local/nginx--with-http_ssl_module--with-http_stub_status_module--with-http_ssl_module3)cd到源碼目錄添加模塊重新配置編譯
        [root@lnmpnginx]#cd/root/tools/nginx-1.8.1[root@lnmpnginx-1.8.1]#./configure--user=nginx--group=nginx--prefix=/usr/local/nginx--with-http_ssl_module--with-http_stub_status_module--with-http_ssl_module--add-module=/root/tools/nginx-1.8.1/nginx-rtmp-module[root@lnmpnginx-1.8.1]#make#此處只進(jìn)行編譯不進(jìn)行安裝,如安裝的話會(huì)覆蓋源文件。
        4)在編譯完成后,會(huì)在當(dāng)前目錄下生成一個(gè)objs文件夾,將nginx二進(jìn)制文件拷貝到源安裝目錄下,注意備份源文件,然后查看編譯后的模塊。
        [root@lnmpnginx-1.8.1]#mv/usr/local/nginx/sbin/nginx/usr/local/nginx/sbin/nginx.20170825[root@lnmpnginx-1.8.1]#cpobjs/nginx/usr/local/nginx/sbin/nginx[root@lnmpnginx-1.8.1]#nginx-vnginxversion:nginx/1.8.1builtbygcc4.4.720120313(redhat4.4.7-18)(gcc)builtwithopenssl1.0.1e-fips11feb2013tlssnisupportenabledconfigurearguments:--user=nginx--group=nginx--prefix=/usr/local/nginx--with-http_ssl_module--with-http_stub_status_module--with-http_ssl_module--add-module=/root/tools/nginx-1.8.1/nginx-rtmp-module[root@lnmpnginx-1.8.1]#nginx-sreload
        實(shí)例2:nginx使用ssl模塊配置https支持
        1、生成證書(shū)(注意此證書(shū)為自己頒發(fā)的在公網(wǎng)上不受信任)
        1)生成一個(gè)rsa密鑰:
        [root@lnmpssl]#opensslgenrsa-des3-outtest.key1024generatingrsaprivatekey,1024bitlongmodulus.............................. ........................... eis65537(0x10001)enterpassphrasefortest.key:#輸入密碼,需要復(fù)雜性要求verifying-enterpassphrasefortest.key:#重復(fù)密碼2)拷貝剛才的密碼文件,生成一個(gè)不需要密碼的密鑰文件:
        [root@lnmpssl]#opensslrsa-intest.key-outtest_nopass.keyenterpassphrasefortest.key:#輸入以上創(chuàng)建時(shí)輸入的密碼writingrsakey3)生成一個(gè)證書(shū)請(qǐng)求文件
        [root@lnmpssl]#opensslreq-new-keytest.key-outtest.csrenterpassphrasefortest.key:#輸入以上創(chuàng)建時(shí)輸入的密碼youareabouttobeaskedtoenterinformationthatwillbeincorporatedintoyourcertificaterequest.whatyouareabouttoenteriswhatiscalledadistinguishednameoradn.therearequiteafewfieldsbutyoucanleavesomeblankforsomefieldstherewillbeadefaultvalue,ifyouenter\\\'.\\\',thefieldwillbeleftblank.-----countryname(2lettercode)[xx]:cn#國(guó)家stateorprovincename(fullname)[]:shanghai#省份localityname(eg,city)[defaultcity]:shanghai#城市organizationname(eg,company)[defaultcompanyltd]:shanghaiinformationcompanyltd#具體名稱organizationalunitname(eg,section)[]:test#單位名稱commonname(eg,yournameoryourserver\\\'\\\'shostname)[]:*.test.cn#服務(wù)器域名emailaddress[]:admin@test.cn#郵箱pleaseenterthefollowing\\\'extra\\\'attributestobesentwithyourcertificaterequestachallengepassword[]:#密碼為空,直接回車(chē)anoptionalcompanyname[]:#密碼為空,直接回車(chē)4)自己簽發(fā)證書(shū)
        [root@lnmpssl]#opensslx509-req-days365-intest.csr-signkeytest.key-outtest.crtsignatureoksubject=/c=cn/st=shanghai/l=shanghai/o=shanghaiinformationcompanyltd/ou=test/cn=*.test.cn/emailaddress=admin@test.cngettingprivatekeyenterpassphrasefortest.key:#輸入test.key設(shè)置的密碼
        2、配置nginx.conf文件
        [root@lnmpssl]#vim/usr/local/nginx/conf/nginx.conf添加如下:server{listen80;server_namelocalhost;listen443;#監(jiān)聽(tīng)端口sslon;#開(kāi)啟sslssl_certificate/usr/local/nginx/conf/test.crt;#指定證書(shū)位置ssl_certificate_key/usr/local/nginx/conf/test_nopass.key;#指定密鑰文件,如此處使用test.key則每次啟動(dòng)nginx服務(wù)器需要舒服key密碼。[root@lnmpssl]#nginx-sreload#重加載配置———————————–end—————————————————–
        上一個(gè):X熒光土壤重金屬檢測(cè)儀日常維護(hù)工作非常重要
        下一個(gè):塑料瓶測(cè)厚儀使用指南

        油浴鍋?zhàn)⒁馐马?xiàng)
        新型橡塑保溫管質(zhì)量好
        非法經(jīng)營(yíng)罪的相關(guān)法律規(guī)定
        了解一下雙層油罐施工步驟
        CR0402JF0111G 麗智電阻0402 110Ω ±5% 1/16W
        為什么你喝茶總傷胃?如何做到黑茶養(yǎng)胃
        麗江哪里婚紗攝影好,新人不容錯(cuò)過(guò)的婚紗照拍攝地
        怎樣屏蔽短信驗(yàn)證碼轟炸(怎樣屏蔽短信通知)
        中國(guó)四大茶道流派簡(jiǎn)介
        新疆霍爾果斯口岸開(kāi)展汽車(chē)衡專項(xiàng)整治行動(dòng)