{"id":135,"date":"2024-10-30T17:57:24","date_gmt":"2024-10-30T09:57:24","guid":{"rendered":"https:\/\/zhoujibin.com\/?p=135"},"modified":"2024-10-30T17:57:24","modified_gmt":"2024-10-30T09:57:24","slug":"nginx%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"https:\/\/blog.zhoujibin.com\/?p=135","title":{"rendered":"Nginx\u5b89\u88c5"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">\u64cd\u4f5c\u7cfb\u7edf<\/h1>\n\n\n\n<p>\u53ef\u4f7f\u7528 lsb_release -a \u547d\u4ee4\u67e5\u770b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>LSB Version:    core-11.1.0ubuntu4-noarch:security-11.1.0ubuntu4-noarch\nDistributor ID:    Ubuntu\nDescription:    Ubuntu 22.04.4 LTS\nRelease:    22.04\nCodename:    jammy<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e0b\u8f7dnginx<\/h1>\n\n\n\n<p><a href=\"https:\/\/nginx.org\/en\/download.html\">nginx\u4e0b\u8f7d\u5730\u5740<\/a><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u5b89\u88c5nginx<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u5728\u7ebf\u5b89\u88c5<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install nginx<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u7f16\u8bd1\u5b89\u88c5<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5\u4f9d\u8d56\u8f6f\u4ef6<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>yum -y install openssl openssl-devel make zlib zlib-devel gcc gcc-c++ libtool pcre pcre-devel <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5nginx<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5982\uff0c\u4e0b\u8f7dnginx-1.25.5.tar.gz \u7248\u672c\uff0c\u4e0a\u4f20\u5b89\u88c5\u5305\u81f3\u6307\u5b9a\u76ee\u5f55\uff0c\u5982\uff1a\/home\/package\ncd \/home\/package\n# \u89e3\u538b\u81f3\/home\u76ee\u5f55\u4e0b\ntar -zxvf nginx-1.25.5.tar.gz\n\n# \u6267\u884c\u7f16\u8bd1\u547d\u4ee4\ncd \/home\/package\/nginx-1.25.5\n.\/configure --user=nginx --prefix=\/usr\/local\/nginx --with-http_ssl_module --with-http_realip_module --with-http_image_filter_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_stub_status_module --http-log-path=\/var\/log\/nginx\/access.log --error-log-path=\/var\/log\/nginx\/error.log --without-http_rewrite_module --with-openssl=\/usr\/bin\/openssl\n\n\n# \u51fa\u73b0\u9519\u8bef\uff1a.\/configure: error: SSL modules require the OpenSSL library.\nYou can either do not enable the modules, or install the OpenSSL library\ninto the system, or build the OpenSSL library statically from the source\nwith nginx by using --with-openssl=&lt;path&gt; option.\n\n# \u5b89\u88c5 OpenSSL<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u9690\u85cf\u7248\u672c\u53f7<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>http { \n server_tokens off;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u64cd\u4f5c\u7cfb\u7edf \u53ef\u4f7f\u7528 lsb_release -a \u547d\u4ee4\u67e5\u770b \u4e0b\u8f7dnginx nginx\u4e0b\u8f7d\u5730\u5740 \u5b89\u88c5nginx  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[30,33],"class_list":["post-135","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux","tag-nginx"],"_links":{"self":[{"href":"https:\/\/blog.zhoujibin.com\/index.php?rest_route=\/wp\/v2\/posts\/135"}],"collection":[{"href":"https:\/\/blog.zhoujibin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zhoujibin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zhoujibin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zhoujibin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=135"}],"version-history":[{"count":1,"href":"https:\/\/blog.zhoujibin.com\/index.php?rest_route=\/wp\/v2\/posts\/135\/revisions"}],"predecessor-version":[{"id":136,"href":"https:\/\/blog.zhoujibin.com\/index.php?rest_route=\/wp\/v2\/posts\/135\/revisions\/136"}],"wp:attachment":[{"href":"https:\/\/blog.zhoujibin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zhoujibin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zhoujibin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}