{"id":32886,"date":"2023-12-10T13:54:56","date_gmt":"2023-09-19T16:25:30","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%af%b9%e4%ba%8e%e9%82%a3%e4%ba%9b%e5%9c%a8centos-7%e4%b8%8a%e6%83%b3%e4%bd%bf%e7%94%a8http-3%e7%9a%84nginx%ef%bc%8c%e4%bd%86%e4%b8%8d%e6%83%b3%e4%bd%bf%e7%94%a8rpm%e6%88%96ninja%e7%9a%84%e4%ba%ba\/"},"modified":"2024-05-04T12:57:07","modified_gmt":"2024-05-04T04:57:07","slug":"%e5%af%b9%e4%ba%8e%e9%82%a3%e4%ba%9b%e5%9c%a8centos-7%e4%b8%8a%e6%83%b3%e4%bd%bf%e7%94%a8http-3%e7%9a%84nginx%ef%bc%8c%e4%bd%86%e4%b8%8d%e6%83%b3%e4%bd%bf%e7%94%a8rpm%e6%88%96ninja%e7%9a%84%e4%ba%ba","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%af%b9%e4%ba%8e%e9%82%a3%e4%ba%9b%e5%9c%a8centos-7%e4%b8%8a%e6%83%b3%e4%bd%bf%e7%94%a8http-3%e7%9a%84nginx%ef%bc%8c%e4%bd%86%e4%b8%8d%e6%83%b3%e4%bd%bf%e7%94%a8rpm%e6%88%96ninja%e7%9a%84%e4%ba%ba\/","title":{"rendered":"\u5bf9\u4e8e\u90a3\u4e9b\u5728CentOS 7\u4e0a\u60f3\u4f7f\u7528HTTP\/3\u7684nginx\uff0c\u4f46\u4e0d\u60f3\u4f7f\u7528rpm\u6216ninja\u7684\u4eba\uff0c\u8fd9\u662f\u4e00\u4efd\u5907\u5fd8\u5f55"},"content":{"rendered":"<h1>\u539f\u59cb\u4e8b\u5b9e\u548c\u80cc\u666f<\/h1>\n<p>&nbsp;<\/p>\n<p>\u6211\u60f3\u5728CentOS7\u4e0a\u4f7f\u7528\u5b8c\u5168\u652f\u6301HTTP\/1.1\u3001HTTP\/2\u548cHTTP\/3\u7684nginx\uff0c\u5e76\u5728\u641c\u7d22\u4e2d\u53d1\u73b0\u4e86\u8fd9\u7bc7\u6587\u7ae0\u3002<br \/>\nQuiche\u7684\u8865\u4e01\u4f3c\u4e4e\u662f\u7528\u4e8e\u5b9e\u9a8c\u6027\u7684HTTP\/3\u7248\u672c\uff0c\u800c\u4f7f\u7528OpenSSL\u7684Google\u5206\u652fBoringSSL\u53ef\u80fd\u4f1a\u66f4\u52a0\u65b9\u4fbf\uff0c\u6240\u4ee5\u6211\u9009\u62e9\u4e86\u8fd9\u4e2a\u914d\u7f6e\u3002<\/p>\n<p>\u7136\u800c\uff0c\u6211\u6ca1\u6709\u65f6\u95f4\u6784\u5efa\u5fcd\u8005\uff0c\u5e76\u4e14\u5b9e\u9645\u4e0a\u6211\u4e5f\u4e0d\u592a\u7406\u89e3npm\u662f\u4ec0\u4e48\u3002\u6211\u53ea\u77e5\u9053\u5b83\u662f\u7528\u4e8e\u5b89\u88c5\u5305\u7684\u5de5\u5177\uff1f\u6216\u8005\u4ec5\u9650\u4e8e\u8fd9\u79cd\u8ba4\u8bc6\u3002<\/p>\n<h1>\u8981\u6c42\u8fdb\u884c\u8f6f\u4ef6\u66f4\u65b0\u3002<\/h1>\n<h2>Cmake (\u4e00\u79cd\u8de8\u5e73\u53f0\u7684\u6784\u5efa\u5de5\u5177).<\/h2>\n<p>\u9700\u8981Cmake 3.10\u6216\u66f4\u9ad8\u7248\u672c\u624d\u80fd\u4f7f\u7528BoringSSL\u3002<br \/>\n\u5728CentOS7\u7684yum\u4e2d\u53ea\u80fd\u5b89\u88c52.8.12\u7248\u672c\u3002\u56e0\u6b64\uff0c\u9700\u8981\u4ece\u6e90\u4ee3\u7801\u5b89\u88c5Cmake\u3002<br \/>\n\u672c\u6587\u4f7f\u7528\u7684\u662f\u6700\u65b0\u7248\u672cv3.25.1\uff0c\u4f46\u8bf7\u6839\u636e\u9700\u8981\u81ea\u884c\u66ff\u6362\u4e3a\u66f4\u65b0\u7684\u7248\u672c\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> wget https:\/\/github.com\/Kitware\/CMake\/releases\/download\/v3.25.1\/cmake-3.25.1-linux-x86_64.sh\r\n<span class=\"gp\">$<\/span> sh cmake-3.25.1-linux-x86_64.sh\r\n<\/code><\/pre>\n<p>\u5b89\u88c5\u7a0b\u5e8f\u5373\u5c06\u542f\u52a8\u3002<\/p>\n<pre class=\"post-pre\"><code>CMake Installer Version: 3.25.1, Copyright (c) Kitware\r\nThis is a self-extracting archive.\r\nThe archive will be extracted to: \/root\/cmake\r\n\r\nIf you want to stop extracting, please press &lt;ctrl-C&gt;.\r\nCMake - Cross Platform Makefile Generator\r\nCopyright 2000-2022 Kitware, Inc. and Contributors\r\nAll rights reserved.\r\n\r\n\uff08\u4e2d\u7565\uff09\r\n\r\nDo you accept the license? [yn]: y\r\n<\/code><\/pre>\n<p>\u4f1a\u8be2\u95eeCmake\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u7531\u4e8e\u4e0d\u592a\u4e86\u89e3\u5176\u4e2d\u7684\u533a\u522b\uff0c\u6682\u65f6\u9009\u62e9\u4e86\u201c\u5426\u201d\uff0c\u7136\u540e\u81ea\u5df1\u5b89\u88c5\u5230\u4e86\/usr\/local\/\u76ee\u5f55\u4e0b\u3002<\/p>\n<pre class=\"post-pre\"><code>By default the CMake will be installed in:\r\n  \"\/root\/cmake\/cmake-3.25.1-linux-x86_64\"\r\nDo you want to include the subdirectory cmake-3.25.1-linux-x86_64?\r\nSaying no will install in: \"\/root\/cmake\" [Yn]: n\r\n\r\nUsing target directory: \/root\/cmake\r\nExtracting, please wait...\r\n\r\nUnpacking finished successfully\r\n<\/code><\/pre>\n<p>\u81ea\u5df1\u5c06\u5176\u653e\u5165\/usr\/local\/\u76ee\u5f55\u4e2d\u3002\u7531\u4e8e\u4f7f\u7528mv\u547d\u4ee4\u8fdb\u884c\u8986\u76d6\u65f6\u53ef\u80fd\u4f1a\u9020\u6210\u7edd\u671b\u7684\u60c5\u51b5\uff0c\u56e0\u6b64\u5e94\u4f7f\u7528cp\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> <span class=\"nb\">cp<\/span> <span class=\"nt\">-r<\/span> bin doc man share \/usr\/local\/\r\n<\/code><\/pre>\n<p>Cmake\u5df2\u7ecf\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> cmake <span class=\"nt\">--version<\/span>\r\n<span class=\"go\">cmake version 3.25.1\r\n\r\nCMake suite maintained and supported by Kitware (kitware.com\/cmake).\r\n<\/span><\/code><\/pre>\n<h2>\u4f7f\u7528Perl<\/h2>\n<p>\u6211\u4eec\u9700\u8981\u5728BoringSSL\u4e2d\u4f7f\u7528Perl\u3002\u7531\u4e8eyum\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\uff0c\u56e0\u6b64\u6211\u4eec\u5c06\u4f7f\u7528yum\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">sudo yum install perl\r\n<\/span><\/code><\/pre>\n<h2>\u53bb<\/h2>\n<p>\u9700\u8981Go\u6765\u5b89\u88c5BoringSSL\u3002\uff08BoringSSL\u9700\u8981\u7684\u8f6f\u4ef6\u5f88\u591a\u5417\uff1f\uff09\u53ef\u4ee5\u4f7f\u7528yum\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">sudo yum install golang\r\n<\/span><\/code><\/pre>\n<h2>gcc \u53ef\u4ee5\u8868\u793aGNU\u7f16\u8bd1\u5668\u5957\u4ef6\u4e2d\u7684GNU\u7f16\u8bd1\u5668\uff08GNU Compiler Collection\uff09<\/h2>\n<p>CentOS7\u7684\u6807\u51c64.8.5\u7248\u672c\u8fc7\u65e7\uff0c\u9700\u8981\u8fdb\u884c\u66f4\u65b0\u3002<br \/>\n\u56e0\u6b64\uff0c\u901a\u8fc7yum\u5b89\u88c5devtoolset-11\u5e76\u8bbe\u7f6ePATH\u540e\uff0c\u4f7f\u7528gcc\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n<p>\u7531\u4e8e devtoolset-11 \u5df2\u5305\u542b\u5728 centos-release-scl \u5b58\u50a8\u5e93\u4e2d\uff0c\u56e0\u6b64\u5728\u5b89\u88c5 devtoolset-11 \u4e4b\u524d\uff0c\u9700\u8981\u5148\u5b89\u88c5 centos-release-scl\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> yum <span class=\"nb\">install <\/span>centos-release-scl\r\n<span class=\"gp\">$<\/span> yum <span class=\"nb\">install <\/span>devtoolset-11\r\n<\/code><\/pre>\n<p>\u5982\u679c\u60a8\u8981\u6267\u884c\u6b64\u64cd\u4f5c\uff0c\u8bf7\u5728BoringSSL\u7684cmake\u65f6\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"gp\">export PATH=\/opt\/rh\/devtoolset-11\/root\/bin:$<\/span>PATH\r\n<\/code><\/pre>\n<h1>\u5378\u8f7d\u7ade\u5408\u5e93\u3002<\/h1>\n<h2>\u5f00\u653e\u5b89\u5168\u5957\u63a5\u5b57\u5c42<\/h2>\n<p>\u5982\u679c\u5df2\u7ecf\u5b89\u88c5\u4e86OpenSSL\uff0c\u4e3a\u4e86\u907f\u514d\u4e0eBoringSSL\u4ea7\u751f\u51b2\u7a81\uff08\u6216\u8005\u6709\u53ef\u80fd\u51b2\u7a81\uff09\uff0c\u9700\u8981\u5378\u8f7dOpenSSL\uff0c\u6545\u8fdb\u884c\u5378\u8f7d\u64cd\u4f5c\u3002<\/p>\n<h3>\u901a\u8fc7 yum \u8fdb\u884c\u5378\u8f7d\u3002<\/h3>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> <span class=\"nb\">sudo <\/span>yum remove uninstall\r\n<\/code><\/pre>\n<h3>\u5378\u8f7d\u5df2\u7ecf\u5b89\u88c5\u597d\u7684\u4e1c\u897f\u3002<\/h3>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> <span class=\"nb\">cd<\/span> \/path\/to\/source\/openssl\r\n<span class=\"gp\">$<\/span> <span class=\"nb\">sudo <\/span>make uninstall\r\n<\/code><\/pre>\n<h1>\u5b89\u88c5\u5fc5\u8981\u7684\u5e93<\/h1>\n<h2>\u65e0\u804a\u7684SSL<\/h2>\n<p>&nbsp;<\/p>\n<p>\u8bf7\u6309\u7167BUILDING.md\u6587\u4ef6\u7684\u8bf4\u660e\u8fdb\u884c\u5b89\u88c5\u3002<br \/>\n\u4f46\u662f\u5982\u679c\u6309\u7167\u8fd9\u6837\u8fdb\u884c\u5b89\u88c5\uff0c\u5c06\u4f1a\u5728\u610f\u60f3\u4e0d\u5230\u7684\u4f4d\u7f6e2\u4e0a\u8fdb\u884c\u5b89\u88c5\uff0c\u6240\u4ee5\u8bf7\u5728configure\u4e2d\u8bbe\u7f6ecmake\u7684\u524d\u7f00\u3002\u8bf7\u5404\u81ea\u8fdb\u884c\u8bbe\u7f6e\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> git clone https:\/\/github.com\/google\/boringssl.git\r\n<span class=\"gp\">#<\/span> <span class=\"nb\">cd <\/span>boringssl\r\n\r\n<span class=\"gp\">$<\/span> <span class=\"nb\">mkdir <\/span>build\r\n<span class=\"gp\">$<\/span> <span class=\"nb\">cd <\/span>build\r\n<span class=\"gp\">$<\/span> cmake <span class=\"nt\">-DCMAKE_INSTALL_PREFIX<\/span><span class=\"o\">=<\/span>\/usr\/local\/lib\/boringssl ..\r\n<span class=\"gp\">$<\/span> make\r\n<span class=\"gp\">$<\/span> make <span class=\"nb\">install<\/span>\r\n\r\n<span class=\"gp\">$<\/span> <span class=\"c\"># \u30ea\u30f3\u30ab\u306blibssl.a\u3084libcrypto.a\u306a\u3069\u306e\u9759\u7684\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8aad\u307f\u8fbc\u307e\u305b\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001\u30b3\u30d4\u30fc\u3059\u308b<\/span>\r\n<span class=\"gp\">$<\/span> <span class=\"nb\">cp<\/span> <span class=\"k\">*<\/span>\/<span class=\"k\">*<\/span>.a \/usr\/local\/lib\/boringssl\/lib\/\r\n<\/code><\/pre>\n<div>\u5982\u679c\u60a8\u6267\u884c\u4e86devtoolset-11\u7684\u66f4\u65b0\u6765\u66f4\u65b0gcc\uff0c\u90a3\u4e48\u5728BoringSSL\u7684cmake\u4e4b\u524d\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<br \/>\n\u8fd9\u662f\u56e0\u4e3aBoringSSL\u9700\u8981\u5728cmake\u4e2d\u4f7f\u7528C++11\u517c\u5bb9\u7684gcc\u3002\u8bbe\u7f6e\u8def\u5f84\uff1a<br \/>\nexport PATH=\/opt\/rh\/devtoolset-11\/root\/bin:$PATH<\/p>\n<\/div>\n<h1>\u5b89\u88c5Nginx\u3002<\/h1>\n<p>&nbsp;<\/p>\n<p>\u7ec8\u4e8e\u5f00\u59cb\u5b89\u88c5Nginx\u4e86\u3002<br \/>\n\u7531\u4e8e\u5728\u6587\u7ae0\u7f16\u5199\u65f6\uff0c\u6700\u65b0\u7248\u672c\u7684Nginx 1.23.2\u8fd8\u4e0d\u652f\u6301QUIC\uff0c\u56e0\u6b64\u6211\u4eec\u8981\u4ecenginx-quic\u7684\u4ed3\u5e93\u4e2d\u8fdb\u884c\u4e0b\u8f7d\u3002<\/p>\n<div>\u5982\u679cNginx\u5df2\u7ecf\u5b58\u5728\uff0c\u8bf7\u81ea\u884c\u66f4\u6539\u9009\u9879\u7684\u503c\u3002<\/div>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> wget <span class=\"nt\">-O<\/span> nginx.tar.gz https:\/\/hg.nginx.org\/nginx-quic\/archive\/quic.tar.gz\r\n<span class=\"gp\">$<\/span> <span class=\"nb\">tar<\/span> <span class=\"nt\">-zxvf<\/span> nginx.tar.gz\r\n<span class=\"gp\">$<\/span> <span class=\"nb\">cd <\/span>nginx-quic-quic\/\r\n\r\n<span class=\"gp\">$<\/span> .\/auto\/configure <span class=\"nt\">--with-debug<\/span> <span class=\"se\">\\<\/span>\r\n<span class=\"go\">              --with-http_ssl_module \\\r\n              --with-http_v2_module \\\r\n              --with-http_v3_module \\\r\n              --with-stream_quic_module \\\r\n              --with-cc-opt=\"-I\/usr\/local\/lib\/boringssl\/include\" \\\r\n              --with-ld-opt=\"-L\/usr\/local\/lib\/boringssl\/lib\" \\\r\n              --prefix=\/etc\/nginx \\\r\n              --sbin-path=\/usr\/sbin\/nginx \\\r\n              --conf-path=\/etc\/nginx\/nginx.conf \\\r\n              --error-log-path=\/var\/log\/nginx\/error.log \\\r\n              --http-log-path=\/var\/log\/nginx\/access.log \\\r\n              --pid-path=\/run\/nginx.pid \\\r\n              --lock-path=\/run\/nginx.lock \\\r\n              --user=nginx \\\r\n              --group=nginx\r\n<\/span><span class=\"gp\">$<\/span> make\r\n<span class=\"gp\">$<\/span> make <span class=\"nb\">install<\/span>\r\n<\/code><\/pre>\n<details>\u7531\u4e8e\u6211\u6253\u7b97\u5c06Nginx\u7528\u4f5c\u53cd\u5411\u4ee3\u7406\uff0c\u6240\u4ee5\u6211\u51b3\u5b9a\u5148\u5b89\u88c5\u5b83\uff0c\u8fd9\u6837\u4ee5\u540e\u5c31\u4e0d\u9700\u8981\u91cd\u65b0\u6784\u5efa\u4e86\u3002\u6211\u5728\u5b89\u88c5\u65f6\u4f7f\u7528\u4e86\u8bb8\u591a\u9009\u9879\u3002Nginx\u7684\u914d\u7f6e\u5982\u4e0b\uff1a<br \/>\n$ .\/auto\/configure &#8211;with-debug \\<br \/>\n&#8211;with-http_ssl_module \\<br \/>\n&#8211;with-http_v2_module \\<br \/>\n&#8211;with-http_v3_module \\<br \/>\n&#8211;with-stream_quic_module \\<br \/>\n&#8211;with-threads \\<br \/>\n&#8211;with-stream \\<br \/>\n&#8211;with-stream_ssl_module \\<br \/>\n&#8211;with-mail \\<br \/>\n&#8211;with-mail_ssl_module \\<br \/>\n&#8211;with-http_dav_module \\<br \/>\n&#8211;with-http_flv_module \\<br \/>\n&#8211;with-http_mp4_module \\<br \/>\n&#8211;with-http_gunzip_module \\<br \/>\n&#8211;with-http_gzip_static_module \\<br \/>\n&#8211;with-http_realip_module \\<br \/>\n&#8211;with-cc-opt=&#8221;-I\/usr\/local\/lib\/boringssl\/include&#8221; \\<br \/>\n&#8211;with-ld-opt=&#8221;-L\/usr\/local\/lib\/boringssl\/lib&#8221; \\<br \/>\n&#8211;prefix=\/etc\/nginx \\<br \/>\n&#8211;sbin-path=\/usr\/sbin\/nginx \\<br \/>\n&#8211;conf-path=\/etc\/nginx\/nginx.conf \\<br \/>\n&#8211;error-log-path=\/var\/log\/nginx\/error.log \\<br \/>\n&#8211;http-log-path=\/var\/log\/nginx\/access.log \\<br \/>\n&#8211;pid-path=\/run\/nginx.pid \\<br \/>\n&#8211;lock-path=\/run\/nginx.lock \\<br \/>\n&#8211;user=nginx \\<br \/>\n&#8211;group=nginx<\/p>\n<\/details>\n<h1>\u5c06\u5176\u6dfb\u52a0\u5230systemd\u4e2d<\/h1>\n<p>\u53ea\u8981\u628a\u9019\u6a23\u7684\u670d\u52d9\u6a94\u6848\u653e\u9032\u53bb\uff0c\u5b83\u5c31\u53ef\u4ee5\u904b\u4f5c\u3002\u4e09\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"k\">[Unit]<\/span>\r\n<span class=\"nt\">Description<\/span><span class=\"p\">=<\/span>The NGINX HTTP and reverse proxy server\r\n<span class=\"nt\">After<\/span><span class=\"p\">=<\/span>syslog.target network.target remote-fs.target nss-lookup.target\r\n\r\n<span class=\"k\">[Service]<\/span>\r\n<span class=\"nt\">Type<\/span><span class=\"p\">=<\/span>forking\r\n<span class=\"nt\">PIDFile<\/span><span class=\"p\">=<\/span>\/run\/nginx.pid\r\n<span class=\"nt\">ExecStartPre<\/span><span class=\"p\">=<\/span>\/usr\/sbin\/nginx -t\r\n<span class=\"nt\">ExecStart<\/span><span class=\"p\">=<\/span>\/usr\/sbin\/nginx\r\n<span class=\"nt\">ExecReload<\/span><span class=\"p\">=<\/span>\/bin\/kill -s HUP $MAINPID\r\n<span class=\"nt\">ExecStop<\/span><span class=\"p\">=<\/span>\/bin\/kill -s QUIT $MAINPID\r\n<span class=\"nt\">PrivateTmp<\/span><span class=\"p\">=<\/span>true\r\n\r\n<span class=\"k\">[Install]<\/span>\r\n<span class=\"nt\">WantedBy<\/span><span class=\"p\">=<\/span>multi-user.target\r\n<\/code><\/pre>\n<h1>\u6545\u969c\u6392\u9664<\/h1>\n<h2>nginx\uff1a[emerg] \u65e0\u6cd5\u83b7\u53d6\u5230\u7528\u6237\u540d\u4e3a&#8221;nginx&#8221;\u7684\u4fe1\u606f\u3002<\/h2>\n<p>\u7531\u4e8e\u7528\u6237\u4e0d\u5b58\u5728\u800c\u5bfc\u81f4\u7684\u9519\u8bef\u3002<br \/>\n\u5982\u679c\u4f7f\u7528\u4e0a\u8ff0\u547d\u4ee4\u4ee5\u201cnginx\u201d\u7528\u6237\u548c\u201cnginx\u201d\u7ec4\u521b\u5efa\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u8fdb\u884c\u521b\u5efa\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> groupadd nginx\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> <span class=\"nb\">sudo <\/span>useradd <span class=\"nt\">-g<\/span> nginx <span class=\"nt\">-s<\/span> \/sbin\/nologin <span class=\"nt\">-r<\/span> nginx\r\n<\/code><\/pre>\n<h1>\u987a\u4fbf\u63d0\u4e00\u4e0b\uff08\u6709\u70b9\u5c34\u5c2c\u7684\u4e8b\u60c5\uff09<\/h1>\n<pre class=\"post-pre\"><code><span class=\"k\">listen<\/span> <span class=\"mi\">443<\/span> <span class=\"s\">http3<\/span> <span class=\"s\">reuseport<\/span><span class=\"p\">;<\/span>\r\n<\/code><\/pre>\n<p>\u5982\u679c\u4e0d\u4f7f\u7528reuseport\uff0c\u5c06\u65e0\u6cd5\u4f7f\u7528HTTP\/3\u3002<br \/>\n\u7136\u800c\uff0c\u4f3c\u4e4e\u65e0\u6cd5\u591a\u6b21\u4f7f\u7528reuseport\u3002<\/p>\n<pre class=\"post-pre\"><code>nginx: [emerg] duplicate listen options for 0.0.0.0:443 in \/etc\/nginx\/conf.d\/virtualhost.conf:5\r\nnginx: configuration file \/etc\/nginx\/nginx.conf test failed\r\n<\/code><\/pre>\n<p>\u6362\u8a00\u4e4b\uff0cNginx\u4e0a\u7684HTTP\/3\u4e0d\u80fd\u6258\u7ba1\u591a\u4e2a\u57df\u540d\u3002<\/p>\n<p>\u5feb\u70b9\u666e\u53caHTTP\/3\u5427\uff0c\u670d\u52a1\u5668\u8f6f\u4ef6\u4e0d\u5bb9\u6613\u6539\u53d8\u554a\u30025<\/p>\n<p>\u597d\u5427\u3002\u6211\u4f1a\u505c\u6b62\u5df2\u5b89\u88c5\u7684Nginx\u5e76\u8f6c\u56deApache\u3002<\/p>\n<section>\u4f5c\u4e3a\u670d\u52a1\u5668\u7ba1\u7406\u5458\u53ef\u80fd\u4f1a\u89c9\u5f97\u662f\u4e00\u4e2a\u5927\u95ee\u9898\uff0c\u4f46\u53ea\u8981\u4e86\u89e3yum\u548capt\uff0c\u5c31\u53ef\u4ee5\u8f7b\u677e\u89e3\u51b3\uff01\u7531\u4e8e\u6211\u6b63\u5728\/root\/boringssl\u4e0a\u5de5\u4f5c\uff0c\u56e0\u6b64\u5b83\u5df2\u5b89\u88c5\u5728\/root\/boringssl\/install\u4e2d\u3002<\/p>\n<p>http:\/\/mogile.web.fc2.com\/nginx_wiki\/nginx_wiki201510\/start\/topics\/examples\/systemd.html<\/p>\n<p>\u5982\u679c\u6709\u65b9\u6cd5\uff0c\u8bf7\u5728\u8bc4\u8bba\u4e2d\u544a\u8bc9\u6211\uff0c\u6211\u4f1a\u8dea\u6c42\u60a8\u7684\u6559\u5bfc\u3002<\/p>\n<p>Apache\u4e0d\u652f\u6301\uff0cNginx\u662f\u5b9e\u9a8c\u6027\u7684\u3002LiteSpeed\u662f\u652f\u6301\u7684\u3002<\/p>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u59cb\u4e8b\u5b9e\u548c\u80cc\u666f &nbsp; \u6211\u60f3\u5728CentOS7\u4e0a\u4f7f\u7528\u5b8c\u5168\u652f\u6301HTTP\/1.1\u3001HTTP\/2\u548cHTTP\/3\u7684 [&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-32886","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>\u5bf9\u4e8e\u90a3\u4e9b\u5728CentOS 7\u4e0a\u60f3\u4f7f\u7528HTTP\/3\u7684nginx\uff0c\u4f46\u4e0d\u60f3\u4f7f\u7528rpm\u6216ninja\u7684\u4eba\uff0c\u8fd9\u662f\u4e00\u4efd\u5907\u5fd8\u5f55 - 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\/\u5bf9\u4e8e\u90a3\u4e9b\u5728centos-7\u4e0a\u60f3\u4f7f\u7528http-3\u7684nginx\uff0c\u4f46\u4e0d\u60f3\u4f7f\u7528rpm\u6216ninja\u7684\u4eba\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5bf9\u4e8e\u90a3\u4e9b\u5728CentOS 7\u4e0a\u60f3\u4f7f\u7528HTTP\/3\u7684nginx\uff0c\u4f46\u4e0d\u60f3\u4f7f\u7528rpm\u6216ninja\u7684\u4eba\uff0c\u8fd9\u662f\u4e00\u4efd\u5907\u5fd8\u5f55\" \/>\n<meta property=\"og:description\" content=\"\u539f\u59cb\u4e8b\u5b9e\u548c\u80cc\u666f &nbsp; \u6211\u60f3\u5728CentOS7\u4e0a\u4f7f\u7528\u5b8c\u5168\u652f\u6301HTTP\/1.1\u3001HTTP\/2\u548cHTTP\/3\u7684 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5bf9\u4e8e\u90a3\u4e9b\u5728centos-7\u4e0a\u60f3\u4f7f\u7528http-3\u7684nginx\uff0c\u4f46\u4e0d\u60f3\u4f7f\u7528rpm\u6216ninja\u7684\u4eba\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-19T16:25:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-04T04:57:07+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=\"3 \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%af%b9%e4%ba%8e%e9%82%a3%e4%ba%9b%e5%9c%a8centos-7%e4%b8%8a%e6%83%b3%e4%bd%bf%e7%94%a8http-3%e7%9a%84nginx%ef%bc%8c%e4%bd%86%e4%b8%8d%e6%83%b3%e4%bd%bf%e7%94%a8rpm%e6%88%96ninja%e7%9a%84%e4%ba%ba\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%af%b9%e4%ba%8e%e9%82%a3%e4%ba%9b%e5%9c%a8centos-7%e4%b8%8a%e6%83%b3%e4%bd%bf%e7%94%a8http-3%e7%9a%84nginx%ef%bc%8c%e4%bd%86%e4%b8%8d%e6%83%b3%e4%bd%bf%e7%94%a8rpm%e6%88%96ninja%e7%9a%84%e4%ba%ba\/\",\"name\":\"\u5bf9\u4e8e\u90a3\u4e9b\u5728CentOS 7\u4e0a\u60f3\u4f7f\u7528HTTP\/3\u7684nginx\uff0c\u4f46\u4e0d\u60f3\u4f7f\u7528rpm\u6216ninja\u7684\u4eba\uff0c\u8fd9\u662f\u4e00\u4efd\u5907\u5fd8\u5f55 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-09-19T16:25:30+00:00\",\"dateModified\":\"2024-05-04T04:57:07+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%af%b9%e4%ba%8e%e9%82%a3%e4%ba%9b%e5%9c%a8centos-7%e4%b8%8a%e6%83%b3%e4%bd%bf%e7%94%a8http-3%e7%9a%84nginx%ef%bc%8c%e4%bd%86%e4%b8%8d%e6%83%b3%e4%bd%bf%e7%94%a8rpm%e6%88%96ninja%e7%9a%84%e4%ba%ba\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%af%b9%e4%ba%8e%e9%82%a3%e4%ba%9b%e5%9c%a8centos-7%e4%b8%8a%e6%83%b3%e4%bd%bf%e7%94%a8http-3%e7%9a%84nginx%ef%bc%8c%e4%bd%86%e4%b8%8d%e6%83%b3%e4%bd%bf%e7%94%a8rpm%e6%88%96ninja%e7%9a%84%e4%ba%ba\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%af%b9%e4%ba%8e%e9%82%a3%e4%ba%9b%e5%9c%a8centos-7%e4%b8%8a%e6%83%b3%e4%bd%bf%e7%94%a8http-3%e7%9a%84nginx%ef%bc%8c%e4%bd%86%e4%b8%8d%e6%83%b3%e4%bd%bf%e7%94%a8rpm%e6%88%96ninja%e7%9a%84%e4%ba%ba\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5bf9\u4e8e\u90a3\u4e9b\u5728CentOS 7\u4e0a\u60f3\u4f7f\u7528HTTP\/3\u7684nginx\uff0c\u4f46\u4e0d\u60f3\u4f7f\u7528rpm\u6216ninja\u7684\u4eba\uff0c\u8fd9\u662f\u4e00\u4efd\u5907\u5fd8\u5f55\"}]},{\"@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%af%b9%e4%ba%8e%e9%82%a3%e4%ba%9b%e5%9c%a8centos-7%e4%b8%8a%e6%83%b3%e4%bd%bf%e7%94%a8http-3%e7%9a%84nginx%ef%bc%8c%e4%bd%86%e4%b8%8d%e6%83%b3%e4%bd%bf%e7%94%a8rpm%e6%88%96ninja%e7%9a%84%e4%ba%ba\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5bf9\u4e8e\u90a3\u4e9b\u5728CentOS 7\u4e0a\u60f3\u4f7f\u7528HTTP\/3\u7684nginx\uff0c\u4f46\u4e0d\u60f3\u4f7f\u7528rpm\u6216ninja\u7684\u4eba\uff0c\u8fd9\u662f\u4e00\u4efd\u5907\u5fd8\u5f55 - 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\/\u5bf9\u4e8e\u90a3\u4e9b\u5728centos-7\u4e0a\u60f3\u4f7f\u7528http-3\u7684nginx\uff0c\u4f46\u4e0d\u60f3\u4f7f\u7528rpm\u6216ninja\u7684\u4eba\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5bf9\u4e8e\u90a3\u4e9b\u5728CentOS 7\u4e0a\u60f3\u4f7f\u7528HTTP\/3\u7684nginx\uff0c\u4f46\u4e0d\u60f3\u4f7f\u7528rpm\u6216ninja\u7684\u4eba\uff0c\u8fd9\u662f\u4e00\u4efd\u5907\u5fd8\u5f55","og_description":"\u539f\u59cb\u4e8b\u5b9e\u548c\u80cc\u666f &nbsp; \u6211\u60f3\u5728CentOS7\u4e0a\u4f7f\u7528\u5b8c\u5168\u652f\u6301HTTP\/1.1\u3001HTTP\/2\u548cHTTP\/3\u7684 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5bf9\u4e8e\u90a3\u4e9b\u5728centos-7\u4e0a\u60f3\u4f7f\u7528http-3\u7684nginx\uff0c\u4f46\u4e0d\u60f3\u4f7f\u7528rpm\u6216ninja\u7684\u4eba\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-09-19T16:25:30+00:00","article_modified_time":"2024-05-04T04:57:07+00:00","author":"\u6e05, \u626c","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u6e05, \u626c","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%af%b9%e4%ba%8e%e9%82%a3%e4%ba%9b%e5%9c%a8centos-7%e4%b8%8a%e6%83%b3%e4%bd%bf%e7%94%a8http-3%e7%9a%84nginx%ef%bc%8c%e4%bd%86%e4%b8%8d%e6%83%b3%e4%bd%bf%e7%94%a8rpm%e6%88%96ninja%e7%9a%84%e4%ba%ba\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%af%b9%e4%ba%8e%e9%82%a3%e4%ba%9b%e5%9c%a8centos-7%e4%b8%8a%e6%83%b3%e4%bd%bf%e7%94%a8http-3%e7%9a%84nginx%ef%bc%8c%e4%bd%86%e4%b8%8d%e6%83%b3%e4%bd%bf%e7%94%a8rpm%e6%88%96ninja%e7%9a%84%e4%ba%ba\/","name":"\u5bf9\u4e8e\u90a3\u4e9b\u5728CentOS 7\u4e0a\u60f3\u4f7f\u7528HTTP\/3\u7684nginx\uff0c\u4f46\u4e0d\u60f3\u4f7f\u7528rpm\u6216ninja\u7684\u4eba\uff0c\u8fd9\u662f\u4e00\u4efd\u5907\u5fd8\u5f55 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-09-19T16:25:30+00:00","dateModified":"2024-05-04T04:57:07+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%af%b9%e4%ba%8e%e9%82%a3%e4%ba%9b%e5%9c%a8centos-7%e4%b8%8a%e6%83%b3%e4%bd%bf%e7%94%a8http-3%e7%9a%84nginx%ef%bc%8c%e4%bd%86%e4%b8%8d%e6%83%b3%e4%bd%bf%e7%94%a8rpm%e6%88%96ninja%e7%9a%84%e4%ba%ba\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%af%b9%e4%ba%8e%e9%82%a3%e4%ba%9b%e5%9c%a8centos-7%e4%b8%8a%e6%83%b3%e4%bd%bf%e7%94%a8http-3%e7%9a%84nginx%ef%bc%8c%e4%bd%86%e4%b8%8d%e6%83%b3%e4%bd%bf%e7%94%a8rpm%e6%88%96ninja%e7%9a%84%e4%ba%ba\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%af%b9%e4%ba%8e%e9%82%a3%e4%ba%9b%e5%9c%a8centos-7%e4%b8%8a%e6%83%b3%e4%bd%bf%e7%94%a8http-3%e7%9a%84nginx%ef%bc%8c%e4%bd%86%e4%b8%8d%e6%83%b3%e4%bd%bf%e7%94%a8rpm%e6%88%96ninja%e7%9a%84%e4%ba%ba\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5bf9\u4e8e\u90a3\u4e9b\u5728CentOS 7\u4e0a\u60f3\u4f7f\u7528HTTP\/3\u7684nginx\uff0c\u4f46\u4e0d\u60f3\u4f7f\u7528rpm\u6216ninja\u7684\u4eba\uff0c\u8fd9\u662f\u4e00\u4efd\u5907\u5fd8\u5f55"}]},{"@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%af%b9%e4%ba%8e%e9%82%a3%e4%ba%9b%e5%9c%a8centos-7%e4%b8%8a%e6%83%b3%e4%bd%bf%e7%94%a8http-3%e7%9a%84nginx%ef%bc%8c%e4%bd%86%e4%b8%8d%e6%83%b3%e4%bd%bf%e7%94%a8rpm%e6%88%96ninja%e7%9a%84%e4%ba%ba\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/32886","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=32886"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/32886\/revisions"}],"predecessor-version":[{"id":98452,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/32886\/revisions\/98452"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=32886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=32886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=32886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}