{"id":583,"date":"2025-09-02T17:49:10","date_gmt":"2025-09-02T09:49:10","guid":{"rendered":"https:\/\/www.idc61.com\/blog\/?p=583"},"modified":"2025-09-02T17:49:10","modified_gmt":"2025-09-02T09:49:10","slug":"%e9%a6%99%e6%b8%af%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%a7%9f%e7%94%a8%e5%bf%85%e7%9c%8b%ef%bc%9a5%e6%ad%a5%e4%bc%98%e5%8c%96%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/www.idc61.com\/blog\/583.html","title":{"rendered":"\u9999\u6e2f\u670d\u52a1\u5668\u79df\u7528\u5fc5\u770b\uff1a5\u6b65\u4f18\u5316\u6307\u5357"},"content":{"rendered":"<p><p>\u968f\u7740\u4e92\u8054\u7f51\u7684\u5feb\u901f\u53d1\u5c55\uff0c\u9009\u62e9\u4e00\u4e2a\u597d\u7684\u670d\u52a1\u5668\u79df\u7528\u670d\u52a1\u5bf9\u4e8e\u4fdd\u8bc1\u7f51\u7ad9\u6216\u5e94\u7528\u7684\u7a33\u5b9a\u6027\u548c\u6027\u80fd\u81f3\u5173\u91cd\u8981\u3002\u672c\u6587\u5c06\u9488\u5bf9\u9999\u6e2f\u5730\u533a\u7684\u670d\u52a1\u5668\u79df\u7528\uff0c\u63d0\u4f9b\u4e00\u4e2a\u5b9e\u64cd\u5bfc\u5411\u7684\u6307\u5357\uff0c\u5e2e\u52a9\u60a8\u987a\u5229\u5b8c\u6210\u670d\u52a1\u5668\u914d\u7f6e\u548c\u4f18\u5316\u3002<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.idc61.com\/blog\/wp-content\/uploads\/2025\/09\/fB9u80.jpg\" alt=\"\u9999\u6e2f\u670d\u52a1\u5668\u79df\u7528\u5fc5\u770b\uff1a5\u6b65\u4f18\u5316\u6307\u5357\" title=\"\u9999\u6e2f\u670d\u52a1\u5668\u79df\u7528\u5fc5\u770b\uff1a5\u6b65\u4f18\u5316\u6307\u5357\"><\/p>\n<\/p>\n<p><2>\u4efb\u52a1\u63cf\u8ff0<\/2><\/p>\n<p><p>\u5b8c\u6210\u4ee5\u4e0b\u4efb\u52a1\uff1a<\/p>\n<\/p>\n<p><u><\/p>\n<p>  <i>\u9009\u62e9\u5e76\u79df\u7528\u9999\u6e2f\u5730\u533a\u7684\u670d\u52a1\u5668<\/i><\/p>\n<p>  <i>\u914d\u7f6e\u670d\u52a1\u5668\u73af\u5883<\/i><\/p>\n<p>  <i>\u4f18\u5316\u670d\u52a1\u5668\u6027\u80fd<\/i><\/p>\n<p><\/u><\/p>\n<p><2>\u64cd\u4f5c\u524d\u7684\u51c6\u5907<\/2><\/p>\n<p><p>\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u5df2\u7ecf\uff1a<\/p>\n<\/p>\n<p><u><\/p>\n<p>  <i>\u9009\u62e9\u4e86\u4e00\u4e2a\u53ef\u9760\u7684\u9999\u6e2f\u670d\u52a1\u5668\u4f9b\u5e94\u5546<\/i><\/p>\n<p>  <i>\u62e5\u6709\u7ba1\u7406\u670d\u52a1\u5668\u7684\u57fa\u672c\u77e5\u8bc6\uff0c\u4f8b\u5982\u719f\u6089Linux\u64cd\u4f5c\u7cfb\u7edf<\/i><\/p>\n<p>  <i>\u914d\u7f6e\u4e86SSH\u8bbf\u95ee\u6743\u9650<\/i><\/p>\n<p><\/u><\/p>\n<p><2>1. \u767b\u5f55\u670d\u52a1\u5668<\/2><\/p>\n<p><p>\u4f7f\u7528SSH\u5ba2\u6237\u7aef\u8fde\u63a5\u5230\u60a8\u7684\u670d\u52a1\u5668\u3002<\/p>\n<\/p>\n<p><pre><code>ss usernae@your_server_ip<\/code><\/pre>\n<\/p>\n<p><p><srong>usernae<\/srong> \u662f\u60a8\u5728\u670d\u52a1\u5668\u4e0a\u8bbe\u7f6e\u7684\u767b\u5f55\u7528\u6237\u540d\uff0c<srong>your_server_ip<\/srong> \u662f\u670d\u52a1\u5668\u7684\u516c\u7f51IP\u5730\u5740\u3002<\/p>\n<\/p>\n<p><2>2. \u66f4\u65b0\u7cfb\u7edf\u5305<\/2><\/p>\n<p><p>\u4e3a\u4e86\u786e\u4fdd\u7cfb\u7edf\u5b89\u5168\uff0c\u9996\u5148\u66f4\u65b0\u7cfb\u7edf\u5305\u3002<\/p>\n<\/p>\n<p><pre><code>yu updae -y<\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u4f7f\u7528\u7684\u662fDebian\u6216Ubunu\u7cfb\u7edf\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code>ap-ge updae && ap-ge upgrade -y<\/code><\/pre>\n<\/p>\n<p><2>3. \u5b89\u88c5Nginx<\/2><\/p>\n<p><p>Nginx\u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u7684HTTP\u548c\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\u3002<\/p>\n<\/p>\n<p><pre><code>yu insa nginx -y<\/code><\/pre>\n<\/p>\n<p><p>\u5bf9\u4e8eDebian\u6216Ubunu\u7cfb\u7edf\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code>ap-ge insa nginx -y<\/code><\/pre>\n<\/p>\n<p><2>4. \u914d\u7f6eNginx<\/2><\/p>\n<p><p>\u7f16\u8f91Nginx\u914d\u7f6e\u6587\u4ef6\uff0c\u914d\u7f6e\u60a8\u7684\u7f51\u7ad9\u3002<\/p>\n<\/p>\n<p><pre><code>vi \/ec\/nginx\/nginx.conf<\/code><\/pre>\n<\/p>\n<p><p>\u5728server\u5757\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code><\/p>\r\n<p>server {<\/p>\r\n<p>    isen       80;<\/p>\r\n<p>    server_nae  yourdoain.co;<\/p>\r\n\r\n<p>    ocaion \/ {<\/p>\r\n<p>        roo   \/usr\/sare\/nginx\/;<\/p>\r\n<p>        index  index. index.;<\/p>\r\n<p>    }<\/p>\r\n<p>}<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p><srong>yourdoain.co<\/srong> \u66ff\u6362\u4e3a\u60a8\u8d2d\u4e70\u57df\u540d\u7684\u5730\u5740\u3002<\/p>\n<\/p>\n<p><2>5. \u91cd\u65b0\u52a0\u8f7dNginx<\/2><\/p>\n<p><p>\u91cd\u65b0\u52a0\u8f7dNginx\u4ee5\u5e94\u7528\u914d\u7f6e\u66f4\u6539\u3002<\/p>\n<\/p>\n<p><pre><code>nginx -s reoad<\/code><\/pre>\n<\/p>\n<p><2>6. \u5b89\u88c5MySQL<\/2><\/p>\n<p><p>MySQL\u662f\u4e00\u4e2a\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u3002<\/p>\n<\/p>\n<p><pre><code>yu insa ysq-server -y<\/code><\/pre>\n<\/p>\n<p><p>\u5bf9\u4e8eDebian\u6216Ubunu\u7cfb\u7edf\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code>ap-ge insa ysq-server -y<\/code><\/pre>\n<\/p>\n<p><2>7. \u914d\u7f6eMySQL<\/2><\/p>\n<p><p>\u521d\u59cb\u5316MySQL\u6570\u636e\u5e93\u5e76\u8bbe\u7f6eroo\u7528\u6237\u7684\u5bc6\u7801\u3002<\/p>\n<\/p>\n<p><pre><code>ysq_secure_insaaion<\/code><\/pre>\n<\/p>\n<p><p>\u6309\u7167\u63d0\u793a\u5b8c\u6210\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><2>8. \u4f18\u5316\u670d\u52a1\u5668\u6027\u80fd<\/2><\/p>\n<p><p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f18\u5316\u7cfb\u7edf\u6027\u80fd\u3002<\/p>\n<\/p>\n<p><pre><code><\/p>\r\n<p> \u4f18\u5316\u7cfb\u7edf\u5185\u6838\u53c2\u6570<\/p>\r\n<p>vi \/ec\/sysc.conf<\/p>\r\n<p>ne.ipv4.cp_fin_ieou = 30<\/p>\r\n<p>ne.ipv4.cp_w_reuse = 1<\/p>\r\n<p>ne.ipv4.cp_w_recyce = 1<\/p>\r\n<p>ne.ipv4.cp_keepaive_ie = 600<\/p>\r\n<p>ne.core.soaxconn = 65535<\/p>\r\n\r\n<p> \u91cd\u65b0\u52a0\u8f7dsysc\u914d\u7f6e<\/p>\r\n<p>sysc -p<\/p>\r\n\r\n<p> \u4f18\u5316Nginx\u914d\u7f6e<\/p>\r\n<p>vi \/ec\/nginx\/nginx.conf<\/p>\r\n<p> \u4fee\u6539worker_processes\u548cworker_connecions\u53c2\u6570<\/p>\r\n<p>worker_processes  auo;<\/p>\r\n<p>evens {<\/p>\r\n<p>    worker_connecions  1024;<\/p>\r\n<p>}<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><2>9. \u9047\u5230\u7684\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6cd5<\/2><\/p>\n<p><u><\/p>\n<p>  <i><srong>\u95ee\u9898\uff1a<\/srong> \u670d\u52a1\u5668\u65e0\u6cd5\u8bbf\u95ee<\/i><\/p>\n<p>  <i><srong>\u539f\u56e0\uff1a<\/srong> \u786e\u4fdd\u670d\u52a1\u5668\u9632\u706b\u5899\u5df2\u5f00\u653e\u5fc5\u8981\u7684\u7aef\u53e3\u3002<\/i><\/p>\n<p>  <i><srong>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/srong> \u7f16\u8f91\u9632\u706b\u5899\u914d\u7f6e\u6587\u4ef6\u5e76\u5141\u8bb8HTTP\u548cSSH\u7aef\u53e3\u3002<\/i><\/p>\n<p><\/u><\/p>\n<p><u><\/p>\n<p>  <i><srong>\u95ee\u9898\uff1a<\/srong> MySQL\u670d\u52a1\u65e0\u6cd5\u542f\u52a8<\/i><\/p>\n<p>  <i><srong>\u539f\u56e0\uff1a<\/srong> \u53ef\u80fd\u662f\u914d\u7f6e\u6587\u4ef6\u9519\u8bef\u6216\u5185\u5b58\u4e0d\u8db3\u3002<\/i><\/p>\n<p>  <i><srong>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/srong> \u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\u548c\u7cfb\u7edf\u5185\u5b58\uff0c\u5c1d\u8bd5\u91cd\u65b0\u542f\u52a8MySQL\u670d\u52a1\u3002<\/i><\/p>\n<p><\/u><\/p>\n<p><2>\u603b\u7ed3<\/2><\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u60a8\u5df2\u7ecf\u6210\u529f\u79df\u7528\u4e86\u9999\u6e2f\u670d\u52a1\u5668\u5e76\u8fdb\u884c\u4e86\u57fa\u672c\u7684\u914d\u7f6e\u548c\u4f18\u5316\u3002\u8bf7\u6839\u636e\u60a8\u7684\u9700\u6c42\u8fdb\u4e00\u6b65\u5b9a\u5236\u670d\u52a1\u5668\u73af\u5883\uff0c\u786e\u4fdd\u60a8\u7684\u7f51\u7ad9\u6216\u5e94\u7528\u80fd\u591f\u7a33\u5b9a\u8fd0\u884c\u3002<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u968f\u7740\u4e92\u8054\u7f51\u7684\u5feb\u901f\u53d1\u5c55\uff0c\u9009\u62e9\u4e00\u4e2a\u597d\u7684\u670d\u52a1\u5668\u79df\u7528\u670d\u52a1\u5bf9\u4e8e\u4fdd\u8bc1\u7f51\u7ad9\u6216\u5e94\u7528\u7684\u7a33\u5b9a\u6027\u548c\u6027\u80fd\u81f3\u5173\u91cd\u8981\u3002\u672c\u6587\u5c06\u9488\u5bf9\u9999\u6e2f\u5730\u533a\u7684\u670d\u52a1\u5668\u79df\u7528\uff0c\u63d0\u4f9b\u4e00\u4e2a\u5b9e\u64cd\u5bfc\u5411\u7684\u6307\u5357\uff0c\u5e2e\u52a9\u60a8\u987a\u5229\u5b8c\u6210\u670d\u52a1\u5668\u914d\u7f6e\u548c\u4f18\u5316\u3002 \u4efb\u52a1\u63cf\u8ff0 \u5b8c\u6210\u4ee5\u4e0b\u4efb\u52a1\uff1a \u9009\u62e9\u5e76\u79df\u7528\u9999\u6e2f\u5730\u533a\u7684\u670d\u52a1\u5668 \u914d\u7f6e\u670d&#8230;<\/p>\n","protected":false},"author":1,"featured_media":584,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[225],"tags":[179,20,231],"topic":[],"class_list":["post-583","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-haiwaifuwuqi","tag-ip","tag-20","tag-231"],"_links":{"self":[{"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/posts\/583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/comments?post=583"}],"version-history":[{"count":1,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/posts\/583\/revisions"}],"predecessor-version":[{"id":586,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/posts\/583\/revisions\/586"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/media\/584"}],"wp:attachment":[{"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/media?parent=583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/categories?post=583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/tags?post=583"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/topic?post=583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}