{"id":549151,"date":"2021-12-31T14:12:46","date_gmt":"2021-12-31T06:12:46","guid":{"rendered":"http:\/\/4563.org\/?p=549151"},"modified":"2021-12-31T14:12:46","modified_gmt":"2021-12-31T06:12:46","slug":"%e5%86%99%e4%ba%86%e4%b8%80%e4%b8%aa%e7%bd%91%e7%9b%98%e7%a8%8b%e5%ba%8f%ef%bc%8c%e4%bb%a3%e6%9b%bf-ys168","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=549151","title":{"rendered":"\u5199\u4e86\u4e00\u4e2a\u7f51\u76d8\u7a0b\u5e8f\uff0c\u4ee3\u66ff ys168"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>\u65e0\u795e\u901a<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u5199\u4e86\u4e00\u4e2a\u7f51\u76d8\u7a0b\u5e8f\uff0c\u4ee3\u66ff ys168<\/h3>\n<p>  \t\tys168 \u61c2\u7684\u90fd\u61c2\uff0c\u53ef\u60dc\u5e02\u9762\u4e0a\u6ca1\u6709\u627e\u5230\u5dee\u4e0d\u591a\u7684\u7f51\u76d8\u7a0b\u5e8f\uff0c\u81ea\u5df1\u7528 Python \u5199\u4e86\u4e2a\uff0c\u6f14\u793a\u5730\u5740\uff1a<\/p>\n<p>  \u7f51\u5740\uff1a141.94.115.2<\/p>\n<p>  \u5bc6\u7801\uff1apoiuytrewq<\/p>\n<p>  1C1G 50G \u786c\u76d8 50M \u7684\u5c0f\u6c34\u7ba1\u51d1\u5408\u7528\u4e0b\uff0c\u8fc7\u4e24\u5929\u5c31\u6539\u5bc6\u7801\u4e86\uff0c\u4ee5\u4e0b\u4e3a\u6e90\u7801\u53ca\u5b89\u88c5\u6307\u5357\u3002<\/p>\n<p>  \u5b89\u88c5\u8981\u6c42\uff1a<\/p>\n<p>  Python &gt;= 3.9\uff0c\u76ee\u524d\u4e3b\u6d41\u53d1\u884c\u7248\u5e94\u8be5\u53ea\u6709 Debian11 \u80fd\u6ee1\u8db3\u5427\uff0c\u66f4\u4f4e Python \u7248\u672c\u61d2\u5f97\u517c\u5bb9\u4e86\u3002<\/p>\n<p>  Nginx\uff0c\u7248\u672c\u6ca1\u6709\u7279\u522b\u8981\u6c42\uff0c\u4f46\u56e0\u4e3a\u7528\u5230\u4e86 X-Accel-Redirect\uff0c\u5fc5\u987b\u8981\u4f7f\u7528 Nginx\uff0c\u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\u81ea\u5df1\u517c\u5bb9\u5176\u4ed6\u7a0b\u5e8f\u3002<\/p>\n<p>  \u5b89\u88c5\u6b65\u9aa4\uff1a<\/p>\n<p>  \u4ee5\u4e0b\u5b89\u88c5\u6b65\u9aa4\u57fa\u4e8e Debian11 \u5168\u7a0b\u4f7f\u7528 Root \u7528\u6237\u3002<\/p>\n<p>  1. \u521b\u5efa\u6587\u4ef6\u5939\uff0c\u4e0b\u8f7d\u6e90\u7801\u6216\u8005\u590d\u5236\u7c98\u8d34\u5230 addfile.py \u6587\u4ef6\uff0c\u8fd9\u91cc\u76f4\u63a5\u4e0b\u8f7d<\/p>\n<p>  mkdir \/opt\/addfile<br \/>  cd \/opt\/addfile<br \/>  wget http:\/\/141.94.115.2\/addfile.py<\/p>\n<p>  2. \u7f16\u8f91 addfile.py\uff08\u53ef\u9009\u6b65\u9aa4\uff09<\/p>\n<p>  ROOT = Path(&#8216;\/home\/wwwroot\/default&#8217;)<br \/>  PASSWORD = &#8216;poiuytrewq&#8217;<\/p>\n<p>  \u5c06\u6587\u4ef6\u5f00\u5934\u8fd9\u4e24\u884c\u6362\u6210\u4f60\u81ea\u5df1\u60f3\u8981\u7684\u76ee\u5f55\u548c\u5bc6\u7801\u3002<\/p>\n<p>  3. \u5b89\u88c5\u4f9d\u8d56<\/p>\n<p>  apt install python3-pip<br \/>  pip3 install index.py jinja2 uvicorn gunicorn<\/p>\n<p>  4. \u521b\u5efa\u4e13\u7528\u7528\u6237\u548c\u7528\u6237\u7ec4<\/p>\n<p>  groupadd addfile<br \/>  useradd -s \/sbin\/nologin -M -g addfile addfile<\/p>\n<p>  \u4fee\u6539\u76ee\u5f55\u62e5\u6709\u8005\uff0c\u4e0d\u7136\u65e0**\u5e38\u8bfb\u5199\u6587\u4ef6\uff0c\u8bb0\u5f97\u5bf9\u5e94\u4f60\u4e0a\u9762\u7684\u7a0b\u5e8f\u548c\u6570\u636e\u76ee\u5f55\u3002<\/p>\n<p>  chown -R addfile:addfile \/opt\/addfile<br \/>  chown -R addfile:addfile \/home\/wwwroot\/default<\/p>\n<p>  5. \u521b\u5efa\u5e76\u5199\u5165 \/etc\/systemd\/system\/addfile.service<\/p>\n<p>  Description=addfile daemon<br \/>  After=network.target<\/p>\n<p>  Type=notify<br \/>  User=addfile<br \/>  Group=addfile<br \/>  RuntimeDirectory=addfile<br \/>  WorkingDirectory=\/opt\/addfile<br \/>  ExecStart=\/usr\/local\/bin\/gunicorn -k uvicorn.workers.UvicornWorker addfile:app<br \/>  ExecReload=\/bin\/kill -s HUP $MAINPID<br \/>  KillMode=mixed<br \/>  TimeoutStopSec=5<br \/>  PrivateTmp=true<\/p>\n<p>  WantedBy=multi-user.target<\/p>\n<p>  \u5199\u5165\u5b8c\u6bd5\u540e\u5c31\u53ef\u4ee5\u542f\u52a8\u4e86<\/p>\n<p>  systemctl start addfile<br \/>  systemctl enable addfile<\/p>\n<p>  6. \u914d\u7f6e Nginx \u6587\u4ef6<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;location \/<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;{<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_pass http:\/\/127.0.0.1:8000;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;}<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;location \/__x__\/<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;{<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;internal;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;alias \/home\/wwwroot\/default\/;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;}<\/p>\n<p>  \u5173\u952e\u7684\u5c31\u8fd9\u4e24\u884c\uff0c\u91cd\u8f7d\u914d\u7f6e\u5c31\u597d\u4e86<\/p>\n<p>  nginx -s reload\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>aipage<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u7ed1\u5b9a\uff0c\u8fd9\u662f\u5c0f\u9e21\u4e0a\u7684\u76d8\uff1f\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u65e0\u795e\u901a<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\taipage \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2021-12-30 20:08<br \/>  \u7ed1\u5b9a\uff0c\u8fd9\u662f\u5c0f\u9e21\u4e0a\u7684\u76d8\uff1f<\/p>\n<p> \u5c0f\u9e21\u4e0a\u7684\uff0c\u53ea\u80fd\u7528\u672c\u5730\u6587\u4ef6\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u4f60\u662f\u4e2a\u597d\u4eba<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t413 Request Entity Too Large<br \/>  nginx yc021t\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>aipage<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u54c8\u54c8\uff0c\u8d76\u7d27\u5173\u4e86\u3002\u4f60\u770bMJJ\u90fd\u4f20\u4e86\u5565\u4e0a\u53bb\u3002yc014t\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>AaronYYDS<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4e0d\u80fd\u653e\u6b4c\u66f2\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>gr58046576<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u80fd\u5b9e\u73b0\u8ddfys168\u4e00\u6837\u5417\uff1f\u65e0\u9650\u5f00\u5206\u76d8https:\/\/cdn.jsdelivr.net\/gh\/master-of-forums\/master-of-forums\/public\/images\/patch.gif\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u65e0\u795e\u901a<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4f60\u662f\u4e2a\u597d\u4eba \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2021-12-30 20:11<\/p>\n<p> nginx \u9650\u5236\u4e86 50M\uff0c\u8fd9\u4e2a\u81ea\u5df1\u90e8\u7f72\u7684\u65f6\u5019\u6539\u4e0b\u5c31\u884c\u4e86\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u5c0f\u4fbf\u8d85\u4eba<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6211\u767b\u5f55\u4e86\u600e\u4e48\u8fd8\u65e0\u6cd5\u4e0b\u8f7d\u3002\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>kylehao<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u80fd\u652f\u6301onedrive\u4e48\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65e0\u795e\u901a \u5927\u4f6c\u6709\u8bdd\u8bf4 : \u5199\u4e86\u4e00\u4e2a\u7f51&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/549151"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=549151"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/549151\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=549151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=549151"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=549151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}