{"id":25924,"date":"2025-07-05T00:01:40","date_gmt":"2025-07-04T17:01:40","guid":{"rendered":"https:\/\/dps.media\/xu-ly-tinh-trang-day-dia-tmp-trong-cyberpanel\/"},"modified":"2025-07-05T00:01:41","modified_gmt":"2025-07-04T17:01:41","slug":"%e5%a4%84%e7%90%86-cyberpanel-%e4%b8%ad%e7%9a%84%e4%b8%b4%e6%97%b6%e7%a3%81%e7%9b%98%e6%bb%a1%e6%83%85%e5%86%b5","status":"publish","type":"post","link":"https:\/\/dps.media\/zh\/%e5%a4%84%e7%90%86-cyberpanel-%e4%b8%ad%e7%9a%84%e4%b8%b4%e6%97%b6%e7%a3%81%e7%9b%98%e6%bb%a1%e6%83%85%e5%86%b5\/","title":{"rendered":"CyberPanel\u4e2d\u5904\u7406\/tmp\/\u78c1\u76d8\u5df2\u6ee1\u7684\u60c5\u51b5"},"content":{"rendered":"<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cOpenLiteSpeed\u4f7f\u7528\/tmp\/lshttpd\/swap\u76ee\u5f55\u6765\u5b58\u50a8\u4e34\u65f6\u6587\u4ef6\u3002\u5982\u679c\u60a8\u7684\/tmp\u5206\u533a\u7a7a\u95f4\u8f83\u5c0f\uff0c\u78c1\u76d8\u53ef\u80fd\u4f1a\u88ab\u5360\u6ee1\uff0c\u5bfc\u81f4\u6574\u4e2aVPS\u51fa\u73b0\u9519\u8bef\u3002<\/p><p>\u4ee5\u4e0b\u662f\u8fc1\u79fbOpenLiteSpeed Swapping\u76ee\u5f55\u7684\u6b65\u9aa4\u6458\u8981\u3002.<\/p><h3>\u4e3aOpenLiteSpeed\u7684Swapping Directory\u521b\u5efa\u65b0\u76ee\u5f55\uff1a<\/h3><p>\u521b\u5efa\u76ee\u5f55\uff1a<\/p><pre data-no-translation=\"\">[bash]mkdir -p \/lswstmp\/lshttpd\/swap[\/bash]<\/pre><p><br>\n\u8bbe\u7f6e\u6743\u9650\uff1a<\/p><pre data-no-translation=\"\">[bash]chmod 750 \/lswstmp\/lshttpd[\/bash]<\/pre><p>\u00a0<\/p><pre data-no-translation=\"\">[bash]chmod 700 \/lswstmp\/lshttpd\/swap[\/bash]<\/pre><p><br>\n\u5206\u914d\u6240\u6709\u6743\uff1a<\/p><pre data-no-translation=\"\">[bash]chown -R nobody:nogroup \/lswstmp\/lshttpd[\/bash]<\/pre><p><br>\n\u8bbf\u95eeOpenLiteSpeed\u7ba1\u7406\u754c\u9762\uff1a<\/p><p>\u5730\u5740\uff1a<\/p><pre data-no-translation=\"\">[bash]https:\/\/your-server-ip:7080\/login.php[\/bash]<\/pre><p><br>\n\u5982\u679c\u8fd8\u6ca1\u6709\u8d26\u53f7\uff0c\u8bf7\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u91cd\u7f6e\u5bc6\u7801\uff1a<\/p><pre data-no-translation=\"\">[bash]\/usr\/local\/lsws\/admin\/misc\/admpass.sh[\/bash]<\/pre><p><br>\n\u767b\u5f55\u540e\uff0c\u8fdb\u5165\u670d\u52a1\u5668\u914d\u7f6e\u90e8\u5206\uff1a<\/p><p><strong>\u670d\u52a1\u5668\u914d\u7f6e &gt; \u5e38\u89c4<\/strong><br>\n\u5728\u90e8\u5206 <strong>\u670d\u52a1\u5668\u8fdb\u7a0b<\/strong>, \u66f4\u6539\u5176\u503c\u4e3a\u00a0<strong>\u4ea4\u6362\u76ee\u5f55<\/strong><\/p><p>\u4ece\u9ed8\u8ba4\u503c<\/p><pre data-no-translation=\"\">[bash]\/tmp\/lshttpd\/swap[\/bash]<\/pre><p>\u4e3a<\/p><pre data-no-translation=\"\">[bash]\/lswstmp\/lshttpd\/swap[\/bash]<\/pre><p><a href=\"https:\/\/dps.media\/wp-content\/uploads\/2025\/07\/chrome_2qTIwvzVEf.png\" aria-label=\"Dps\u5a92\u4f53\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7428\" src=\"https:\/\/dps.media\/wp-content\/uploads\/2025\/07\/chrome_2qTIwvzVEf.png\" alt=\"\" width=\"1098\" height=\"507\" title=\"\"><\/a><br>\n\u91cd\u542f OpenLiteSpeed\uff1a<\/p><p>\u4f7f\u7528\u7f51\u9875\u754c\u9762\u6216 SSH \u547d\u4ee4\uff1a<\/p><pre data-no-translation=\"\">[bash] systemctl restart lsws[\/bash]<\/pre><p><br>\n\u8fd9\u4e9b\u6b65\u9aa4\u5e2e\u52a9\u60a8\u5c06 OpenLiteSpeed \u7684\u4e34\u65f6\u76ee\u5f55\u79fb\u52a8\u5230\u7a7a\u95f4\u66f4\u5927\u7684\u5206\u533a\uff0c\u907f\u514d\u7531\u4e8e \/tmp \u5206\u533a\u8f83\u5c0f\u5bfc\u81f4\u78c1\u76d8\u6ee1\u3002.<\/p><h3><br>\n\u5982\u679c\u60a8\u60f3\u5229\u7528RAM\u521b\u5efa\u4e00\u4e2a\u901f\u5ea6\u66f4\u5feb\u7684\u4e34\u65f6\uff08tmp\uff09\u78c1\u76d8\uff0c\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/h3><p>\u521b\u5efa Ramdisk \u76ee\u5f55\uff0c\u4f7f\u7528\u547d\u4ee4\uff1a<\/p><pre data-no-translation=\"\">[bash]sudo mkdir -p \/mnt\/ramdisk[\/bash]<\/pre><p><br>\n\u6302\u8f7d 1GB \u5927\u5c0f\u7684 ramdisk\uff1a<\/p><pre data-no-translation=\"\">[bash]sudo mount -t tmpfs -o size=1G tmpfs \/mnt\/ramdisk[\/bash]<\/pre><p><br>\n\u6b64\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u4e34\u65f6\u7684 1GB ramdisk\u3002.<br>\n\u914d\u7f6e Ramdisk \u5f00\u673a\u81ea\u52a8\u6302\u8f7d\uff1a<\/p><p>\u5c06\u914d\u7f6e\u6dfb\u52a0\u5230 \/etc\/fstab\uff0c\u4f7f ramdisk \u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u6302\u8f7d\u3002.<br>\n\u4f7f\u7528\u547d\u4ee4\uff1a<\/p><pre data-no-translation=\"\">[bash]echo 'tmpfs \/mnt\/ramdisk tmpfs nodev,nosuid,noexec,nodiratime,size=1G 0 0' | sudo tee -a \/etc\/fstab[\/bash]<\/pre><p><br>\n\u6b64\u884c\u5c06\u88ab\u6dfb\u52a0\u5230 \/etc\/fstab \u6587\u4ef6\u4e2d\uff0c\u5141\u8bb8\u7cfb\u7edf\u6839\u636e\u6307\u5b9a\u7684\u9009\u9879\u81ea\u52a8\u521b\u5efa\u5e76\u6302\u8f7d ramdisk\u3002.<\/p><p>\u9009\u62e9\uff1a<\/p><p><strong>\u670d\u52a1\u5668\u914d\u7f6e &gt; \u5e38\u89c4<\/strong><br>\n\u5728\u90e8\u5206 <strong>\u670d\u52a1\u5668\u8fdb\u7a0b<\/strong>, \u66f4\u6539\u5176\u503c\u4e3a\u00a0<strong>\u4ea4\u6362\u76ee\u5f55<\/strong><\/p><p>\u4ece\u9ed8\u8ba4\u503c<\/p><pre data-no-translation=\"\">[bash]\/tmp\/lshttpd\/swap[\/bash]<\/pre><p>\u4e3a<\/p><pre data-no-translation=\"\">[bash]\/mnt\/ramdisk[\/bash]<\/pre><p><a href=\"https:\/\/dps.media\/wp-content\/uploads\/2025\/07\/chrome_x7UhepAI5A.png\" aria-label=\"Dps\u5a92\u4f53\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7430\" src=\"https:\/\/dps.media\/wp-content\/uploads\/2025\/07\/chrome_x7UhepAI5A.png\" alt=\"\" width=\"1092\" height=\"509\" title=\"\"><\/a><br>\n\u91cd\u542f OpenLiteSpeed\uff1a<\/p><p>\u4f7f\u7528\u7f51\u9875\u754c\u9762\u6216 SSH \u547d\u4ee4\uff1a<\/p><pre data-no-translation=\"\">[bash] systemctl restart lsws[\/bash]<\/pre><p>\u4e0a\u8ff0\u6b65\u9aa4\u5c06\u5e2e\u52a9\u60a8\u5728 RAM \u4e0a\u521b\u5efa\u4e00\u4e2a\u4e34\u65f6\u78c1\u76d8\uff08temporary disk\uff09\uff0c\u7531\u4e8e RAM \u7684\u901f\u5ea6\u8fdc\u9ad8\u4e8e\u4f20\u7edf\u786c\u76d8\uff0c\u53ef\u52a0\u5feb\u4e34\u65f6\u6570\u636e\u5904\u7406\u901f\u5ea6\u3002\u8fd9\u5bf9\u4e8e\u9700\u8981\u5feb\u901f\u6570\u636e\u5904\u7406\u7684\u5e94\u7528\u7a0b\u5e8f\uff08\u5982 Web \u670d\u52a1\u6216\u6570\u636e\u5e93\u5e94\u7528\uff09\u5c24\u5176\u6709\u7528\u3002\u4f46\u8bf7\u6ce8\u610f\uff0cRAM \u4e0a\u7684\u6570\u636e\u5728\u7cfb\u7edf\u5173\u95ed\u6216\u91cd\u542f\u65f6\u4f1a\u4e22\u5931\uff0c\u56e0\u6b64\u4ec5\u9002\u7528\u4e8e\u4e34\u65f6\u6587\u4ef6\u3002.<\/p><h3><br>\n\u8981\u6dfb\u52a0\u4e00\u4e2a\u6bcf\u5929\u51cc\u66683\u70b9\u6e05\u7406\u4e34\u65f6\u78c1\u76d8\u7684cronjob\uff0c\u60a8\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/h3><p>\u521b\u5efa\u4e00\u4e2a\u811a\u672c\u6587\u4ef6\uff08logscleaner.sh\uff09\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p><pre data-no-translation=\"\">[bash]nano logscleaner.sh[\/bash]<\/pre><p>\u5982\u679c\u4f7f\u7528\u786c\u76d8\uff0c\u8bf7\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a<\/p><pre data-no-translation=\"\">[bash]find \/lswstmp\/lshttpd\/swap -type f -delete[\/bash]<\/pre><p><br>\n\u5982\u679c\u4f7f\u7528 RAM\uff0c\u8bf7\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a<\/p><pre data-no-translation=\"\">[bash]find \/mnt\/ramdisk\/ -type f -delete[\/bash]<\/pre><p><br>\n\u8d4b\u4e88\u811a\u672c\u6267\u884c\u6743\u9650\uff1a<\/p><pre data-no-translation=\"\">[bash]chmod +x logscleaner.sh[\/bash]<\/pre><p><br>\n\u5c1d\u8bd5\u8fd0\u884c\u811a\u672c\u4ee5\u68c0\u67e5\uff1a<\/p><pre data-no-translation=\"\">[bash]sh logscleaner.sh[\/bash]<\/pre><p><br>\n\u5c06 cronjob \u6dfb\u52a0\u5230 crontab\uff1a<\/p><pre data-no-translation=\"\">[bash]crontab -e[\/bash]<\/pre><p>\u00a0<\/p><pre data-no-translation=\"\">[bash]0 3 * * * sh \/root\/logscleaner.sh[\/bash]<\/pre><p><br>\n\u8be5\u811a\u672c\u5c06\u6bcf\u5929\u51cc\u6668 3 \u70b9\u81ea\u52a8\u8fd0\u884c\uff0c\u6e05\u7406\u4e34\u65f6\u78c1\u76d8\u4e2d\u7684\u4e34\u65f6\u6587\u4ef6\uff0c\u5e2e\u52a9\u51cf\u5c11\u78c1\u76d8\u7a7a\u95f4\u5360\u7528\u3002.<\/p><div data-zone-id=\"0\" data-line-index=\"0\" data-line=\"true\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Theo m\u1eb7c \u0111\u1ecbnh, OpenLiteSpeed s\u1eed d\u1ee5ng th\u01b0 m\u1ee5c \/tmp\/lshttpd\/swap \u0111\u1ec3 l\u01b0u tr\u1eef c\u00e1c t\u1eadp tin t\u1ea1m th\u1eddi. N\u1ebfu ph\u00e2n v\u00f9ng \/tmp c\u1ee7a b\u1ea1n c\u00f3 dung l\u01b0\u1ee3ng nh\u1ecf, \u0111\u0129a c\u00f3 th\u1ec3 b\u1ecb \u0111\u1ea7y, g\u00e2y ra l\u1ed7i to\u00e0n b\u1ed9 VPSD\u01b0\u1edbi \u0111\u00e2y l\u00e0 t\u00f3m t\u1eaft c\u00e1c b\u01b0\u1edbc di chuy\u1ec3n th\u01b0 m\u1ee5c Swapping c\u1ee7a OpenLiteSpeed.T\u1ea1o th\u01b0 m\u1ee5c m\u1edbi cho [&hellip;]<\/p>","protected":false},"author":1,"featured_media":25925,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-25924","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"acf":[],"rankmath_keywords":{"primary":"","secondary":[""]},"yoast_keywords":{"primary":"","secondary":[]},"yoast_focuskw":"","rankmath_focuskw":"","seo_keywords":{"primary":"","secondary":[""]},"_links":{"self":[{"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/posts\/25924","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/comments?post=25924"}],"version-history":[{"count":0,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/posts\/25924\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/media\/25925"}],"wp:attachment":[{"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/media?parent=25924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/categories?post=25924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/tags?post=25924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}