{"id":71435,"date":"2026-02-03T19:56:42","date_gmt":"2026-02-03T11:56:42","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/71435.html"},"modified":"2026-02-03T19:56:42","modified_gmt":"2026-02-03T11:56:42","slug":"%e3%80%90%e7%ac%94%e8%ae%b0%e3%80%91ant-designfastapi-%e9%a1%b9%e7%9b%ae-linux-%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%86%85%e7%bd%91%e9%83%a8%e7%bd%b2%e5%ae%8c%e6%95%b4%e7%ac%94%e8%ae%b0","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/71435.html","title":{"rendered":"\u3010\u7b14\u8bb0\u3011Ant Design+FastAPI \u9879\u76ee Linux \u670d\u52a1\u5668\u5185\u7f51\u90e8\u7f72\u5b8c\u6574\u7b14\u8bb0"},"content":{"rendered":"<h2><\/h2>\n<p>\u6838\u5fc3\u539f\u5219&#xff1a;\u524d\u7aef\u4ec5\u9700\u4e0a\u4f20\u6253\u5305\u540e\u7684dist\u6587\u4ef6\u5939&#xff0c;\u540e\u7aef\u4e0a\u4f20\u6e90\u7801 \/ \u4f9d\u8d56\u6587\u4ef6&#xff0c;\u5206\u522b\u542f\u52a8\u524d\u7aef\u9759\u6001\u670d\u52a1\u548c\u540e\u7aef FastAPI \u670d\u52a1&#xff0c;\u914d\u5408 Linux \u9632\u706b\u5899 \/ \u7aef\u53e3\u5f00\u653e&#xff0c;\u5b9e\u73b0\u5185\u7f51\u6240\u6709\u8bbe\u5907\u8bbf\u95ee\u3002\u5168\u7a0b\u9002\u914dCentOS\/Debian\/Ubuntu&#xff08;\u4e3b\u6d41 Linux \u53d1\u884c\u7248&#xff09;&#xff0c;\u6b65\u9aa4\u6e05\u6670\u53ef\u843d\u5730&#xff0c;\u517c\u987e\u7b80\u6613\u90e8\u7f72\u548c\u7a33\u5b9a\u8fd0\u884c\u3002<\/p>\n<h3>\u4e00\u3001\u524d\u671f\u51c6\u5907&#xff08;Linux \u670d\u52a1\u5668 &#043; \u672c\u5730\u6587\u4ef6&#xff09;<\/h3>\n<h4>1. Linux \u670d\u52a1\u5668\u57fa\u7840\u8981\u6c42<\/h4>\n<ul>\n<li>\u80fd\u8054\u7f51&#xff08;\u4e34\u65f6\u62c9\u53d6\u4f9d\u8d56&#xff0c;\u90e8\u7f72\u540e\u53ef\u65ad\u7f51&#xff09;&#xff1b;<\/li>\n<li>\u5f00\u653e\u6307\u5b9a\u7aef\u53e3&#xff1a;\u524d\u7aef 8080\u3001\u540e\u7aef 8003&#xff08;\u53ef\u81ea\u5b9a\u4e49&#xff0c;\u9700\u7edf\u4e00&#xff09;&#xff1b;<\/li>\n<li>\u5efa\u8bae\u521b\u5efa\u4e13\u7528\u90e8\u7f72\u76ee\u5f55&#xff08;\u907f\u514d\u6743\u9650\u95ee\u9898&#xff09;&#xff1a;<\/li>\n<\/ul>\n<p># \u65b0\u5efa\u524d\u7aef\/\u540e\u7aef\u90e8\u7f72\u76ee\u5f55&#xff0c;\/opt\/\u662fLinux\u5e38\u7528\u5e94\u7528\u90e8\u7f72\u76ee\u5f55<br \/>\nsudo mkdir -p \/opt\/antd-front \/opt\/fastapi-back<br \/>\n# \u8d4b\u4e88\u666e\u901a\u7528\u6237\u64cd\u4f5c\u6743\u9650&#xff08;\u907f\u514d\u540e\u7eedsudo\u7e41\u7410&#xff0c;\u66ff\u6362\u4e3a\u4f60\u7684Linux\u7528\u6237\u540d&#xff0c;\u5982ubuntu&#xff09;<br \/>\nsudo chown -R \u4f60\u7684\u7528\u6237\u540d:\u4f60\u7684\u7528\u6237\u540d \/opt\/antd-front \/opt\/fastapi-back<\/p>\n<h4>2. \u672c\u5730\u51c6\u5907\u597d\u5f85\u4e0a\u4f20\u6587\u4ef6<\/h4>\n<h5>\u524d\u7aef&#xff08;\u4ec5\u9700 dist \u6587\u4ef6\u5939&#xff09;<\/h5>\n<ul>\n<li>\u672c\u5730\u9879\u76ee\u6839\u76ee\u5f55\u6267\u884cnpm run build&#xff0c;\u786e\u4fdddist\u6587\u4ef6\u5939\u751f\u6210\u6210\u529f&#xff08;\u65e0\u62a5\u9519&#xff09;&#xff1b;<\/li>\n<li>\u786e\u8ba4src\/app.ts\u4e2dbaseURL\u5df2\u914d\u7f6e\u4e3aLinux \u670d\u52a1\u5668\u5c40\u57df\u7f51 IP &#043; \u540e\u7aef\u7aef\u53e3&#xff08;\u5982http:\/\/192.168.66.100:8003&#xff09;&#xff0c;\u6253\u5305\u540e\u4e0d\u53ef\u4fee\u6539&#xff0c;\u6539\u4e86\u9700\u91cd\u65b0\u6253\u5305\u3002<\/li>\n<\/ul>\n<h5>\u540e\u7aef&#xff08;FastAPI \u9879\u76ee&#xff09;<\/h5>\n<ul>\n<li>\u6574\u7406\u540e\u7aef\u6e90\u7801\u6587\u4ef6&#xff1a;\u5305\u542bmain.py&#xff08;\u5165\u53e3\u6587\u4ef6&#xff09;\u3001requirements.txt&#xff08;\u4f9d\u8d56\u6e05\u5355&#xff0c;\u5fc5\u987b\u6709&#xff09;&#xff1b;<\/li>\n<li>\u672c\u5730\u751f\u6210requirements.txt&#xff08;\u907f\u514d Linux \u62c9\u53d6\u4f9d\u8d56\u7248\u672c\u4e0d\u4e00\u81f4&#xff09;&#xff1a;<\/li>\n<\/ul>\n<p># \u672c\u5730\u540e\u7aef\u9879\u76ee\u76ee\u5f55\u6267\u884c<br \/>\npip freeze &gt; requirements.txt<\/p>\n<ul>\n<li>\u540e\u7aef\u6587\u4ef6\u6e05\u5355\u793a\u4f8b&#xff1a;main.py\u3001requirements.txt\u3001\u5176\u4ed6\u4e1a\u52a1\u4ee3\u7801 \/ \u914d\u7f6e\u6587\u4ef6&#xff08;\u65e0\u591a\u4f59\u6587\u4ef6&#xff09;\u3002<\/li>\n<\/ul>\n<h4>3. \u672c\u5730\u6587\u4ef6\u4e0a\u4f20\u5230 Linux&#xff08;2 \u79cd\u7b80\u6613\u65b9\u5f0f&#xff09;<\/h4>\n<h5>\u65b9\u5f0f 1&#xff1a;Xshell\/Xftp&#xff08;\u53ef\u89c6\u5316&#xff0c;Windows \u63a8\u8350&#xff09;<\/h5>\n<ul>\n<li>Xftp \u8fde\u63a5 Linux \u670d\u52a1\u5668&#xff0c;\u76f4\u63a5\u5c06\u672c\u5730dist\u62d6\u5230\/opt\/antd-front\/&#xff0c;\u540e\u7aef\u6587\u4ef6\u62d6\u5230\/opt\/fastapi-back\/\u3002<\/li>\n<\/ul>\n<h5>\u65b9\u5f0f 2&#xff1a;scp \u547d\u4ee4&#xff08;\u65e0\u53ef\u89c6\u5316&#xff0c;Windows\/Mac\/Linux \u901a\u7528&#xff09;<\/h5>\n<p># \u4e0a\u4f20\u524d\u7aefdist&#xff08;\u672c\u5730dist\u8def\u5f84 \u2192 Linux\u524d\u7aef\u76ee\u5f55&#xff09;<br \/>\nscp -r \u672c\u5730dist\u7edd\u5bf9\u8def\u5f84 \u4f60\u7684Linux\u7528\u6237\u540d&#064;Linux\u670d\u52a1\u5668IP:\/opt\/antd-front\/<br \/>\n# \u793a\u4f8b&#xff1a;scp -r D:\\\\code\\\\login-ant\\\\dist ubuntu&#064;192.168.66.100:\/opt\/antd-front\/<\/p>\n<p># \u4e0a\u4f20\u540e\u7aef\u6587\u4ef6&#xff08;\u672c\u5730\u540e\u7aef\u76ee\u5f55 \u2192 Linux\u540e\u7aef\u76ee\u5f55&#xff09;<br \/>\nscp -r \u672c\u5730\u540e\u7aef\u9879\u76ee\u8def\u5f84\/* \u4f60\u7684Linux\u7528\u6237\u540d&#064;Linux\u670d\u52a1\u5668IP:\/opt\/fastapi-back\/<br \/>\n# \u793a\u4f8b&#xff1a;scp -r D:\\\\code\\\\fastapi-back\\\\* ubuntu&#064;192.168.66.100:\/opt\/fastapi-back\/<\/p>\n<p>\u2705 \u9a8c\u8bc1\u4e0a\u4f20&#xff1a;Linux \u670d\u52a1\u5668\u6267\u884cls \/opt\/antd-front\/\u548cls \/opt\/fastapi-back\/&#xff0c;\u80fd\u770b\u5230 dist \u548c\u540e\u7aef\u6587\u4ef6\u5373\u6210\u529f\u3002<\/p>\n<h3>\u4e8c\u3001Linux \u540e\u7aef FastAPI \u670d\u52a1\u90e8\u7f72&#xff08;\u6838\u5fc3&#xff1a;\u865a\u62df\u73af\u5883 &#043; \u540e\u53f0\u8fd0\u884c&#xff09;<\/h3>\n<h4>\u6b65\u9aa4 1&#xff1a;\u5b89\u88c5 Python3 &#043; \u865a\u62df\u73af\u5883&#xff08;\u907f\u514d\u7cfb\u7edf\u4f9d\u8d56\u51b2\u7a81&#xff09;<\/h4>\n<p>Linux \u9ed8\u8ba4\u81ea\u5e26 Python3&#xff0c;\u53ea\u9700\u5b89\u88c5\u865a\u62df\u73af\u5883\u5de5\u5177&#xff1a;<\/p>\n<p># CentOS\/RHEL<br \/>\nsudo yum install -y python3-pip python3-venv<br \/>\n# Debian\/Ubuntu<br \/>\nsudo apt update &amp;&amp; sudo apt install -y python3-pip python3-venv<\/p>\n<h4>\u6b65\u9aa4 2&#xff1a;\u521b\u5efa\u5e76\u6fc0\u6d3b Python \u865a\u62df\u73af\u5883<\/h4>\n<p># \u8fdb\u5165\u540e\u7aef\u90e8\u7f72\u76ee\u5f55<br \/>\ncd \/opt\/fastapi-back<br \/>\n# \u521b\u5efa\u865a\u62df\u73af\u5883&#xff08;\u547d\u540d\u4e3avenv&#xff0c;\u901a\u7528\u89c4\u8303&#xff09;<br \/>\npython3 -m venv venv<br \/>\n# \u6fc0\u6d3b\u865a\u62df\u73af\u5883&#xff08;Linux\u6838\u5fc3\u547d\u4ee4&#xff0c;\u6fc0\u6d3b\u540e\u547d\u4ee4\u884c\u524d\u4f1a\u51fa\u73b0(venv)&#xff09;<br \/>\nsource venv\/bin\/activate<\/p>\n<h4>\u6b65\u9aa4 3&#xff1a;\u5b89\u88c5\u540e\u7aef\u4f9d\u8d56&#xff08;\u57fa\u4e8e requirements.txt&#xff09;<\/h4>\n<p># \u6fc0\u6d3b\u865a\u62df\u73af\u5883\u540e\u6267\u884c&#xff0c;\u62c9\u53d6\u6307\u5b9a\u7248\u672c\u4f9d\u8d56<br \/>\npip install -r requirements.txt<br \/>\n# \u9a8c\u8bc1\u5b89\u88c5&#xff1a;\u80fd\u770b\u5230fastapi\u3001uvicorn\u3001pydantic\u7b49\u4f9d\u8d56\u5373\u6210\u529f<br \/>\npip list<\/p>\n<h4>\u6b65\u9aa4 4&#xff1a;\u542f\u52a8 FastAPI \u670d\u52a1&#xff08;\u540e\u53f0\u8fd0\u884c &#043; \u7ed1\u5b9a\u6240\u6709\u7f51\u5361&#xff09;<\/h4>\n<h5>\u65b9\u5f0f 1&#xff1a;nohup \u540e\u53f0\u8fd0\u884c&#xff08;\u7b80\u6613&#xff0c;\u63a8\u8350\u5185\u7f51\u90e8\u7f72&#xff09;<\/h5>\n<p># \u6fc0\u6d3b\u865a\u62df\u73af\u5883\u540e\u6267\u884c&#xff0c;\u540e\u53f0\u8fd0\u884c\u5e76\u8f93\u51fa\u65e5\u5fd7&#xff0c;\u7ed1\u5b9a0.0.0.0&#xff08;\u5185\u7f51\u6240\u6709\u8bbe\u5907\u53ef\u8bbf\u95ee&#xff09;<br \/>\nnohup uvicorn main:app &#8211;host 0.0.0.0 &#8211;port 8003 &gt; fastapi.log 2&gt;&amp;1 &amp;<\/p>\n<ul>\n<li>\u547d\u4ee4\u8bf4\u660e&#xff1a;\n<ul>\n<li>nohup &#8230; &amp;&#xff1a;\u540e\u53f0\u8fd0\u884c&#xff0c;\u5173\u95ed\u7ec8\u7aef\u4e0d\u4e2d\u65ad\u670d\u52a1&#xff1b;<\/li>\n<li>&gt; fastapi.log 2&gt;&amp;1&#xff1a;\u6240\u6709\u65e5\u5fd7\u8f93\u51fa\u5230fastapi.log&#xff0c;\u65b9\u4fbf\u6392\u67e5\u9519\u8bef&#xff1b;<\/li>\n<li>main:app&#xff1a;FastAPI \u5165\u53e3&#xff08;main \u662f\u5165\u53e3\u6587\u4ef6\u540d&#xff0c;app \u662f FastAPI \u5b9e\u4f8b\u540d&#xff0c;\u9700\u548c\u540e\u7aef\u4ee3\u7801\u4e00\u81f4&#xff09;\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h5>\u65b9\u5f0f 2&#xff1a;systemd \u670d\u52a1&#xff08;\u7a33\u5b9a&#xff0c;\u63a8\u8350\u6b63\u5f0f\u90e8\u7f72&#xff0c;\u5f00\u673a\u81ea\u542f&#xff09;<\/h5>\n<li>\u65b0\u5efa systemd \u914d\u7f6e\u6587\u4ef6&#xff1a;<\/li>\n<p>sudo vim \/etc\/systemd\/system\/fastapi.service<\/p>\n<p>\u00a0 \u00a0 \u00a02.\u5199\u5165\u914d\u7f6e&#xff08;\u66ff\u6362User\u548cWorkingDirectory\u4e3a\u4f60\u7684\u5b9e\u9645\u4fe1\u606f&#xff09;&#xff1a;<\/p>\n<p>[Unit]<br \/>\nDescription&#061;FastAPI Backend Service<br \/>\nAfter&#061;network.target<\/p>\n<p>[Service]<br \/>\nUser&#061;\u4f60\u7684Linux\u7528\u6237\u540d # \u5982ubuntu\/root<br \/>\nWorkingDirectory&#061;\/opt\/fastapi-back # \u540e\u7aef\u90e8\u7f72\u76ee\u5f55<br \/>\nExecStart&#061;\/opt\/fastapi-back\/venv\/bin\/uvicorn main:app &#8211;host 0.0.0.0 &#8211;port 8003<br \/>\nRestart&#061;always # \u670d\u52a1\u5d29\u6e83\u81ea\u52a8\u91cd\u542f<\/p>\n<p>[Install]<br \/>\nWantedBy&#061;multi-user.target<\/p>\n<p>\u00a0 \u00a0 3.\u542f\u52a8\u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f&#xff1a;<\/p>\n<p># \u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e<br \/>\nsudo systemctl daemon-reload<br \/>\n# \u542f\u52a8\u670d\u52a1<br \/>\nsudo systemctl start fastapi<br \/>\n# \u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<br \/>\nsudo systemctl enable fastapi<br \/>\n# \u67e5\u770b\u670d\u52a1\u72b6\u6001&#xff08;\u65e0error\u5373\u6210\u529f&#xff09;<br \/>\nsudo systemctl status fastapi<\/p>\n<h4>\u6b65\u9aa4 5&#xff1a;\u9a8c\u8bc1\u540e\u7aef\u670d\u52a1\u662f\u5426\u53ef\u7528<\/h4>\n<p># Linux\u672c\u5730\u6267\u884ccurl\u8bf7\u6c42&#xff0c;\u8fd4\u56de\u63a5\u53e3\u6570\u636e\u5373\u6210\u529f<br \/>\ncurl http:\/\/127.0.0.1:8003\/api\/currentUser<\/p>\n<p>\u2705 \u82e5\u8fd4\u56de JSON \u6570\u636e&#xff0c;\u8bf4\u660e\u540e\u7aef\u670d\u52a1\u6b63\u5e38&#xff1b;\u82e5\u62a5\u9519&#xff0c;\u67e5\u770b\u65e5\u5fd7&#xff1a;<\/p>\n<ul>\n<li>nohup \u65b9\u5f0f&#xff1a;cat \/opt\/fastapi-back\/fastapi.log<\/li>\n<li>systemd \u65b9\u5f0f&#xff1a;sudo journalctl -u fastapi -f<\/li>\n<\/ul>\n<h3>\u4e09\u3001Linux \u524d\u7aef Ant Design \u90e8\u7f72&#xff08;\u6838\u5fc3&#xff1a;pm2 \u6258\u7ba1 anywhere&#xff0c;\u7a33\u5b9a\u4e0d\u4e2d\u65ad&#xff09;<\/h3>\n<h4>\u6b65\u9aa4 1&#xff1a;\u5b89\u88c5 Node.js&#043;npm&#xff08;anywhere \u4f9d\u8d56 Node \u73af\u5883&#xff09;<\/h4>\n<p># \u5b89\u88c5Node.js 18.x&#xff08;\u7a33\u5b9a\u7248&#xff0c;\u517c\u5bb9anywhere&#xff09;<br \/>\n# CentOS\/RHEL<br \/>\ncurl -fsSL https:\/\/rpm.nodesource.com\/setup_18.x | sudo bash &#8211;<br \/>\nsudo yum install -y nodejs<br \/>\n# Debian\/Ubuntu<br \/>\ncurl -fsSL https:\/\/deb.nodesource.com\/setup_18.x | sudo bash &#8211;<br \/>\nsudo apt install -y nodejs<\/p>\n<p># \u9a8c\u8bc1\u5b89\u88c5&#xff08;\u8f93\u51fa\u7248\u672c\u5373\u6210\u529f&#xff09;<br \/>\nnode -v<br \/>\nnpm -v<\/p>\n<h4>\u6b65\u9aa4 2&#xff1a;\u5168\u5c40\u5b89\u88c5 anywhere&#043;pm2&#xff08;pm2 \u7528\u4e8e\u7ba1\u7406\u524d\u7aef\u670d\u52a1&#xff0c;\u540e\u53f0\u8fd0\u884c&#xff09;<\/h4>\n<p># \u5b89\u88c5anywhere&#xff08;\u9759\u6001\u670d\u52a1&#xff09;\u548cpm2&#xff08;\u8fdb\u7a0b\u7ba1\u7406&#xff09;<br \/>\nnpm install -g anywhere pm2<br \/>\n# \u9a8c\u8bc1\u5b89\u88c5<br \/>\nanywhere -v<br \/>\npm2 -v<\/p>\n<h4>\u6b65\u9aa4 3&#xff1a;\u7528 pm2 \u542f\u52a8 anywhere&#xff0c;\u6258\u7ba1 dist \u6587\u4ef6\u5939<\/h4>\n<p># \u8fdb\u5165\u524d\u7aef\u90e8\u7f72\u76ee\u5f55<br \/>\ncd \/opt\/antd-front<br \/>\n# \u7528pm2\u542f\u52a8anywhere&#xff0c;\u6307\u5b9a\u7aef\u53e38080&#xff0c;\u6258\u7ba1dist&#xff0c;\u7ed1\u5b9a0.0.0.0<br \/>\npm2 start anywhere &#8212; -p 8080 -d dist -h 0.0.0.0<br \/>\n# \u5173\u952e&#xff1a;\u4fdd\u5b58pm2\u914d\u7f6e&#xff0c;\u5f00\u673a\u81ea\u542f<br \/>\npm2 save<br \/>\npm2 startup<br \/>\n# \u6309\u7ec8\u7aef\u63d0\u793a\u6267\u884c\u751f\u6210\u7684\u547d\u4ee4&#xff08;\u5982sudo env PATH&#061;$PATH:\/usr\/bin pm2 startup systemd -u \u7528\u6237\u540d &#8211;hp \/home\/\u7528\u6237\u540d&#xff09;<\/p>\n<h4>\u6b65\u9aa4 4&#xff1a;\u9a8c\u8bc1\u524d\u7aef\u670d\u52a1\u662f\u5426\u53ef\u7528<\/h4>\n<p># Linux\u672c\u5730\u6267\u884ccurl&#xff0c;\u8fd4\u56deHTML\u9875\u9762\u5373\u6210\u529f<br \/>\ncurl http:\/\/127.0.0.1:8080<\/p>\n<p>\u2705 \u82e5\u8fd4\u56de\u5927\u91cf HTML \u4ee3\u7801&#xff0c;\u8bf4\u660e\u524d\u7aef\u9759\u6001\u670d\u52a1\u6b63\u5e38&#xff1b;\u82e5\u62a5\u9519&#xff0c;\u7528pm2 logs\u67e5\u770b\u65e5\u5fd7\u3002<\/p>\n<h4>pm2 \u5e38\u7528\u547d\u4ee4&#xff08;\u524d\u7aef\u670d\u52a1\u7ba1\u7406&#xff09;<\/h4>\n<p># \u67e5\u770b\u8fd0\u884c\u7684\u670d\u52a1<br \/>\npm2 list<br \/>\n# \u91cd\u542f\u524d\u7aef\u670d\u52a1<br \/>\npm2 restart anywhere<br \/>\n# \u505c\u6b62\u524d\u7aef\u670d\u52a1<br \/>\npm2 stop anywhere<br \/>\n# \u67e5\u770b\u5b9e\u65f6\u65e5\u5fd7<br \/>\npm2 logs<br \/>\n# \u5220\u9664\u524d\u7aef\u670d\u52a1<br \/>\npm2 delete anywhere<\/p>\n<h3>\u56db\u3001Linux \u7aef\u53e3\u5f00\u653e&#xff08;\u6838\u5fc3&#xff1a;\u8ba9\u5185\u7f51\u8bbe\u5907\u8bbf\u95ee&#xff0c;2 \u79cd\u65b9\u5f0f&#xff09;<\/h3>\n<p>\u524d\u7aef 8080\u3001\u540e\u7aef 8003 \u7aef\u53e3\u9700\u5f00\u653e&#xff0c;\u5426\u5219\u5185\u7f51\u8bbe\u5907\u4f1a\u88ab Linux \u9632\u706b\u5899\u62e6\u622a&#xff0c;\u4e8c\u9009\u4e00\u5373\u53ef\u3002<\/p>\n<h4>\u65b9\u5f0f 1&#xff1a;firewalld&#xff08;CentOS7&#043;\/RHEL&#xff0c;\u9ed8\u8ba4\u9632\u706b\u5899&#xff09;<\/h4>\n<p># \u5f00\u653e8080\u548c8003\u7aef\u53e3&#xff08;\u6c38\u4e45\u751f\u6548&#xff09;<br \/>\nsudo firewall-cmd &#8211;add-port&#061;8080\/tcp &#8211;permanent<br \/>\nsudo firewall-cmd &#8211;add-port&#061;8003\/tcp &#8211;permanent<br \/>\n# \u91cd\u65b0\u52a0\u8f7d\u9632\u706b\u5899\u914d\u7f6e<br \/>\nsudo firewall-cmd &#8211;reload<br \/>\n# \u9a8c\u8bc1\u7aef\u53e3\u662f\u5426\u5f00\u653e<br \/>\nsudo firewall-cmd &#8211;list-ports<\/p>\n<h4>\u65b9\u5f0f 2&#xff1a;ufw&#xff08;Debian\/Ubuntu&#xff0c;\u8f7b\u91cf\u9632\u706b\u5899&#xff09;<\/h4>\n<p># \u5148\u542f\u7528ufw&#xff08;\u82e5\u672a\u542f\u7528&#xff09;<br \/>\nsudo ufw enable<br \/>\n# \u5f00\u653e8080\u548c8003\u7aef\u53e3<br \/>\nsudo ufw allow 8080\/tcp<br \/>\nsudo ufw allow 8003\/tcp<br \/>\n# \u9a8c\u8bc1\u7aef\u53e3\u662f\u5426\u5f00\u653e<br \/>\nsudo ufw status<\/p>\n<h3>\u4e94\u3001\u5185\u7f51\u8bbf\u95ee\u9a8c\u8bc1&#xff08;\u6240\u6709\u6b65\u9aa4\u7684\u6700\u7ec8\u68c0\u9a8c&#xff09;<\/h3>\n<li>\u67e5\u770b Linux \u670d\u52a1\u5668\u7684\u5c40\u57df\u7f51 IP&#xff1a; ip addr # \u627e\u5230inet\u5f00\u5934\u7684\u5185\u7f51IP&#xff0c;\u5982192.168.66.100&#xff08;ens33\/eth0\u7f51\u5361&#xff09;\n <\/li>\n<li>\u5185\u7f51\u4efb\u610f\u8bbe\u5907&#xff08;\u7535\u8111 \/ \u624b\u673a&#xff09;\u6253\u5f00\u6d4f\u89c8\u5668&#xff0c;\u8f93\u5165&#xff1a; http:\/\/Linux\u670d\u52a1\u5668\u5185\u7f51IP:8080\n <\/li>\n<li>\u9a8c\u8bc1\u6838\u5fc3\u529f\u80fd&#xff1a;\n<ul>\n<li>\u2705 \u9875\u9762\u6b63\u5e38\u52a0\u8f7d&#xff1a;\u524d\u7aef\u9759\u6001\u670d\u52a1\u90e8\u7f72\u6210\u529f&#xff1b;<\/li>\n<li>\u2705 \u80fd\u6b63\u5e38\u767b\u5f55&#xff08;POST \/api\/login\/account&#xff09;&#xff1a;\u524d\u540e\u7aef\u901a\u4fe1\u6b63\u5e38&#xff0c;CORS \u914d\u7f6e\u751f\u6548&#xff1b;<\/li>\n<li>\u2705 \u80fd\u83b7\u53d6\u7528\u6237\u4fe1\u606f&#xff08;GET \/api\/currentUser&#xff09;&#xff1a;\u540e\u7aef\u63a5\u53e3\u6b63\u5e38&#xff0c;\u7aef\u53e3\u5f00\u653e\u6210\u529f&#xff1b;<\/li>\n<li>\u2705 \u5237\u65b0\u9875\u9762\u4e0d 404&#xff1a;anywhere \u9002\u914d\u5355\u9875\u5e94\u7528\u8def\u7531\u6210\u529f\u3002<\/li>\n<\/ul>\n<\/li>\n<h3>\u516d\u3001\u9879\u76ee\u66f4\u65b0&#xff08;\u540e\u7eed\u8fed\u4ee3\u4ee3\u7801&#xff0c;\u6700\u7b80\u6d41\u7a0b&#xff09;<\/h3>\n<h4>\u524d\u7aef\u66f4\u65b0<\/h4>\n<li>\u672c\u5730\u4fee\u6539\u4ee3\u7801\u2192\u91cd\u65b0\u6267\u884cnpm run build\u751f\u6210\u65b0 dist&#xff1b;<\/li>\n<li>\u4e0a\u4f20\u65b0 dist \u8986\u76d6 Linux \u4e0a\u7684\/opt\/antd-front\/dist&#xff1b;<\/li>\n<li>\u91cd\u542f\u524d\u7aef\u670d\u52a1&#xff1a;pm2 restart anywhere\u3002<\/li>\n<h4>\u540e\u7aef\u66f4\u65b0<\/h4>\n<li>\u672c\u5730\u4fee\u6539\u4ee3\u7801\u2192\u66f4\u65b0requirements.txt&#xff08;\u82e5\u65b0\u589e\u4f9d\u8d56&#xff09;&#xff1b;<\/li>\n<li>\u4e0a\u4f20\u65b0\u4ee3\u7801\u8986\u76d6 Linux \u4e0a\u7684\/opt\/fastapi-back\/&#xff1b;<\/li>\n<li>\u91cd\u542f\u540e\u7aef\u670d\u52a1&#xff1a;\n<ul>\n<li>nohup \u65b9\u5f0f&#xff1a;\u5148\u6740\u8fdb\u7a0b\u518d\u91cd\u542f&#xff08;ps -ef | grep uvicorn \u2192 kill -9 \u8fdb\u7a0b\u53f7 \u2192 \u91cd\u65b0\u6267\u884c nohup \u547d\u4ee4&#xff09;&#xff1b;<\/li>\n<li>systemd \u65b9\u5f0f&#xff1a;sudo systemctl restart fastapi&#xff1b;<\/li>\n<\/ul>\n<\/li>\n<li>\u82e5\u65b0\u589e\u4f9d\u8d56&#xff0c;\u5148\u6fc0\u6d3b\u865a\u62df\u73af\u5883\u518d\u5b89\u88c5&#xff1a;<\/li>\n<p>cd \/opt\/fastapi-back<br \/>\nsource venv\/bin\/activate<br \/>\npip install -r requirements.txt<\/p>\n<h3>\u4e03\u3001Linux \u90e8\u7f72\u907f\u5751\u70b9&#xff08;\u5fc5\u770b&#xff0c;\u907f\u514d\u8e29\u96f7&#xff09;<\/h3>\n<li>\u6743\u9650\u95ee\u9898&#xff1a;\u90e8\u7f72\u76ee\u5f55\u5efa\u8bae\u7528\/opt\/&#xff0c;\u5e76\u8d4b\u4e88\u666e\u901a\u7528\u6237\u6743\u9650&#xff0c;\u907f\u514d\u5168\u7a0b sudo \u5bfc\u81f4\u7684\u6587\u4ef6\u6743\u9650\u9519\u8bef&#xff1b;<\/li>\n<li>\u865a\u62df\u73af\u5883&#xff1a;\u540e\u7aef\u5fc5\u987b\u7528 Python \u865a\u62df\u73af\u5883&#xff0c;\u5426\u5219\u4f1a\u548c\u7cfb\u7edf Python \u4f9d\u8d56\u51b2\u7a81&#xff0c;\u5bfc\u81f4\u670d\u52a1\u542f\u52a8\u5931\u8d25&#xff1b;<\/li>\n<li>IP \u914d\u7f6e&#xff1a;\u524d\u7aef\u6253\u5305\u524dbaseURL\u5fc5\u987b\u662fLinux \u670d\u52a1\u5668\u5185\u7f51 IP&#xff0c;\u800c\u975elocalhost\/127.0.0.1&#xff0c;\u5426\u5219\u524d\u7aef\u8bf7\u6c42\u4f1a\u6307\u5411\u672c\u673a&#xff1b;<\/li>\n<li>\u7aef\u53e3\u51b2\u7a81&#xff1a;\u82e5 8080\/8003 \u7aef\u53e3\u88ab\u5360\u7528&#xff0c;\u53ef\u66f4\u6362\u7aef\u53e3&#xff08;\u5982\u524d\u7aef 80\u3001\u540e\u7aef 8000&#xff09;&#xff0c;\u9700\u540c\u6b65\u4fee\u6539\u524d\u7aef baseURL \u548c Linux \u7aef\u53e3\u5f00\u653e\u547d\u4ee4&#xff1b;<\/li>\n<li>\u540e\u53f0\u8fd0\u884c&#xff1a;\u7981\u6b62\u76f4\u63a5\u7528anywhere\/uvicorn\u542f\u52a8\u670d\u52a1&#xff08;\u5173\u95ed\u7ec8\u7aef\u5373\u4e2d\u65ad&#xff09;&#xff0c;\u5fc5\u987b\u7528pm2\/nohup\/systemd\u540e\u53f0\u8fd0\u884c&#xff1b;<\/li>\n<li>\u65e5\u5fd7\u6392\u67e5&#xff1a;\u670d\u52a1\u542f\u52a8\u5931\u8d25\u65f6&#xff0c;\u4f18\u5148\u67e5\u770b\u65e5\u5fd7&#xff08;pm2 logs\/fastapi.log\/journalctl&#xff09;&#xff0c;\u65e5\u5fd7\u4f1a\u660e\u786e\u63d0\u793a\u9519\u8bef\u539f\u56e0&#xff08;\u5982\u4f9d\u8d56\u7f3a\u5931\u3001\u7aef\u53e3\u88ab\u5360\u3001\u4ee3\u7801\u8bed\u6cd5\u9519\u8bef&#xff09;&#xff1b;<\/li>\n<li>CORS \u914d\u7f6e&#xff1a;\u540e\u7aef FastAPI \u7684allow_origin_regex\u5fc5\u987b\u5305\u542b Linux \u670d\u52a1\u5668\u5185\u7f51\u7f51\u6bb5&#xff08;\u5982192.168.66.\\\\d&#043;&#xff09;&#xff0c;\u5426\u5219\u4f1a\u8de8\u57df\u62e6\u622a&#xff1b;<\/li>\n<li>\u6587\u4ef6\u8def\u5f84&#xff1a;Linux \u8def\u5f84\u533a\u5206\u5927\u5c0f\u5199&#xff0c;\u4e14\u65e0\u76d8\u7b26&#xff0c;\u90e8\u7f72\u65f6\u907f\u514d\u4e2d\u6587 \/ \u7a7a\u683c&#xff08;\u5982\/opt\/\u524d\u7aef\u9879\u76ee \u2192 \u6539\u4e3a\/opt\/antd-front&#xff09;\u3002<\/li>\n<h3>\u516b\u3001\u8fdb\u9636&#xff1a;\u751f\u4ea7\u73af\u5883 Nginx \u6258\u7ba1\u524d\u7aef&#xff08;\u53ef\u9009&#xff0c;\u6027\u80fd\u66f4\u9ad8&#xff09;<\/h3>\n<p>\u82e5\u5185\u7f51\u8bbf\u95ee\u8bbe\u5907\u8f83\u591a&#xff08;\u5982\u51e0\u5341\u53f0&#xff09;&#xff0c;\u63a8\u8350\u7528Nginx\u66ff\u4ee3anywhere&#043;pm2&#xff0c;\u6027\u80fd\u66f4\u9ad8\u3001\u7a33\u5b9a\u6027\u66f4\u5f3a&#xff0c;\u9002\u914d\u9ad8\u5e76\u53d1\u3002<\/p>\n<h4>\u6b65\u9aa4 1&#xff1a;\u5b89\u88c5 Nginx<\/h4>\n<p># CentOS\/RHEL<br \/>\nsudo yum install -y nginx<br \/>\n# Debian\/Ubuntu<br \/>\nsudo apt update &amp;&amp; sudo apt install -y nginx<br \/>\n# \u542f\u52a8\u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<br \/>\nsudo systemctl start nginx<br \/>\nsudo systemctl enable nginx<\/p>\n<h4>\u6b65\u9aa4 2&#xff1a;\u914d\u7f6e Nginx&#xff0c;\u6258\u7ba1 dist \u5e76\u9002\u914d SPA \u8def\u7531<\/h4>\n<li>\u5907\u4efd\u9ed8\u8ba4\u914d\u7f6e&#xff1a;sudo mv \/etc\/nginx\/conf.d\/default.conf \/etc\/nginx\/conf.d\/default.conf.bak&#xff1b;<\/li>\n<li>\u65b0\u5efa\u524d\u7aef\u914d\u7f6e\u6587\u4ef6&#xff1a;<\/li>\n<p>sudo vim \/etc\/nginx\/conf.d\/antd-front.conf<\/p>\n<p>\u00a0 \u00a0 \u00a03.\u5199\u5165\u914d\u7f6e&#xff08;\u66ff\u6362server_name\u4e3a Linux \u670d\u52a1\u5668\u5185\u7f51 IP&#xff09;&#xff1a;<\/p>\n<p>server {<br \/>\n    listen 80; # \u7aef\u53e3\u53ef\u6539\u4e3a80&#xff0c;\u6d4f\u89c8\u5668\u8bbf\u95ee\u65f6\u65e0\u9700\u8f93\u7aef\u53e3<br \/>\n    server_name 192.168.66.100; # Linux\u670d\u52a1\u5668\u5185\u7f51IP<\/p>\n<p>    # \u6307\u5411\u524d\u7aefdist\u6587\u4ef6\u5939\u7684\u7edd\u5bf9\u8def\u5f84<br \/>\n    root \/opt\/antd-front\/dist;<br \/>\n    index index.html; # \u5355\u9875\u5e94\u7528\u552f\u4e00\u5165\u53e3<\/p>\n<p>    # \u6838\u5fc3&#xff1a;\u9002\u914dAnt Design SPA\u8def\u7531&#xff0c;\u907f\u514d\u5237\u65b0404<br \/>\n    try_files $uri $uri\/ \/index.html;<\/p>\n<p>    # \u53ef\u9009&#xff1a;\u914d\u7f6e\u9759\u6001\u8d44\u6e90\u7f13\u5b58&#xff0c;\u63d0\u5347\u8bbf\u95ee\u901f\u5ea6<br \/>\n    location ~* \\\\.(js|css|png|jpg|ico)$ {<br \/>\n        expires 7d; # \u7f13\u5b587\u5929<br \/>\n        add_header Cache-Control &#034;public, max-age&#061;604800&#034;;<br \/>\n    }<br \/>\n}<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04.\u9a8c\u8bc1\u914d\u7f6e\u5e76\u91cd\u542f Nginx&#xff1a;<\/p>\n<p># \u9a8c\u8bc1\u914d\u7f6e\u8bed\u6cd5&#xff08;\u65e0error\u5373\u6210\u529f&#xff09;<br \/>\nsudo nginx -t<br \/>\n# \u91cd\u542fNginx<br \/>\nsudo systemctl restart nginx<\/p>\n<p>\u00a0 \u00a0 \u00a05.\u8bbf\u95ee\u65b9\u5f0f&#xff1a;\u5185\u7f51\u8bbe\u5907\u76f4\u63a5\u8f93\u5165http:\/\/Linux\u670d\u52a1\u5668\u5185\u7f51IP&#xff08;\u65e0\u9700\u52a0 80 \u7aef\u53e3&#xff09;&#xff0c;\u66f4\u7b80\u6d01\u3002<\/p>\n<h4>\u6b65\u9aa4 3&#xff1a;\u505c\u6b62\u539f\u6709 anywhere \u670d\u52a1<\/h4>\n<p>pm2 delete anywhere<\/p>\n<h3>\u6838\u5fc3\u603b\u7ed3<\/h3>\n<li>Linux \u90e8\u7f72\u6838\u5fc3&#xff1a;\u524d\u7aef\u4ec5\u4f20dist&#xff0c;\u540e\u7aef\u4f20\u6e90\u7801 &#043;requirements.txt&#xff0c;\u5206\u522b\u542f\u52a8\u670d\u52a1\u5e76\u5f00\u653e\u7aef\u53e3&#xff1b;<\/li>\n<li>\u540e\u7aef\u5fc5\u7528\u865a\u62df\u73af\u5883&#xff0c;\u907f\u514d\u4f9d\u8d56\u51b2\u7a81&#xff0c;\u670d\u52a1\u540e\u53f0\u8fd0\u884c\u7528nohup&#xff08;\u7b80\u6613&#xff09;\/systemd&#xff08;\u6b63\u5f0f&#xff09;&#xff1b;<\/li>\n<li>\u524d\u7aef\u7528anywhere&#043;pm2 \u5feb\u901f\u90e8\u7f72&#xff0c;\u9ad8\u5e76\u53d1\u573a\u666f\u66ff\u6362\u4e3a Nginx&#xff0c;\u5747\u9700\u9002\u914d SPA \u8def\u7531\u907f\u514d\u5237\u65b0 404&#xff1b;<\/li>\n<li>\u7aef\u53e3\u5f00\u653e\u662f\u5173\u952e&#xff0c;\u5185\u7f51\u8bbf\u95ee\u5931\u8d25\u4f18\u5148\u68c0\u67e5 Linux \u9632\u706b\u5899\u662f\u5426\u5f00\u653e 8080\/8003 \u7aef\u53e3&#xff1b;<\/li>\n<li>\u66f4\u65b0\u9879\u76ee\u4ec5\u9700\u8986\u76d6\u6587\u4ef6\u5e76\u91cd\u542f\u670d\u52a1&#xff0c;\u65e0\u9700\u91cd\u65b0\u914d\u7f6e\u73af\u5883&#xff0c;\u7b80\u5316\u7ef4\u62a4\u6d41\u7a0b&#xff1b;<\/li>\n<li>\u6240\u6709\u914d\u7f6e\u5747\u9002\u914d\u5185\u7f51\u90e8\u7f72&#xff0c;\u65e0\u9700\u516c\u7f51 IP&#xff0c;\u517c\u987e\u5b89\u5168\u6027\u548c\u53ef\u8bbf\u95ee\u6027\u3002<\/li>\n<p>\u6309\u4ee5\u4e0a\u6b65\u9aa4\u64cd\u4f5c&#xff0c;\u5c31\u80fd\u5728 Linux \u670d\u52a1\u5668\u4e0a\u7a33\u5b9a\u8fd0\u884c Ant Design&#043;FastAPI \u9879\u76ee&#xff0c;\u5185\u7f51\u6240\u6709\u8bbe\u5907\u5747\u53ef\u6b63\u5e38\u8bbf\u95ee\u548c\u4f7f\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6838\u5fc3\u539f\u5219&#xff1a;\u524d\u7aef\u4ec5\u9700\u4e0a\u4f20\u6253\u5305\u540e\u7684dist\u6587\u4ef6\u5939&#xff0c;\u540e\u7aef\u4e0a\u4f20\u6e90\u7801 \/ \u4f9d\u8d56\u6587\u4ef6&#xff0c;\u5206\u522b\u542f\u52a8\u524d\u7aef\u9759\u6001\u670d\u52a1\u548c\u540e\u7aef FastAPI \u670d\u52a1&#xff0c;\u914d\u5408 Linux \u9632\u706b\u5899 \/ \u7aef\u53e3\u5f00\u653e&#xff0c;\u5b9e\u73b0\u5185\u7f51\u6240\u6709\u8bbe\u5907\u8bbf\u95ee\u3002\u5168\u7a0b\u9002\u914dCentOS\/Debian\/Ubuntu&#xff08;\u4e3b\u6d41 Linux \u53d1\u884c\u7248&#xff09;&#xff0c;\u6b65\u9aa4\u6e05\u6670\u53ef\u843d\u5730&#xff0c;\u517c\u987e\u7b80\u6613\u90e8\u7f72\u548c\u7a33\u5b9a\u8fd0\u884c\u3002<br \/>\n\u4e00\u3001\u524d\u671f\u51c6\u5907&#xff08;Linux \u670d\u52a1\u5668<\/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":[72,43,305],"topic":[],"class_list":["post-71435","post","type-post","status-publish","format-standard","hentry","category-server","tag-fastapi","tag-43","tag-305"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010\u7b14\u8bb0\u3011Ant Design+FastAPI \u9879\u76ee Linux \u670d\u52a1\u5668\u5185\u7f51\u90e8\u7f72\u5b8c\u6574\u7b14\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/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.wsisp.com\/helps\/71435.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010\u7b14\u8bb0\u3011Ant Design+FastAPI \u9879\u76ee Linux \u670d\u52a1\u5668\u5185\u7f51\u90e8\u7f72\u5b8c\u6574\u7b14\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6838\u5fc3\u539f\u5219&#xff1a;\u524d\u7aef\u4ec5\u9700\u4e0a\u4f20\u6253\u5305\u540e\u7684dist\u6587\u4ef6\u5939&#xff0c;\u540e\u7aef\u4e0a\u4f20\u6e90\u7801 \/ \u4f9d\u8d56\u6587\u4ef6&#xff0c;\u5206\u522b\u542f\u52a8\u524d\u7aef\u9759\u6001\u670d\u52a1\u548c\u540e\u7aef FastAPI \u670d\u52a1&#xff0c;\u914d\u5408 Linux \u9632\u706b\u5899 \/ \u7aef\u53e3\u5f00\u653e&#xff0c;\u5b9e\u73b0\u5185\u7f51\u6240\u6709\u8bbe\u5907\u8bbf\u95ee\u3002\u5168\u7a0b\u9002\u914dCentOS\/Debian\/Ubuntu&#xff08;\u4e3b\u6d41 Linux \u53d1\u884c\u7248&#xff09;&#xff0c;\u6b65\u9aa4\u6e05\u6670\u53ef\u843d\u5730&#xff0c;\u517c\u987e\u7b80\u6613\u90e8\u7f72\u548c\u7a33\u5b9a\u8fd0\u884c\u3002 \u4e00\u3001\u524d\u671f\u51c6\u5907&#xff08;Linux \u670d\u52a1\u5668\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/71435.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-03T11:56:42+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/71435.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/71435.html\",\"name\":\"\u3010\u7b14\u8bb0\u3011Ant Design+FastAPI \u9879\u76ee Linux \u670d\u52a1\u5668\u5185\u7f51\u90e8\u7f72\u5b8c\u6574\u7b14\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-03T11:56:42+00:00\",\"dateModified\":\"2026-02-03T11:56:42+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/71435.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/71435.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/71435.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010\u7b14\u8bb0\u3011Ant Design+FastAPI \u9879\u76ee Linux \u670d\u52a1\u5668\u5185\u7f51\u90e8\u7f72\u5b8c\u6574\u7b14\u8bb0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010\u7b14\u8bb0\u3011Ant Design+FastAPI \u9879\u76ee Linux \u670d\u52a1\u5668\u5185\u7f51\u90e8\u7f72\u5b8c\u6574\u7b14\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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.wsisp.com\/helps\/71435.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010\u7b14\u8bb0\u3011Ant Design+FastAPI \u9879\u76ee Linux \u670d\u52a1\u5668\u5185\u7f51\u90e8\u7f72\u5b8c\u6574\u7b14\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6838\u5fc3\u539f\u5219&#xff1a;\u524d\u7aef\u4ec5\u9700\u4e0a\u4f20\u6253\u5305\u540e\u7684dist\u6587\u4ef6\u5939&#xff0c;\u540e\u7aef\u4e0a\u4f20\u6e90\u7801 \/ \u4f9d\u8d56\u6587\u4ef6&#xff0c;\u5206\u522b\u542f\u52a8\u524d\u7aef\u9759\u6001\u670d\u52a1\u548c\u540e\u7aef FastAPI \u670d\u52a1&#xff0c;\u914d\u5408 Linux \u9632\u706b\u5899 \/ \u7aef\u53e3\u5f00\u653e&#xff0c;\u5b9e\u73b0\u5185\u7f51\u6240\u6709\u8bbe\u5907\u8bbf\u95ee\u3002\u5168\u7a0b\u9002\u914dCentOS\/Debian\/Ubuntu&#xff08;\u4e3b\u6d41 Linux \u53d1\u884c\u7248&#xff09;&#xff0c;\u6b65\u9aa4\u6e05\u6670\u53ef\u843d\u5730&#xff0c;\u517c\u987e\u7b80\u6613\u90e8\u7f72\u548c\u7a33\u5b9a\u8fd0\u884c\u3002 \u4e00\u3001\u524d\u671f\u51c6\u5907&#xff08;Linux \u670d\u52a1\u5668","og_url":"https:\/\/www.wsisp.com\/helps\/71435.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-03T11:56:42+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/71435.html","url":"https:\/\/www.wsisp.com\/helps\/71435.html","name":"\u3010\u7b14\u8bb0\u3011Ant Design+FastAPI \u9879\u76ee Linux \u670d\u52a1\u5668\u5185\u7f51\u90e8\u7f72\u5b8c\u6574\u7b14\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-03T11:56:42+00:00","dateModified":"2026-02-03T11:56:42+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/71435.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/71435.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/71435.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010\u7b14\u8bb0\u3011Ant Design+FastAPI \u9879\u76ee Linux \u670d\u52a1\u5668\u5185\u7f51\u90e8\u7f72\u5b8c\u6574\u7b14\u8bb0"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/71435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=71435"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/71435\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=71435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=71435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=71435"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=71435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}