{"id":1023,"date":"2026-06-06T07:25:21","date_gmt":"2026-06-05T23:25:21","guid":{"rendered":"https:\/\/www.loongdi.net\/blog\/?p=1023"},"modified":"2026-06-06T07:25:21","modified_gmt":"2026-06-05T23:25:21","slug":"%e5%9b%bd%e5%a4%96%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%a7%9f%e7%94%a8%ef%bc%9a%e5%a6%82%e4%bd%95%e5%ae%8c%e6%88%90%e7%a7%9f%e7%94%a8%e5%92%8c%e9%85%8d%e7%bd%ae%e8%bf%87%e7%a8%8b%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.loongdi.net\/blog\/1023.html","title":{"rendered":"\u56fd\u5916\u670d\u52a1\u5668\u79df\u7528\uff1a\u5982\u4f55\u5b8c\u6210\u79df\u7528\u548c\u914d\u7f6e\u8fc7\u7a0b\uff1f"},"content":{"rendered":"<p><p>\u5728\u5f53\u4eca\u6570\u5b57\u5316\u65f6\u4ee3\uff0c\u56fd\u5916\u670d\u52a1\u5668\u79df\u7528\u6210\u4e3a\u4e86\u8bb8\u591a\u4f01\u4e1a\u548c\u4e2a\u4eba\u7528\u6237\u8ffd\u6c42\u9ad8\u6027\u4ef7\u6bd4\u548c\u7a33\u5b9a\u670d\u52a1\u7684\u9996\u9009\u3002\u672c\u6587\u5c06\u6307\u5bfc\u60a8\u5b8c\u6210\u56fd\u5916\u670d\u52a1\u5668\u7684\u79df\u7528\u548c\u914d\u7f6e\u8fc7\u7a0b\uff0c\u5e2e\u52a9\u60a8\u5feb\u901f\u642d\u5efa\u8d77\u5c5e\u4e8e\u81ea\u5df1\u7684\u4e91\u7aef\u5e73\u53f0\u3002<\/p>\n<\/p>\n<p><h2>\u64cd\u4f5c\u524d\u7684\u51c6\u5907<\/h2>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u786e\u4fdd\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u62e5\u6709\u4e00\u4e2a\u6709\u6548\u7684\u7535\u5b50\u90ae\u4ef6\u5730\u5740\uff0c\u7528\u4e8e\u63a5\u6536\u670d\u52a1\u5668\u7684\u767b\u5f55\u4fe1\u606f\u548c\u914d\u7f6e\u6307\u5357\u3002<\/li>\n<li>\u5177\u5907\u4e00\u5b9a\u7684\u7f51\u7edc\u77e5\u8bc6\uff0c\u4e86\u89e3\u57fa\u672c\u7684SSH\u767b\u5f55\u548c\u8fdc\u7a0b\u64cd\u4f5c\u3002<\/li>\n<li>\u9009\u62e9\u4e00\u4e2a\u53ef\u9760\u7684\u56fd\u5916\u670d\u52a1\u5668\u63d0\u4f9b\u5546\u3002<\/li>\n<\/ul>\n<p><h2>\u4efb\u52a1\uff1a\u5b8c\u6210\u56fd\u5916\u670d\u52a1\u5668\u7684\u79df\u7528\u548c\u57fa\u672c\u914d\u7f6e<\/h2>\n<\/p>\n<p><h3>\u6b65\u9aa4\u4e00\uff1a\u79df\u7528\u56fd\u5916\u670d\u52a1\u5668<\/h3>\n<\/p>\n<p><p>\u767b\u5f55\u60a8\u9009\u62e9\u7684\u56fd\u5916\u670d\u52a1\u5668\u63d0\u4f9b\u5546\u7f51\u7ad9\uff0c\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u6d4f\u89c8\u670d\u52a1\u5668\u79df\u7528\u8ba1\u5212\uff0c\u9009\u62e9\u9002\u5408\u60a8\u9700\u6c42\u7684\u914d\u7f6e\u3002<\/li>\n<li>\u586b\u5199\u4e2a\u4eba\u4fe1\u606f\uff0c\u5305\u62ec\u8054\u7cfb\u90ae\u7bb1\u3001\u652f\u4ed8\u4fe1\u606f\u7b49\u3002<\/li>\n<li>\u786e\u8ba4\u8ba2\u5355\uff0c\u5b8c\u6210\u652f\u4ed8\u3002<\/li>\n<li>\u7b49\u5f85\u670d\u52a1\u63d0\u4f9b\u5546\u5ba1\u6838\u5e76\u6fc0\u6d3b\u60a8\u7684\u670d\u52a1\u5668\u3002<\/li>\n<\/ol>\n<p><h3>\u6b65\u9aa4\u4e8c\uff1a\u767b\u5f55\u670d\u52a1\u5668<\/h3>\n<\/p>\n<p><p>\u6536\u5230\u670d\u52a1\u63d0\u4f9b\u5546\u53d1\u9001\u7684\u767b\u5f55\u4fe1\u606f\u540e\uff0c\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u3002<\/li>\n<li>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fde\u63a5\u5230\u60a8\u7684\u670d\u52a1\u5668\uff1a<\/li>\n<p><pre><code>ssh username@your_server_ip<\/code><\/pre>\n<\/p>\n<li>\u8f93\u5165\u670d\u52a1\u63d0\u4f9b\u5546\u63d0\u4f9b\u7684\u5bc6\u7801\u767b\u5f55\u3002<\/li>\n<\/ol>\n<p><h3>\u6b65\u9aa4\u4e09\uff1a\u670d\u52a1\u5668\u57fa\u672c\u914d\u7f6e<\/h3>\n<\/p>\n<p><p>\u767b\u5f55\u6210\u529f\u540e\uff0c\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u57fa\u672c\u914d\u7f6e\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u66f4\u65b0\u7cfb\u7edf\u5305\u5217\u8868\uff1a<\/li>\n<p><pre><code>sudo apt update && sudo apt upgrade -y<\/code><\/pre>\n<\/p>\n<li>\u5b89\u88c5SSH\u5bc6\u94a5\u7ba1\u7406\u5de5\u5177\uff1a<\/li>\n<p><pre><code>sudo apt install ssh-keygen -y<\/code><\/pre>\n<\/p>\n<li>\u751f\u6210\u65b0\u7684SSH\u5bc6\u94a5\u5bf9\uff0c\u5e76\u4fdd\u5b58\u5230\u672c\u5730\uff1a<\/li>\n<p><pre><code>ssh-keygen -t rsa -b 2048 -C \"your_email@example.com\"<\/code><\/pre>\n<\/p>\n<li>\u5c06\u751f\u6210\u7684\u516c\u94a5\u590d\u5236\u5230\u670d\u52a1\u5668\u7684 authorized_keys \u6587\u4ef6\u4e2d\uff1a<\/li>\n<p><pre><code>cat ~\/.ssh\/id_rsa.pub | ssh username@your_server_ip 'cat >> ~\/.ssh\/authorized_keys'<\/code><\/pre>\n<\/p>\n<\/ol>\n<p><h3>\u6b65\u9aa4\u56db\uff1a\u5b89\u88c5\u548c\u914d\u7f6eWeb\u670d\u52a1\u5668<\/h3>\n<\/p>\n<p><p>\u4ee5Apache\u4e3a\u4f8b\uff0c\u4ee5\u4e0b\u662f\u5982\u4f55\u5728\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eWeb\u670d\u52a1\u5668\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Apache\u670d\u52a1\u5668\uff1a<\/li>\n<p><pre><code>sudo apt install apache2 -y<\/code><\/pre>\n<\/p>\n<li>\u542f\u52a8Apache\u670d\u52a1\u5668\uff1a<\/li>\n<p><pre><code>sudo systemctl start apache2<\/code><\/pre>\n<\/p>\n<li>\u786e\u4fddApache\u670d\u52a1\u5668\u5f00\u673a\u81ea\u542f\uff1a<\/li>\n<p><pre><code>sudo systemctl enable apache2<\/code><\/pre>\n<\/p>\n<li>\u914d\u7f6e\u865a\u62df\u4e3b\u673a\uff1a<\/li>\n<p><pre><code>sudo nano \/etc\/apache2\/sites-available\/000-default.conf<\/code><\/pre>\n<\/p>\n<li>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684 ServerAdmin\u3001ServerName \u548c DocumentRoot \u5b57\u6bb5\uff0c\u4ee5\u9002\u5e94\u60a8\u7684\u9700\u6c42\u3002<\/li>\n<li>\u542f\u7528\u865a\u62df\u4e3b\u673a\u914d\u7f6e\u6587\u4ef6\uff1a<\/li>\n<p><pre><code>sudo a2ensite 000-default.conf<\/code><\/pre>\n<\/p>\n<li>\u91cd\u542fApache\u670d\u52a1\u5668\u4f7f\u914d\u7f6e\u751f\u6548\uff1a<\/li>\n<p><pre><code>sudo systemctl restart apache2<\/code><\/pre>\n<\/p>\n<\/ol>\n<p><h3>\u6b65\u9aa4\u4e94\uff1a\u6d4b\u8bd5Web\u670d\u52a1\u5668<\/h3>\n<\/p>\n<p><p>\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165\u670d\u52a1\u5668\u7684\u516c\u7f51IP\u5730\u5740\uff0c\u5e94\u80fd\u770b\u5230\u9ed8\u8ba4\u7684Apache\u6b22\u8fce\u9875\u9762\u3002\u5982\u679c\u4e00\u5207\u6b63\u5e38\uff0c\u60a8\u5df2\u6210\u529f\u914d\u7f6e\u56fd\u5916\u670d\u52a1\u5668\u3002<\/p>\n<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.loongdi.net\/blog\/wp-content\/uploads\/2026\/03\/8U3JhdO9K.jpg\" alt=\"\u56fd\u5916\u670d\u52a1\u5668\u79df\u7528\uff1a\u5982\u4f55\u5b8c\u6210\u79df\u7528\u548c\u914d\u7f6e\u8fc7\u7a0b\uff1f\" title=\"\u56fd\u5916\u670d\u52a1\u5668\u79df\u7528\uff1a\u5982\u4f55\u5b8c\u6210\u79df\u7528\u548c\u914d\u7f6e\u8fc7\u7a0b\uff1f\"><\/p>\n<p><h2>\u6ce8\u610f\u4e8b\u9879\u548c\u5b9e\u7528\u6280\u5de7<\/h2>\n<\/p>\n<ul>\n<li>\u5728\u64cd\u4f5c\u8fc7\u7a0b\u4e2d\uff0c\u786e\u4fdd\u7f51\u7edc\u8fde\u63a5\u7a33\u5b9a\u3002<\/li>\n<li>\u5907\u4efd\u670d\u52a1\u5668\u6570\u636e\uff0c\u4ee5\u9632\u610f\u5916\u60c5\u51b5\u3002<\/li>\n<li>\u5b9a\u671f\u66f4\u65b0\u7cfb\u7edf\u548c\u8f6f\u4ef6\u5305\uff0c\u4fdd\u6301\u670d\u52a1\u5668\u5b89\u5168\u3002<\/li>\n<li>\u53c2\u8003\u670d\u52a1\u63d0\u4f9b\u5546\u63d0\u4f9b\u7684\u6587\u6863\u548c\u6559\u7a0b\uff0c\u83b7\u53d6\u66f4\u591a\u914d\u7f6e\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u60a8\u5df2\u6210\u529f\u5b8c\u6210\u56fd\u5916\u670d\u52a1\u5668\u7684\u79df\u7528\u548c\u57fa\u672c\u914d\u7f6e\u3002\u795d\u60a8\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u4e00\u5207\u987a\u5229\uff01<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5f53\u4eca\u6570\u5b57\u5316\u65f6\u4ee3\uff0c\u56fd\u5916\u670d\u52a1\u5668\u79df\u7528\u6210\u4e3a\u4e86\u8bb8\u591a\u4f01\u4e1a\u548c\u4e2a\u4eba\u7528\u6237\u8ffd\u6c42\u9ad8\u6027\u4ef7\u6bd4\u548c\u7a33\u5b9a\u670d\u52a1\u7684\u9996\u9009\u3002\u672c\u6587\u5c06\u6307\u5bfc\u60a8\u5b8c\u6210\u56fd\u5916\u670d\u52a1\u5668\u7684\u79df\u7528\u548c\u914d\u7f6e\u8fc7\u7a0b\uff0c\u5e2e\u52a9\u60a8\u5feb\u901f\u642d\u5efa\u8d77\u5c5e\u4e8e\u81ea\u5df1\u7684\u4e91\u7aef\u5e73\u53f0\u3002 \u64cd\u4f5c\u524d\u7684\u51c6\u5907 \u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u786e\u4fdd\u4ee5\u4e0b\u51e0\u70b9\uff1a \u62e5\u6709\u4e00\u4e2a\u6709\u6548\u7684\u7535\u5b50\u90ae\u4ef6\u5730&#8230;<\/p>\n","protected":false},"author":1,"featured_media":34,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"topic":[],"class_list":["post-1023","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hw"],"_links":{"self":[{"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/posts\/1023","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/comments?post=1023"}],"version-history":[{"count":1,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/posts\/1023\/revisions"}],"predecessor-version":[{"id":1024,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/posts\/1023\/revisions\/1024"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/media\/34"}],"wp:attachment":[{"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/media?parent=1023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/categories?post=1023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/tags?post=1023"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.loongdi.net\/blog\/wp-json\/wp\/v2\/topic?post=1023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}