{"id":6069,"date":"2026-08-04T20:18:44","date_gmt":"2026-08-04T11:18:44","guid":{"rendered":"https:\/\/eternalsphere.net\/echoes\/?p=6069"},"modified":"2026-08-04T20:18:44","modified_gmt":"2026-08-04T11:18:44","slug":"y157p3if1297xj5","status":"publish","type":"post","link":"https:\/\/eternalsphere.net\/echoes\/index.php\/2026\/08\/04\/y157p3if1297xj5\/","title":{"rendered":"\u8ba9\u516c\u7f51 URL \u4e0e\u670d\u52a1\u5668\u76ee\u5f55\u89e3\u8026\uff1a\u4e00\u5957\u4f4e\u98ce\u9669\u7684 Apache \u591a\u5e94\u7528\u8def\u7531\u91cd\u6784\u65b9\u6cd5"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u524d\u8a00<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u53f0 Web \u670d\u52a1\u5668\u957f\u671f\u8fd0\u884c\u540e\uff0c\u5e38\u4f1a\u9010\u6e10\u79ef\u7d2f\u591a\u4e2a\u72ec\u7acb\u5e94\u7528\u3002\u6700\u521d\u90e8\u7f72\u65f6\uff0c\u4e3a\u4e86\u7701\u4e8b\uff0c\u5f88\u591a\u5e94\u7528\u76f4\u63a5\u4f9d\u8d56\u7ad9\u70b9\u6839\u76ee\u5f55\u53d1\u5e03\uff1a\u78c1\u76d8\u76ee\u5f55\u53eb <code>tool-alpha<\/code>\uff0c\u516c\u7f51\u5730\u5740\u4e5f\u81ea\u7136\u53d8\u6210 <code>\/tool-alpha\/<\/code>\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u79cd\u65b9\u5f0f\u80fd\u591f\u5de5\u4f5c\uff0c\u4f46\u516c\u7f51 URL \u4e0e\u78c1\u76d8\u76ee\u5f55\u5f62\u6210\u4e86\u4e0d\u5fc5\u8981\u7684\u4e00\u4e00\u7ed1\u5b9a\u3002\u9879\u76ee\u76ee\u5f55\u4e00\u65e6\u5e26\u6709\u5185\u90e8\u547d\u540d\u3001\u5386\u53f2\u547d\u540d\u6216\u6280\u672f\u5b9e\u73b0\u542b\u4e49\uff0c\u516c\u7f51\u5730\u5740\u4e5f\u4f1a\u8ddf\u7740\u66b4\u9732\uff1b\u4ee5\u540e\u60f3\u8c03\u6574 URL\uff0c\u53c8\u5bb9\u6613\u8bef\u4ee5\u4e3a\u5fc5\u987b\u79fb\u52a8\u9879\u76ee\u76ee\u5f55\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u66f4\u7a33\u59a5\u7684\u505a\u6cd5\u662f\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u4fdd\u6301\u5e94\u7528\u76ee\u5f55\u548c\u7a0b\u5e8f\u7ed3\u6784\u4e0d\u52a8\uff0c\u53ea\u5728 Web \u670d\u52a1\u5668\u914d\u7f6e\u5c42\u91cd\u65b0\u5b9a\u4e49\u516c\u7f51\u5165\u53e3\u3002<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u6587\u8bb0\u5f55\u4e00\u6b21\u7ecf\u8fc7\u5ba1\u8ba1\u3001\u5206\u5c42\u9a8c\u8bc1\u548c\u5b89\u5168\u5207\u6362\u7684\u5b9e\u8df5\u3002\u793a\u4f8b\u4e2d\u7684\u57df\u540d\u3001\u4e3b\u673a\u540d\u3001\u5e94\u7528\u540d\u3001\u76ee\u5f55\u3001\u7aef\u53e3\u548c\u914d\u7f6e\u6587\u4ef6\u540d\u5747\u4e3a\u865a\u6784\u5185\u5bb9\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u6539\u9020\u524d\u7684\u5178\u578b\u7ed3\u6784<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u793a\u4f8b\u73af\u5883\u6709\u4e24\u5c42 Web \u670d\u52a1\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u516c\u7f51\u5ba2\u6237\u7aef<br> &nbsp;  \u2193 HTTPS<br>edge-gateway\uff08Nginx\uff09<br> &nbsp;  \u2193 HTTP \u53cd\u5411\u4ee3\u7406<br>web-node\uff08Apache\uff09<br> &nbsp;  \u2193<br>\u591a\u4e2a\u9759\u6001\u3001PHP \u548c\u672c\u5730\u540e\u7aef\u5e94\u7528<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7f51\u5173\u5c42\u4f7f\u7528\u901a\u7528\u4ee3\u7406\u89c4\u5219\uff0c\u5c06\u666e\u901a\u8def\u5f84\u539f\u6837\u8f6c\u53d1\u7ed9\u540e\u7aef Apache\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">location \/ {<br> &nbsp; &nbsp;proxy_pass http:\/\/10.0.0.20;<br>}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u540e\u7aef Apache \u7684\u7ad9\u70b9\u6839\u76ee\u5f55\u662f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/srv\/web\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u591a\u4e2a\u5e94\u7528\u539f\u5148\u76f4\u63a5\u6309\u76ee\u5f55\u540d\u5bf9\u5916\u53d1\u5e03\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/srv\/web\/app-alpha\/ &nbsp; \u2192 \/app-alpha\/<br>\/srv\/web\/app-beta\/ &nbsp;  \u2192 \/app-beta\/<br>\/srv\/web\/app-gamma\/ &nbsp; \u2192 \/app-gamma\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u76ee\u6807\u662f\u628a\u5b83\u4eec\u6539\u4e3a\u66f4\u7a33\u5b9a\u3001\u7b80\u6d01\u7684\u516c\u7f51\u5165\u53e3\uff0c\u4f8b\u5982\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/app-alpha\/ &nbsp; \u2192 \/tools-a\/<br>\/app-beta\/ &nbsp;  \u2192 \/tools-b\/<br>\/app-gamma\/ &nbsp; \u2192 \/lookup\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u540c\u65f6\uff0c\u78c1\u76d8\u76ee\u5f55\u5b8c\u5168\u4e0d\u79fb\u52a8\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u4e3a\u4ec0\u4e48\u8981\u5206\u79bb URL \u4e0e\u771f\u5b9e\u76ee\u5f55<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u6b21\u6539\u9020\u4e0d\u662f\u4e3a\u4e86\u63d0\u9ad8\u8fd0\u884c\u6027\u80fd\u3002Apache \u5728\u542f\u52a8\u6216 reload \u65f6\u89e3\u6790\u914d\u7f6e\uff0c\u6b63\u5e38\u8bf7\u6c42\u4e0d\u4f1a\u56e0\u4e3a\u591a\u51e0\u4e2a\u5c0f\u578b\u914d\u7f6e\u6587\u4ef6\u5c31\u660e\u663e\u53d8\u6162\u3002\u4e00\u4e2a\u5927\u914d\u7f6e\u6587\u4ef6\u548c\u591a\u4e2a\u5c0f\u914d\u7f6e\u6587\u4ef6\uff0c\u5728\u8fd9\u79cd\u89c4\u6a21\u4e0b\u51e0\u4e4e\u6ca1\u6709\u53ef\u611f\u77e5\u7684\u6027\u80fd\u5dee\u5f02\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u771f\u6b63\u7684\u6536\u76ca\u662f\u7ed3\u6784\u6cbb\u7406\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u516c\u7f51\u547d\u540d\u4e0d\u518d\u53d7\u78c1\u76d8\u76ee\u5f55\u9650\u5236<\/strong> \u9879\u76ee\u76ee\u5f55\u53ef\u4ee5\u7ee7\u7eed\u6cbf\u7528\u6280\u672f\u540d\u79f0\u3001\u4ed3\u5e93\u540d\u79f0\u6216\u5386\u53f2\u540d\u79f0\uff0c\u516c\u7f51\u5165\u53e3\u5219\u9762\u5411\u4f7f\u7528\u8005\u547d\u540d\u3002<\/li>\n\n\n\n<li><strong>\u4ee5\u540e\u66f4\u5bb9\u6613\u8c03\u6574\u5165\u53e3<\/strong> \u66f4\u6362 URL \u4e0d\u5fc5\u79fb\u52a8\u4ee3\u7801\u3001\u6539\u6240\u6709\u8005\u6216\u91cd\u65b0\u8bbe\u8ba1\u76ee\u5f55\u7ed3\u6784\u3002<\/li>\n\n\n\n<li><strong>\u964d\u4f4e\u8bef\u64cd\u4f5c\u8303\u56f4<\/strong> \u6bcf\u4e2a\u5e94\u7528\u72ec\u7acb\u914d\u7f6e\uff0c\u4e00\u4e2a\u5e94\u7528\u51fa\u9519\u65f6\uff0c\u4e0d\u5fc5\u52a8\u5176\u4ed6\u5e94\u7528\u3002<\/li>\n\n\n\n<li><strong>\u5b89\u5168\u8fb9\u754c\u66f4\u6e05\u695a<\/strong> \u9759\u6001\u5e94\u7528\u3001PHP \u5e94\u7528\u548c\u672c\u5730\u53cd\u5411\u4ee3\u7406\u5e94\u7528\u53ef\u4ee5\u5206\u522b\u4fdd\u7559\u81ea\u5df1\u7684\u8bbf\u95ee\u63a7\u5236\u3002<\/li>\n\n\n\n<li><strong>\u56de\u6eda\u66f4\u76f4\u63a5<\/strong> \u65b0\u5165\u53e3\u5931\u8d25\u65f6\uff0c\u53ea\u9700\u505c\u7528\u5bf9\u5e94\u914d\u7f6e\uff0c\u539f\u8def\u5f84\u4ecd\u53ef\u7ee7\u7eed\u5de5\u4f5c\u3002<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u914d\u7f6e\u7ec4\u7ec7\uff1a\u4e00\u5e94\u7528\u4e00\u6587\u4ef6<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u7ec8\u91c7\u7528\u201c\u4e00\u5e94\u7528\u4e00\u4e2a Apache \u914d\u7f6e\u6587\u4ef6\u201d\u7684\u65b9\u5f0f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/etc\/apache2\/conf-available\/tool-a.conf<br>\/etc\/apache2\/conf-available\/tool-b.conf<br>\/etc\/apache2\/conf-available\/tool-c.conf<br>\/etc\/apache2\/conf-available\/tool-d.conf<br>\/etc\/apache2\/conf-available\/data-site.conf<br>\/etc\/apache2\/conf-available\/backend-app.conf<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6ca1\u6709\u628a\u6240\u6709 <code>Alias<\/code> \u96c6\u4e2d\u5230\u4e00\u4e2a\u603b\u6587\u4ef6\uff0c\u4e5f\u6ca1\u6709\u5408\u5e76\u7cfb\u7edf\u81ea\u5e26\u7684 <code>security.conf<\/code>\u3001PHP-FPM \u914d\u7f6e\u3001\u5b57\u7b26\u96c6\u914d\u7f6e\u7b49\u6587\u4ef6\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u79cd\u65b9\u5f0f\u6587\u4ef6\u6570\u91cf\u7a0d\u591a\uff0c\u4f46\u4f18\u52bf\u660e\u663e\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u53ef\u4ee5\u5355\u72ec <code>a2enconf<\/code> \u6216 <code>a2disconf<\/code>\uff1b<\/li>\n\n\n\n<li>\u8bed\u6cd5\u9519\u8bef\u548c\u8bbf\u95ee\u5f02\u5e38\u66f4\u5bb9\u6613\u5b9a\u4f4d\uff1b<\/li>\n\n\n\n<li>\u4e0d\u540c\u5e94\u7528\u7684\u5b89\u5168\u89c4\u5219\u4e0d\u4f1a\u6df7\u5728\u4e00\u8d77\uff1b<\/li>\n\n\n\n<li>\u4ee5\u540e\u79fb\u9664\u5e94\u7528\u65f6\uff0c\u4e0d\u9700\u8981\u7f16\u8f91\u4e00\u4e2a\u8d8a\u6765\u8d8a\u5927\u7684\u603b\u6587\u4ef6\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u9759\u6001\u5e94\u7528\u7684 Alias \u914d\u7f6e<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e00\u4e2a\u9759\u6001\u5de5\u5177\u4e3a\u4f8b\uff0c\u771f\u5b9e\u76ee\u5f55\u4fdd\u6301\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/srv\/web\/app-alpha\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u65b0\u516c\u7f51\u5165\u53e3\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/tools-a\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u72ec\u7acb\u914d\u7f6e\u53ef\u4ee5\u5199\u6210\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Static Tool A<br>RedirectMatch 301 ^\/tools-a$ \/tools-a\/<br>\u200b<br>Alias \"\/tools-a\/\" \"\/srv\/web\/app-alpha\/\"<br>\u200b<br>&lt;Directory \"\/srv\/web\/app-alpha\/\"&gt;<br> &nbsp;  Options -Indexes<br> &nbsp;  AllowOverride None<br> &nbsp;  Require all granted<br>&lt;\/Directory&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\u6709\u51e0\u4e2a\u5173\u952e\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>RedirectMatch 301<\/code> \u7edf\u4e00\u8865\u4e0a\u7ed3\u5c3e\u659c\u6760\uff1b<\/li>\n\n\n\n<li><code>Alias<\/code> \u53ea\u6539\u53d8 URL \u5230\u76ee\u5f55\u7684\u6620\u5c04\uff1b<\/li>\n\n\n\n<li><code>Options -Indexes<\/code> \u7981\u6b62\u76ee\u5f55\u7d22\u5f15\uff1b<\/li>\n\n\n\n<li>\u4e0d\u4fee\u6539\u76ee\u5f55\u6240\u6709\u8005\u548c\u6743\u9650\uff1b<\/li>\n\n\n\n<li>\u4e0d\u7ed9 Web \u8fdb\u7a0b\u589e\u52a0\u5199\u6743\u9650\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u4e8e\u7eaf\u524d\u7aef\u5e94\u7528\uff0c\u8fd8\u8981\u68c0\u67e5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CSS\u3001JavaScript\u3001\u56fe\u7247\u548c\u5b57\u4f53\u662f\u5426\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\uff1b<\/li>\n\n\n\n<li>manifest \u7684 <code>start_url<\/code> \u548c <code>scope<\/code>\uff1b<\/li>\n\n\n\n<li>Service Worker \u6ce8\u518c\u8def\u5f84\uff1b<\/li>\n\n\n\n<li>Worker\u3001WASM \u6216\u6570\u636e\u5305\u8def\u5f84\uff1b<\/li>\n\n\n\n<li>\u662f\u5426\u786c\u7f16\u7801\u4e86\u65e7 URL \u524d\u7f00\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u82e5\u5e94\u7528\u4e00\u76f4\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\uff0c\u901a\u5e38\u65e0\u9700\u6539\u52a8\u4efb\u4f55\u7a0b\u5e8f\u6587\u4ef6\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001PHP \u5e94\u7528\u4e0d\u80fd\u53ea\u770b\u9996\u9875<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u67d0\u4e9b PHP \u5e94\u7528\u867d\u7136\u4e5f\u53ef\u4ee5\u901a\u8fc7 <code>Alias<\/code> \u6539\u5165\u53e3\uff0c\u4f46\u5b83\u4eec\u901a\u5e38\u8fd8\u6709\u72ec\u7acb\u7684\u8bbf\u95ee\u63a7\u5236\uff0c\u4f8b\u5982\u7981\u6b62\u8bbf\u95ee\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">app\/<br>data\/<br>scripts\/<br>reports\/<br>docs\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u65f6\u4e0d\u5e94\u4e3a\u4e86\u201c\u914d\u7f6e\u6574\u9f50\u201d\u91cd\u5199\u539f\u6709\u5b89\u5168\u89c4\u5219\u3002\u66f4\u7a33\u59a5\u7684\u505a\u6cd5\u662f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u65b0\u8def\u7531\u6587\u4ef6\u53ea\u8d1f\u8d23\u65b0\u7684 <code>Alias<\/code>\uff1b<\/li>\n\n\n\n<li>\u539f\u6709\u8bbf\u95ee\u63a7\u5236\u6587\u4ef6\u7ee7\u7eed\u8d1f\u8d23\u654f\u611f\u76ee\u5f55\uff1b<\/li>\n\n\n\n<li>\u4e0a\u7ebf\u540e\u9010\u4e2a\u6d4b\u8bd5\u654f\u611f\u8def\u5f84\u4ecd\u8fd4\u56de <code>403<\/code> \u6216 <code>404<\/code>\uff1b<\/li>\n\n\n\n<li>\u540c\u65f6\u786e\u8ba4 PHP \u88ab\u6267\u884c\uff0c\u800c\u4e0d\u662f\u4ee5\u6e90\u7801\u5f62\u5f0f\u4e0b\u8f7d\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u529f\u80fd\u9a8c\u8bc1\u4e5f\u4e0d\u80fd\u505c\u7559\u5728\u9996\u9875 <code>200<\/code>\uff0c\u81f3\u5c11\u5e94\u8986\u76d6\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u641c\u7d22\u9875\uff1b<\/li>\n\n\n\n<li>\u8be6\u60c5\u9875\uff1b<\/li>\n\n\n\n<li>\u8868\u5355\u63d0\u4ea4\uff1b<\/li>\n\n\n\n<li>\u5bfc\u51fa\u63a5\u53e3\uff1b<\/li>\n\n\n\n<li>\u9759\u6001\u8d44\u6e90\uff1b<\/li>\n\n\n\n<li>\u5185\u90e8\u76ee\u5f55\u62e6\u622a\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u516d\u3001\u672c\u5730\u540e\u7aef\u5e94\u7528\u9700\u8981\u540c\u6b65\u5e94\u7528\u6839\u8def\u5f84<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u53e6\u4e00\u7c7b\u5e94\u7528\u4e0d\u662f\u7531 Apache\u76f4\u63a5\u8bfb\u53d6\u76ee\u5f55\uff0c\u800c\u662f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Apache ProxyPass<br> &nbsp;  \u2193<br>127.0.0.1:9000 \u4e0a\u7684\u672c\u5730\u5e94\u7528\u670d\u52a1<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u7c7b\u5e94\u7528\u4e0d\u80fd\u53ea\u4fee\u6539 Apache\u3002\u901a\u5e38\u8fd8\u8981\u540c\u6b65\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>APPLICATION_ROOT<\/code>\uff1b<\/li>\n\n\n\n<li>\u516c\u5f00 URL\uff1b<\/li>\n\n\n\n<li>Session Cookie Path\uff1b<\/li>\n\n\n\n<li>\u9875\u9762\u4e2d\u7684\u5e94\u7528\u6839\u8def\u5f84\uff1b<\/li>\n\n\n\n<li>API\u3001\u4e0b\u8f7d\u548c\u9759\u6001\u8d44\u6e90\u5730\u5740\uff1b<\/li>\n\n\n\n<li>\u5065\u5eb7\u68c0\u67e5\u8def\u5f84\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u5168\u505a\u6cd5\u662f\u4ee5\u65e7\u4ee3\u7406\u914d\u7f6e\u4e3a\u6a21\u677f\uff0c\u53ea\u66ff\u6362 URL \u524d\u7f00\uff0c\u5176\u4ed6\u4ee3\u7406\u53c2\u6570\u3001\u7aef\u53e3\u548c\u8bf7\u6c42\u5934\u8bbe\u7f6e\u4fdd\u6301\u539f\u6837\u3002\u751f\u6210\u65b0\u914d\u7f6e\u540e\u4f7f\u7528 <code>diff<\/code> \u68c0\u67e5\uff0c\u786e\u8ba4\u53d8\u5316\u4ec5\u9650\u65e7\u524d\u7f00\u5230\u65b0\u524d\u7f00\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u91cd\u8f7d\u5e94\u7528\u670d\u52a1\u524d\uff0c\u8fd8\u5e94\u786e\u8ba4\u6ca1\u6709\u6b63\u5728\u6267\u884c\u7684\u4efb\u52a1\uff0c\u907f\u514d\u4e2d\u65ad\u540e\u53f0\u4f5c\u4e1a\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e03\u3001\u6700\u5b89\u5168\u7684\u5207\u6362\u987a\u5e8f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6574\u4e2a\u8fc1\u79fb\u4e0d\u5e94\u5148\u5173\u95ed\u65e7\u8def\u5f84\u3002\u63a8\u8350\u987a\u5e8f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u521b\u5efa\u65b0\u5165\u53e3<br>\u2192 Apache configtest<br>\u2192 \u5e73\u6ed1 reload<br>\u2192 \u9a8c\u8bc1\u65b0\u5165\u53e3\u548c\u5168\u90e8\u8d44\u6e90<br>\u2192 \u66f4\u65b0\u6b63\u5f0f\u5bfc\u822a<br>\u2192 \u5907\u4efd\u5df2\u751f\u6548\u914d\u7f6e<br>\u2192 \u5173\u95ed\u65e7\u8def\u5f84<br>\u2192 \u518d\u6b21 configtest \u548c reload<br>\u2192 \u5b8c\u6574\u56de\u5f52\u6d4b\u8bd5<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u65e7\u8def\u5f84\u6700\u540e\u901a\u8fc7\u660e\u786e\u7684 404 \u89c4\u5219\u5173\u95ed\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RedirectMatch 404 ^\/app-alpha(?:\/.*)?$<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\u4e0d\u4f7f\u7528\u91cd\u5b9a\u5411\u5230\u65b0\u5730\u5740\uff0c\u539f\u56e0\u662f\u6b64\u6b21\u76ee\u6807\u662f\u5f7b\u5e95\u505c\u6b62\u65e7\u5165\u53e3\uff0c\u907f\u514d\u65e7\u4e66\u7b7e\u3001\u65e7\u8d44\u6e90\u5730\u5740\u548c\u76ee\u5f55\u540d\u7ee7\u7eed\u957f\u671f\u5b58\u5728\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u516b\u3001\u5907\u4efd\u4e5f\u5e94\u6309\u5bf9\u8c61\u5206\u7c7b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u914d\u7f6e\u5907\u4efd\u548c Web \u6587\u4ef6\u5907\u4efd\u4e0d\u5b9c\u6df7\u4e3a\u4e00\u8c08\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7cfb\u7edf\u914d\u7f6e<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Apache\u3001systemd \u7b49\u7cfb\u7edf\u914d\u7f6e\uff0c\u9002\u5408\u4f7f\u7528\u4e13\u95e8\u7684\u914d\u7f6e\u5907\u4efd\u5de5\u5177\uff0c\u5728\u539f\u914d\u7f6e\u76ee\u5f55\u4e2d\u751f\u6210\u4fdd\u7559\u65f6\u95f4\u6233\u7684\u526f\u672c\u3002\u8fd9\u6837\u6062\u590d\u65b9\u4fbf\uff0c\u4e5f\u4e0d\u4f1a\u628a\u7cfb\u7edf\u914d\u7f6e\u6563\u843d\u5230\u5176\u4ed6\u5f52\u6863\u76ee\u5f55\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Web \u76ee\u5f55\u4e2d\u7684\u5e94\u7528\u6587\u4ef6<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u82e5\u5fc5\u987b\u4fee\u6539\u5e94\u7528\u6587\u4ef6\uff0c\u5e94\u628a\u5907\u4efd\u79fb\u51fa\u5bf9\u5916\u5f00\u653e\u7684 Web \u6839\u76ee\u5f55\uff0c\u5e76\u6309\u539f\u7edd\u5bf9\u8def\u5f84\u955c\u50cf\u4fdd\u5b58\uff0c\u4f8b\u5982\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/srv\/web\/backend-app\/app.py<br>\u2192<br>\/secure-backup\/srv\/web\/backend-app\/app.py<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0d\u5e94\u5728\u516c\u5f00\u76ee\u5f55\u65c1\u8fb9\u7559\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">app.py.bak<br>app.py.old<br>app.py.20260101<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5426\u5219\u5907\u4efd\u6587\u4ef6\u53ef\u80fd\u88ab\u6d4f\u89c8\u5668\u76f4\u63a5\u4e0b\u8f7d\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e5d\u3001\u4e24\u6b21\u5bb9\u6613\u8bef\u5224\u7684\u95ee\u9898<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u68c0\u67e5\u5230\u4e86\u9519\u8bef\u4e3b\u673a\u6216\u9519\u8bef\u6587\u4ef6\u7cfb\u7edf<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u81ea\u52a8\u5316\u6267\u884c\u524d\u5fc5\u987b\u8bbe\u7f6e\u786c\u95e8\u69db\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">hostname<br>\u5f53\u524d\u7528\u6237<br>\u76ee\u6807 IP<br>findmnt<br>\u9884\u671f\u76ee\u5f55\u6e05\u5355<br>\u9884\u671f\u914d\u7f6e\u6e05\u5355<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4efb\u610f\u4e00\u9879\u4e0d\u7b26\uff0c\u7acb\u5373\u505c\u6b62\u3002\u4ec5\u51ed\u4e3b\u673a\u540d\u76f8\u4f3c\u6216 SSH \u547d\u4ee4\u201c\u770b\u8d77\u6765\u6210\u529f\u201d\u5e76\u4e0d\u591f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u516c\u7f51\u54cd\u5e94\u5934\u663e\u793a Nginx\uff0c\u4e0d\u4ee3\u8868 Apache \u6ca1\u751f\u6548<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u591a\u5c42\u4ee3\u7406\u7ed3\u6784\u4e2d\uff0c\u516c\u7f51\u770b\u5230\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Server: nginx<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ea\u80fd\u8bc1\u660e\u6700\u5916\u5c42\u662f Nginx\uff0c\u4e0d\u80fd\u8bc1\u660e\u8bf7\u6c42\u6ca1\u6709\u8fdb\u5165\u540e\u7aef Apache\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b63\u786e\u8bca\u65ad\u5fc5\u987b\u5206\u5c42\u6d4b\u8bd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u540e\u7aef\u4e3b\u673a\u672c\u673a\u8bf7\u6c42 Apache<br>\u7f51\u5173\u4e3b\u673a\u76f4\u63a5\u8bf7\u6c42\u540e\u7aef<br>\u516c\u7f51\u8bf7\u6c42\u7f51\u5173<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ea\u6709\u8fd9\u6837\u624d\u80fd\u5224\u65ad\u95ee\u9898\u7a76\u7adf\u5728 Alias\u3001Apache \u914d\u7f6e\u52a0\u8f7d\u3001\u7f51\u5173 location\uff0c\u8fd8\u662f\u6d4b\u8bd5\u65f6\u5e8f\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u3001\u6ca1\u6709\u6d4f\u89c8\u5668\u81ea\u52a8\u5316\u65f6\u5982\u4f55\u9a8c\u8bc1<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6d4f\u89c8\u5668\u70b9\u51fb\u4ecd\u7136\u662f\u6700\u76f4\u89c2\u7684\u9a8c\u6536\u65b9\u5f0f\uff0c\u4f46\u670d\u52a1\u5668\u73af\u5883\u53ef\u80fd\u6ca1\u6709\u663e\u793a\u670d\u52a1\u5668\u6216\u6d4f\u89c8\u5668\u8282\u70b9\u3002\u6b64\u65f6\u53ef\u4ee5\u7ec4\u5408\u4f7f\u7528\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>HTTP \u72b6\u6001\u7801\u548c\u54cd\u5e94\u5934\u68c0\u67e5\uff1b<\/li>\n\n\n\n<li>\u9010\u4e2a\u8bf7\u6c42\u9875\u9762\u5f15\u7528\u7684\u9759\u6001\u8d44\u6e90\uff1b<\/li>\n\n\n\n<li>\u68c0\u67e5 manifest \u548c Service Worker\uff1b<\/li>\n\n\n\n<li>\u4f7f\u7528\u672c\u5730 JavaScript \u8fd0\u884c\u65f6\u6267\u884c\u6838\u5fc3\u903b\u8f91\uff1b<\/li>\n\n\n\n<li>\u4f7f\u7528\u65e0\u5bb3\u67e5\u8be2\u9a8c\u8bc1 PHP \u9875\u9762\uff1b<\/li>\n\n\n\n<li>\u68c0\u67e5\u654f\u611f\u76ee\u5f55\u72b6\u6001\u7801\uff1b<\/li>\n\n\n\n<li>\u9a8c\u8bc1 Cookie Path\u3001\u5065\u5eb7\u68c0\u67e5\u548c\u5e94\u7528\u6839\u8def\u5f84\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u9700\u8981\u6ce8\u610f\uff1a\u6444\u50cf\u5934\u8c03\u7528\u3001\u526a\u8d34\u677f\u3001PWA \u79bb\u7ebf\u884c\u4e3a\u7b49\u6d4f\u89c8\u5668\u80fd\u529b\uff0c\u4ecd\u5e94\u5728\u65b9\u4fbf\u65f6\u8865\u505a\u4eba\u5de5\u4f53\u9a8c\u9a8c\u8bc1\u3002\u8fd9\u4e0d\u5f71\u54cd\u670d\u52a1\u5668\u8def\u7531\u5df2\u7ecf\u6210\u529f\u5207\u6362\u7684\u5224\u65ad\uff0c\u4f46\u5c5e\u4e8e\u5b8c\u6574\u4f53\u9a8c\u9a8c\u6536\u7684\u4e00\u90e8\u5206\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u4e00\u3001\u6700\u7ec8\u7ed3\u679c<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u6b21\u8fc1\u79fb\u5b8c\u6210\u4e86\u4ee5\u4e0b\u76ee\u6807\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u591a\u4e2a\u5e94\u7528\u83b7\u5f97\u65b0\u7684\u3001\u72ec\u7acb\u7684\u516c\u7f51\u5165\u53e3\uff1b<\/li>\n\n\n\n<li>\u78c1\u76d8\u76ee\u5f55\u548c\u5e94\u7528\u76ee\u5f55\u5b8c\u5168\u672a\u79fb\u52a8\uff1b<\/li>\n\n\n\n<li>\u6bcf\u4e2a\u5e94\u7528\u62e5\u6709\u72ec\u7acb Apache \u914d\u7f6e\uff1b<\/li>\n\n\n\n<li>\u9759\u6001\u5e94\u7528\u3001PHP \u5e94\u7528\u548c\u672c\u5730\u540e\u7aef\u5e94\u7528\u5206\u522b\u9a8c\u8bc1\uff1b<\/li>\n\n\n\n<li>\u65e7\u5165\u53e3\u5728\u6700\u7ec8\u5207\u6362\u540e\u7edf\u4e00\u8fd4\u56de 404\uff1b<\/li>\n\n\n\n<li>\u539f\u6709\u654f\u611f\u76ee\u5f55\u4fdd\u62a4\u7ee7\u7eed\u751f\u6548\uff1b<\/li>\n\n\n\n<li>\u7f51\u5173\u5c42\u65e0\u9700\u4fee\u6539\uff1b<\/li>\n\n\n\n<li>Apache \u4ec5\u6267\u884c\u8bed\u6cd5\u68c0\u67e5\u548c\u5b89\u5168 reload\uff1b<\/li>\n\n\n\n<li>\u672a\u901a\u8fc7\u4fee\u6539\u6743\u9650\u6765\u201c\u89e3\u51b3\u201d\u8def\u7531\u95ee\u9898\uff1b<\/li>\n\n\n\n<li>\u672a\u5728\u516c\u5f00\u76ee\u5f55\u4e2d\u7559\u4e0b\u5907\u4efd\u6587\u4ef6\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u7c7b\u6539\u9020\u7684\u6838\u5fc3\u5e76\u4e0d\u662f\u5199\u51e0\u884c <code>Alias<\/code>\uff0c\u800c\u662f\u63a7\u5236\u53d8\u66f4\u987a\u5e8f\uff1a<strong>\u5148\u5efa\u7acb\u65b0\u8def\u5f84\uff0c\u8bc1\u660e\u5b83\u5b8c\u6574\u53ef\u7528\uff0c\u518d\u5173\u95ed\u65e7\u8def\u5f84\u3002<\/strong>\u53ea\u8981\u575a\u6301\u5206\u5c42\u8bca\u65ad\u3001\u5206\u7c7b\u5907\u4efd\u548c\u9010\u5e94\u7528\u9a8c\u8bc1\uff0cURL \u4e0e\u771f\u5b9e\u76ee\u5f55\u7684\u89e3\u8026\u53ef\u4ee5\u5728\u4e0d\u4e2d\u65ad\u73b0\u6709\u670d\u52a1\u7684\u60c5\u51b5\u4e0b\u5b89\u5168\u5b8c\u6210\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u4e00\u53f0 Web \u670d\u52a1\u5668\u957f\u671f\u8fd0\u884c\u540e\uff0c\u5e38\u4f1a\u9010\u6e10\u79ef\u7d2f\u591a\u4e2a\u72ec\u7acb\u5e94\u7528\u3002\u6700\u521d\u90e8\u7f72\u65f6\uff0c\u4e3a\u4e86\u7701\u4e8b\uff0c\u5f88\u591a\u5e94\u7528\u76f4\u63a5\u4f9d\u8d56\u7ad9\u70b9\u6839\u76ee\u5f55\u53d1\u5e03\uff1a\u78c1\u76d8\u76ee\u5f55\u53eb tool-alpha\uff0c\u516c\u7f51\u5730\u5740\u4e5f\u81ea\u7136\u53d8\u6210 \/tool-alpha\/\u3002 \u8fd9\u79cd\u65b9\u5f0f\u80fd\u591f\u5de5\u4f5c\uff0c\u4f46\u516c\u7f51 URL \u4e0e\u78c1\u76d8\u76ee\u5f55\u5f62\u6210\u4e86\u4e0d\u5fc5\u8981\u7684\u4e00\u4e00\u7ed1\u5b9a\u3002\u9879\u76ee\u76ee\u5f55\u4e00\u65e6\u5e26\u6709\u5185\u90e8\u547d\u540d\u3001\u5386\u53f2\u547d\u540d\u6216\u6280\u672f\u5b9e\u73b0\u542b\u4e49\uff0c\u516c\u7f51\u5730\u5740\u4e5f\u4f1a\u8ddf\u7740\u66b4\u9732\uff1b\u4ee5\u540e\u60f3\u8c03\u6574 URL\uff0c\u53c8\u5bb9\u6613\u8bef\u4ee5\u4e3a\u5fc5\u987b\u79fb\u52a8\u9879\u76ee\u76ee\u5f55\u3002 \u66f4\u7a33\u59a5\u7684\u505a\u6cd5\u662f\uff1a \u4fdd\u6301\u5e94\u7528\u76ee\u5f55\u548c\u7a0b\u5e8f\u7ed3\u6784\u4e0d\u52a8\uff0c\u53ea\u5728 Web \u670d\u52a1\u5668\u914d\u7f6e\u5c42\u91cd\u65b0\u5b9a\u4e49\u516c\u7f51\u5165\u53e3\u3002 \u672c\u6587\u8bb0\u5f55\u4e00\u6b21\u7ecf\u8fc7\u5ba1\u8ba1\u3001\u5206\u5c42\u9a8c\u8bc1\u548c\u5b89\u5168\u5207\u6362\u7684\u5b9e\u8df5\u3002\u793a\u4f8b\u4e2d\u7684\u57df\u540d\u3001\u4e3b\u673a\u540d\u3001\u5e94\u7528\u540d\u3001\u76ee\u5f55\u3001\u7aef\u53e3\u548c\u914d\u7f6e\u6587\u4ef6\u540d\u5747\u4e3a\u865a\u6784\u5185\u5bb9\u3002 \u4e00\u3001\u6539\u9020\u524d\u7684\u5178\u578b\u7ed3\u6784 \u793a\u4f8b\u73af\u5883\u6709\u4e24\u5c42 Web \u670d\u52a1\uff1a \u516c\u7f51\u5ba2\u6237\u7aef &nbsp; \u2193 HTTPSedge-gateway\uff08Nginx\uff09 &nbsp; \u2193 HTTP \u53cd\u5411\u4ee3\u7406web-node\uff08Apache\uff09 &nbsp; \u2193\u591a\u4e2a\u9759\u6001\u3001PHP \u548c\u672c\u5730\u540e\u7aef\u5e94\u7528 \u7f51\u5173\u5c42\u4f7f\u7528\u901a\u7528\u4ee3\u7406\u89c4\u5219\uff0c\u5c06\u666e\u901a\u8def\u5f84\u539f\u6837\u8f6c\u53d1\u7ed9\u540e\u7aef Apache\uff1a location \/ { &nbsp; &nbsp;proxy_pass http:\/\/10.0.0.20;} \u540e\u7aef Apache \u7684\u7ad9\u70b9\u6839\u76ee\u5f55\u662f\uff1a \/srv\/web\/ \u591a\u4e2a\u5e94\u7528\u539f\u5148\u76f4\u63a5\u6309\u76ee\u5f55\u540d\u5bf9\u5916\u53d1\u5e03\uff1a \/srv\/web\/app-alpha\/ &nbsp; \u2192 \/app-alpha\/\/srv\/web\/app-beta\/ &nbsp; \u2192 \/app-beta\/\/srv\/web\/app-gamma\/ &hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6069","post","type-post","status-publish","format-standard","hentry","category-vbj2h46q97fzcys"],"_links":{"self":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/6069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/comments?post=6069"}],"version-history":[{"count":1,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/6069\/revisions"}],"predecessor-version":[{"id":6071,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/6069\/revisions\/6071"}],"wp:attachment":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/media?parent=6069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/categories?post=6069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/tags?post=6069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}