{"id":33287,"date":"2023-12-05T17:24:19","date_gmt":"2022-09-25T21:22:34","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86nginx%e5%92%8clibressl%e4%b8%80%e8%b5%b7%e5%ae%89%e8%a3%85%e7%9a%84shell%e8%84%9a%e6%9c%ac%e3%80%82\/"},"modified":"2024-01-15T07:44:18","modified_gmt":"2024-01-14T23:44:18","slug":"%e5%b0%86nginx%e5%92%8clibressl%e4%b8%80%e8%b5%b7%e5%ae%89%e8%a3%85%e7%9a%84shell%e8%84%9a%e6%9c%ac%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86nginx%e5%92%8clibressl%e4%b8%80%e8%b5%b7%e5%ae%89%e8%a3%85%e7%9a%84shell%e8%84%9a%e6%9c%ac%e3%80%82\/","title":{"rendered":"\u5c06Nginx\u548cLibreSSL\u4e00\u8d77\u5b89\u88c5\u7684shell\u811a\u672c"},"content":{"rendered":"<pre class=\"post-pre\"><code>#!\/usr\/bin\/bash\r\nWORK_DIR=\/usr\/local\/src\r\nNGINX_VER=1.16.1\r\nLIBRESSL_VER=2.9.2\r\n\r\nNGINX_USER=nginx\r\nNGINX_GROUP=nginx\r\n\r\nREBUILD_LIBRESSL=false\r\nREBUILD_NGINX=false\r\n\r\nusage_exit() {\r\n        echo \"Usage: $0 [-Aln]\" 1&gt;&amp;2\r\n        exit 1\r\n}\r\n\r\nwhile getopts Alnh OPT\r\ndo\r\n        case $OPT in\r\n                A) REBUILD_LIBRESSL=true\r\n                   REBUILD_NGINX=true\r\n                        ;;\r\n                l) REBUILD_LIBRESSL=true\r\n                        ;;\r\n                n) REBUILD_NGINX=true\r\n                        ;;\r\n                h) usage_exit\r\n                        ;;\r\n                \\?) usage_exit\r\n                        ;;\r\n        esac\r\ndone\r\n\r\nif [ \"${REBUILD_LIBRESSL}\" != \"true\" -a \"${REBUILD_NGINX}\" != \"true\" ]; then\r\n        usage_exit\r\nfi\r\n\r\ncd ${WORK_DIR}\r\n\r\nwget -O libressl-${LIBRESSL_VER}.tar.gz http:\/\/ftp.openbsd.org\/pub\/OpenBSD\/LibreSSL\/libressl-${LIBRESSL_VER}.tar.gz\r\n\r\nrm -rf libressl-${LIBRESSL_VER}\r\ntar xzf libressl-${LIBRESSL_VER}.tar.gz &amp;&amp; cd libressl-${LIBRESSL_VER}\r\n\r\n## LibreSSL\r\nif [ \"${REBUILD_LIBRESSL}\" == \"true\" ]; then\r\n        CFLAGS=\"-march=native -O2 -m64 -pipe -fomit-frame-pointer -mfpmath=sse -msse4 -msse4.1 -msse4.2\" \\\r\n        CXXFLAGS=\"-march=native -O2 -m64 -pipe -fomit-frame-pointer -mfpmath=sse -msse4 -msse4.1 -msse4.2\" \\\r\n        .\/configure \\\r\n        --host=x86_64-redhat-linux-gnu \\\r\n        --build=x86_64-redhat-linux-gnu \\\r\n        --target=x86_64-redhat-linux \\\r\n        --program-prefix= \\\r\n        --prefix=\/usr\/local \\\r\n        --exec-prefix=\/usr\/local \\\r\n        --bindir=\/usr\/local\/bin \\\r\n        --sbindir=\/usr\/local\/sbin \\\r\n        --sysconfdir=\/etc \\\r\n        --datadir=\/usr\/local\/share \\\r\n        --includedir=\/usr\/local\/include \\\r\n        --libdir=\/usr\/local\/lib64 \\\r\n        --libexecdir=\/usr\/local\/libexec \\\r\n        --localstatedir=\/var \\\r\n        --sharedstatedir=\/usr\/com \\\r\n        --mandir=\/usr\/local\/share\/man \\\r\n        --infodir=\/usr\/local\/share\/info\r\n\r\n        make -j2 check\r\n        sudo make install\r\nfi\r\n\r\n## nginx\r\nif [ \"${REBUILD_NGINX}\" == \"true\" ]; then\r\n        cd ${WORK_DIR}\r\n\r\n        wget -O nginx-${NGINX_VER}.tar.gz http:\/\/nginx.org\/download\/nginx-${NGINX_VER}.tar.gz\r\n\r\n        rm -rf nginx-${NGINX_VER}\r\n        tar xzf nginx-${NGINX_VER}.tar.gz &amp;&amp; cd nginx-${NGINX_VER}\r\n\r\n        CFLAGS=\"-march=native -O2 -m64 -pipe -fomit-frame-pointer -mfpmath=sse -msse4 -msse4.1 -msse4.2\" \\\r\n        CXXFLAGS=\"-march=native -O2 -m64 -pipe -fomit-frame-pointer -mfpmath=sse -msse4 -msse4.1 -msse4.2\" \\\r\n        .\/configure \\\r\n        --prefix=\/usr\/local \\\r\n        --sbin-path=\/usr\/local\/sbin\/nginx \\\r\n        --conf-path=\/etc\/nginx\/nginx.conf \\\r\n        --pid-path=\/var\/run\/nginx.pid \\\r\n        --lock-path=\/var\/lock\/nginx.lock \\\r\n        --error-log-path=\/var\/log\/nginx\/error_log \\\r\n        --http-log-path=\/var\/log\/nginx\/access_log \\\r\n        --user=${NGINX_USER} \\\r\n        --group=${NGINX_GROUP} \\\r\n        --with-file-aio \\\r\n        --with-ipv6 \\\r\n        --with-http_realip_module \\\r\n        --with-http_addition_module \\\r\n        --with-http_gzip_static_module \\\r\n        --with-http_stub_status_module \\\r\n        --with-http_v2_module \\\r\n        --with-http_ssl_module \\\r\n        --with-poll_module \\\r\n        --with-sha1-asm \\\r\n        --with-sha1=\/usr\/include \\\r\n        --http-client-body-temp-path=\/tmp\/nginx_client\/ \\\r\n        --http-proxy-temp-path=\/tmp\/nginx_proxy\/ \\\r\n        --http-fastcgi-temp-path=\/tmp\/nginx_fcgi\/ \\\r\n        --without-mail_pop3_module \\\r\n        --without-mail_imap_module \\\r\n        --without-mail_smtp_module \\\r\n        --without-http_uwsgi_module \\\r\n        --without-http_scgi_module \\\r\n        --with-openssl=${WORK_DIR}\/libressl-${LIBRESSL_VER}\r\n\r\n        make -j2\r\n        sudo make install\r\nfi\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#!\/usr\/bin\/bash WORK_DIR=\/usr\/local\/src NGINX_VER=1.16. [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-33287","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5c06Nginx\u548cLibreSSL\u4e00\u8d77\u5b89\u88c5\u7684shell\u811a\u672c - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5c06nginx\u548clibressl\u4e00\u8d77\u5b89\u88c5\u7684shell\u811a\u672c\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5c06Nginx\u548cLibreSSL\u4e00\u8d77\u5b89\u88c5\u7684shell\u811a\u672c\" \/>\n<meta property=\"og:description\" content=\"#!\/usr\/bin\/bash WORK_DIR=\/usr\/local\/src NGINX_VER=1.16. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5c06nginx\u548clibressl\u4e00\u8d77\u5b89\u88c5\u7684shell\u811a\u672c\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-25T21:22:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-14T23:44:18+00:00\" \/>\n<meta name=\"author\" content=\"\u6e05, \u626c\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6e05, \u626c\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86nginx%e5%92%8clibressl%e4%b8%80%e8%b5%b7%e5%ae%89%e8%a3%85%e7%9a%84shell%e8%84%9a%e6%9c%ac%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86nginx%e5%92%8clibressl%e4%b8%80%e8%b5%b7%e5%ae%89%e8%a3%85%e7%9a%84shell%e8%84%9a%e6%9c%ac%e3%80%82\/\",\"name\":\"\u5c06Nginx\u548cLibreSSL\u4e00\u8d77\u5b89\u88c5\u7684shell\u811a\u672c - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2022-09-25T21:22:34+00:00\",\"dateModified\":\"2024-01-14T23:44:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86nginx%e5%92%8clibressl%e4%b8%80%e8%b5%b7%e5%ae%89%e8%a3%85%e7%9a%84shell%e8%84%9a%e6%9c%ac%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86nginx%e5%92%8clibressl%e4%b8%80%e8%b5%b7%e5%ae%89%e8%a3%85%e7%9a%84shell%e8%84%9a%e6%9c%ac%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86nginx%e5%92%8clibressl%e4%b8%80%e8%b5%b7%e5%ae%89%e8%a3%85%e7%9a%84shell%e8%84%9a%e6%9c%ac%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5c06Nginx\u548cLibreSSL\u4e00\u8d77\u5b89\u88c5\u7684shell\u811a\u672c\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461\",\"name\":\"\u6e05, \u626c\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g\",\"caption\":\"\u6e05, \u626c\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyang\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86nginx%e5%92%8clibressl%e4%b8%80%e8%b5%b7%e5%ae%89%e8%a3%85%e7%9a%84shell%e8%84%9a%e6%9c%ac%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5c06Nginx\u548cLibreSSL\u4e00\u8d77\u5b89\u88c5\u7684shell\u811a\u672c - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5c06nginx\u548clibressl\u4e00\u8d77\u5b89\u88c5\u7684shell\u811a\u672c\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5c06Nginx\u548cLibreSSL\u4e00\u8d77\u5b89\u88c5\u7684shell\u811a\u672c","og_description":"#!\/usr\/bin\/bash WORK_DIR=\/usr\/local\/src NGINX_VER=1.16. [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5c06nginx\u548clibressl\u4e00\u8d77\u5b89\u88c5\u7684shell\u811a\u672c\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-09-25T21:22:34+00:00","article_modified_time":"2024-01-14T23:44:18+00:00","author":"\u6e05, \u626c","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u6e05, \u626c","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86nginx%e5%92%8clibressl%e4%b8%80%e8%b5%b7%e5%ae%89%e8%a3%85%e7%9a%84shell%e8%84%9a%e6%9c%ac%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86nginx%e5%92%8clibressl%e4%b8%80%e8%b5%b7%e5%ae%89%e8%a3%85%e7%9a%84shell%e8%84%9a%e6%9c%ac%e3%80%82\/","name":"\u5c06Nginx\u548cLibreSSL\u4e00\u8d77\u5b89\u88c5\u7684shell\u811a\u672c - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2022-09-25T21:22:34+00:00","dateModified":"2024-01-14T23:44:18+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86nginx%e5%92%8clibressl%e4%b8%80%e8%b5%b7%e5%ae%89%e8%a3%85%e7%9a%84shell%e8%84%9a%e6%9c%ac%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86nginx%e5%92%8clibressl%e4%b8%80%e8%b5%b7%e5%ae%89%e8%a3%85%e7%9a%84shell%e8%84%9a%e6%9c%ac%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86nginx%e5%92%8clibressl%e4%b8%80%e8%b5%b7%e5%ae%89%e8%a3%85%e7%9a%84shell%e8%84%9a%e6%9c%ac%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5c06Nginx\u548cLibreSSL\u4e00\u8d77\u5b89\u88c5\u7684shell\u811a\u672c"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461","name":"\u6e05, \u626c","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g","caption":"\u6e05, \u626c"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyang\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86nginx%e5%92%8clibressl%e4%b8%80%e8%b5%b7%e5%ae%89%e8%a3%85%e7%9a%84shell%e8%84%9a%e6%9c%ac%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=33287"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33287\/revisions"}],"predecessor-version":[{"id":52986,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33287\/revisions\/52986"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=33287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=33287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=33287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}