{"id":154,"date":"2026-02-24T21:47:56","date_gmt":"2026-02-24T13:47:56","guid":{"rendered":"https:\/\/www.anutool.com\/?p=154"},"modified":"2026-02-24T21:47:56","modified_gmt":"2026-02-24T13:47:56","slug":"%e5%ae%a2%e6%88%b7%e7%ab%af%e5%bc%80%e8%b6%8a%e5%a4%9a%e7%bd%91%e9%a1%b5-1panel-%e5%90%8e%e5%8f%b0-apache2%e8%bf%9b%e7%a8%8b%e8%b6%8a%e5%a4%9a-%e5%8d%a0%e5%86%85%e5%ad%98","status":"publish","type":"post","link":"https:\/\/www.anutool.com\/index.php\/2026\/02\/24\/%e5%ae%a2%e6%88%b7%e7%ab%af%e5%bc%80%e8%b6%8a%e5%a4%9a%e7%bd%91%e9%a1%b5-1panel-%e5%90%8e%e5%8f%b0-apache2%e8%bf%9b%e7%a8%8b%e8%b6%8a%e5%a4%9a-%e5%8d%a0%e5%86%85%e5%ad%98\/","title":{"rendered":"\u5ba2\u6237\u7aef\u5f00\u8d8a\u591a\u7f51\u9875  1panel \u540e\u53f0 Apache2\u8fdb\u7a0b\u8d8a\u591a \u5360\u5185\u5b58"},"content":{"rendered":"<h3>\u7ed3\u8bba<\/h3>\n<div><\/div>\n<div>\u901a\u8fc7 <code>docker ps<\/code> \u8f93\u51fa\u786e\u8ba4\uff0c<strong>\u5185\u5b58\u5360\u7528\u8fc7\u9ad8\u7684 <code>apache2<\/code> \u8fdb\u7a0b\u6765\u81ea <code>wordpress:6.9.1<\/code> \u5bb9\u5668<\/strong>\u3002\u8be5\u5b98\u65b9\u955c\u50cf\u9ed8\u8ba4\u57fa\u4e8e <strong>Apache + PHP<\/strong> \u6784\u5efa\uff0c\u8fd9\u5c31\u662f\u4f60\u5f00\u7f51\u9875\u8d8a\u591a\u3001\u8fdb\u7a0b\u8d8a\u591a\u3001\u5185\u5b58\u8d8a\u6ee1\u7684\u6839\u672c\u539f\u56e0\u3002<\/div>\n<div><\/div>\n<h3>\u5173\u952e\u8bc1\u636e<\/h3>\n<div><\/div>\n<div>\n<div>\n<table>\n<thead>\n<tr>\n<th align=\"left\">\u5bb9\u5668\u4fe1\u606f<\/th>\n<th align=\"left\">\u6838\u5fc3\u7279\u5f81<\/th>\n<th align=\"left\">\u7ed3\u8bba<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\"><strong>\u955c\u50cf<\/strong><\/td>\n<td align=\"left\"><code>wordpress:6.9.1<\/code><\/td>\n<td align=\"left\">\u5b98\u65b9 WordPress \u955c\u50cf\uff08\u975e <code>-fpm<\/code> \u6807\u7b7e\uff09\u9ed8\u8ba4\u5185\u7f6e Apache \u670d\u52a1<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><strong>\u7aef\u53e3<\/strong><\/td>\n<td align=\"left\"><code>0.0.0.0:8080-&gt;80\/tcp<\/code><\/td>\n<td align=\"left\">\u5bb9\u5668\u5185 Apache \u5360\u7528 80 \u7aef\u53e3\uff0c\u5bbf\u4e3b\u673a\u6620\u5c04 8080 \u7aef\u53e3\u5bf9\u5916\u63d0\u4f9b\u670d\u52a1<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><strong>\u8fdb\u7a0b<\/strong><\/td>\n<td align=\"left\">\u5bb9\u5668\u5185\u8fd0\u884c <code>apache2<\/code><\/td>\n<td align=\"left\">\u4f60\u5728 <code>top<\/code> \u4e2d\u770b\u5230\u7684 <code>apache2<\/code> \u8fdb\u7a0b\u5747\u5c5e\u4e8e\u6b64\u5bb9\u5668\uff0c\u968f\u8bf7\u6c42\u6570\u751f\u6210\u5b50\u8fdb\u7a0b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<div><\/div>\n<h3>\u89e3\u51b3\u65b9\u6848\uff08\u6309\u4f18\u5148\u7ea7\uff0c\u4ece\u4e34\u65f6\u4f18\u5316\u5230\u5f7b\u5e95\u6839\u6cbb\uff09<\/h3>\n<div><\/div>\n<div>\u9488\u5bf9 2GB \u5185\u5b58\u670d\u52a1\u5668\uff0c\u63a8\u8350\u91c7\u7528 <strong>\u65b9\u6848\u4e09\uff08\u8fc1\u79fb\u91cd\u6784\uff09<\/strong>\uff0c\u8fd9\u662f\u6700\u9002\u914d 1Panel \u751f\u6001\u4e14\u6700\u7701\u5185\u5b58\u7684\u65b9\u5f0f\u3002<\/div>\n<div><\/div>\n<h4>\u65b9\u6848\u4e00\uff1a\u4e34\u65f6\u4f18\u5316\u5bb9\u5668\u5185 Apache\uff08\u5e94\u6025\u7f13\u89e3\uff09<\/h4>\n<div><\/div>\n<div>\u65e0\u9700\u91cd\u5efa\u5bb9\u5668\uff0c\u76f4\u63a5\u8fdb\u5165\u5bb9\u5668\u4fee\u6539\u914d\u7f6e\uff0c\u9650\u5236\u8fdb\u7a0b\u6570\u4ee5\u51cf\u5c11\u5185\u5b58\u5360\u7528\u3002<\/div>\n<div><\/div>\n<ol>\n<li><strong>\u8fdb\u5165 WordPress \u5bb9\u5668<\/strong>\n<div>\n<div dir=\"ltr\">\n<div>\n<div>\n<div tabindex=\"0\" aria-describedby=\"wbo5z4m\">\n<div>bash<\/div>\n<\/div>\n<div>\n<div>\u8fd0\u884c<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<pre><code>docker exec -it 1Panel-wordpress-yHZZ \/bin\/bash\r\n<\/code><\/pre>\n<\/div>\n<div>\n<div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li><strong>\u7f16\u8f91 Apache MPM \u914d\u7f6e\u6587\u4ef6<\/strong>\n<div>\n<div dir=\"ltr\">\n<div>\n<div>\n<div tabindex=\"0\" aria-describedby=\"hrqrxcg\">\n<div>bash<\/div>\n<div><\/div>\n<\/div>\n<div>\n<div>\u8fd0\u884c<\/div>\n<div tabindex=\"0\" aria-describedby=\"ppp2kdb\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<pre><code>vi \/etc\/apache2\/mods-available\/mpm_prefork.conf\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<\/li>\n<li><strong>\u4fee\u6539\u4e3a\u4ee5\u4e0b\u4f4e\u5185\u5b58\u914d\u7f6e<\/strong>\n<div>\n<div dir=\"ltr\">\n<div>\n<div>\n<div tabindex=\"0\" aria-describedby=\"6ru6462\">\n<div>apache<\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<pre><code>&lt;IfModule mpm_prefork_module&gt;\r\n    StartServers            2\r\n    MinSpareServers         1\r\n    MaxSpareServers         3\r\n    MaxRequestWorkers       8\r\n    MaxConnectionsPerChild  500\r\n&lt;\/IfModule&gt;\r\n<\/code><\/pre>\n<\/div>\n<div>\n<div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li><strong>\u91cd\u542f\u5bb9\u5668\u5185 Apache \u751f\u6548<\/strong>\n<div>\n<div dir=\"ltr\">\n<div>\n<div>\n<div tabindex=\"0\" aria-describedby=\"g70xasf\">\n<div>bash<\/div>\n<\/div>\n<div>\n<div>\u8fd0\u884c<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<pre><code>apache2ctl restart\r\nexit\r\n<\/code><\/pre>\n<\/div>\n<div>\n<div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<\/ol>\n<h4>\u65b9\u6848\u4e8c\uff1a\u4fee\u6539\u5bb9\u5668\u542f\u52a8\u53c2\u6570\uff08\u9650\u5236\u5bb9\u5668\u5185\u5b58\uff09<\/h4>\n<div><\/div>\n<div>\u901a\u8fc7 Docker \u9650\u5236\u8be5\u5bb9\u5668\u7684\u6700\u5927\u5185\u5b58\u4f7f\u7528\uff0c\u9632\u6b62\u5176\u8017\u5c3d\u5bbf\u4e3b\u673a\u5185\u5b58\u3002<\/div>\n<div><\/div>\n<ol>\n<li><strong>\u505c\u6b62\u5bb9\u5668<\/strong>\n<div>\n<div dir=\"ltr\">\n<div>\n<div>\n<div tabindex=\"0\" aria-describedby=\"3bzrlym\">\n<div>bash<\/div>\n<div><\/div>\n<\/div>\n<div>\n<div>\u8fd0\u884c<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<pre><code>docker stop 1Panel-wordpress-yHZZ\r\n<\/code><\/pre>\n<\/div>\n<div>\n<div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li><strong>\u4fee\u6539\u5bb9\u5668\u914d\u7f6e\uff0c\u9650\u5236\u5185\u5b58\u4e3a 512MB<\/strong>\n<div>\n<div dir=\"ltr\">\n<div>\n<div>\n<div tabindex=\"0\" aria-describedby=\"kpdng5d\">\n<div>bash<\/div>\n<div><\/div>\n<\/div>\n<div>\n<div>\u8fd0\u884c<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<pre><code>docker update --memory 512m --memory-swap 768m 1Panel-wordpress-yHZZ\r\n<\/code><\/pre>\n<\/div>\n<div>\n<div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li><strong>\u542f\u52a8\u5bb9\u5668<\/strong>\n<div>\n<div dir=\"ltr\">\n<div>\n<div>\n<div tabindex=\"0\" aria-describedby=\"i2lwmdt\">\n<div>bash<\/div>\n<div><\/div>\n<\/div>\n<div>\n<div>\u8fd0\u884c<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<pre><code>docker start 1Panel-wordpress-yHZZ\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<\/ol>\n<h4>\u65b9\u6848\u4e09\uff1a\u8fc1\u79fb\u81f3 1Panel \u539f\u751f\u7ad9\u70b9\uff08\u5f7b\u5e95\u6839\u6cbb\uff0c\u63a8\u8350\uff09<\/h4>\n<div><\/div>\n<div>\u5229\u7528 1Panel \u5df2\u6709\u7684 <code>OpenResty + PHP-FPM<\/code> \u73af\u5883\uff0c\u91cd\u5efa WordPress \u7ad9\u70b9\uff0c\u5f7b\u5e95\u629b\u5f03 Apache \u5bb9\u5668\uff0c\u5185\u5b58\u5360\u7528\u53ef\u964d\u4f4e 50% \u4ee5\u4e0a\u3002<\/div>\n<div><\/div>\n<ol>\n<li><strong>\u5907\u4efd\u73b0\u6709 WordPress \u6570\u636e<\/strong>\n<div>\n<div dir=\"ltr\">\n<div>\n<div>\n<div tabindex=\"0\" aria-describedby=\"0grfwbl\">\n<div>bash<\/div>\n<div><\/div>\n<\/div>\n<div>\n<div>\u8fd0\u884c<\/div>\n<div tabindex=\"0\" aria-describedby=\"35zw5c9\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<pre><code># \u5907\u4efd\u7f51\u7ad9\u6587\u4ef6\r\ndocker cp 1Panel-wordpress-yHZZ:\/var\/www\/html \/root\/wordpress-backup\r\n# \u5907\u4efd\u6570\u636e\u5e93\uff08\u4f7f\u7528\u5bb9\u5668\u5185\u7684 MySQL \u4fe1\u606f\uff09\r\nmysqldump -u root -p -h 127.0.0.1 -P 3306 wordpress &gt; \/root\/wordpress-db.sql\r\n<\/code><\/pre>\n<\/div>\n<div>\n<div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li><strong>\u5728 1Panel \u65b0\u5efa\u7ad9\u70b9<\/strong>\n<ul>\n<li>\u8fdb\u5165 1Panel \u2192 <strong>\u7f51\u7ad9<\/strong> \u2192 <strong>\u521b\u5efa\u7f51\u7ad9<\/strong>\u3002<\/li>\n<li><strong>\u8fd0\u884c\u73af\u5883<\/strong>\u9009\u62e9\uff1a<code>OpenResty + PHP-FPM<\/code>\uff08\u5339\u914d\u5df2\u5b89\u88c5\u7684 <code>1panel-php-fpm:8.4.13<\/code>\uff09\u3002<\/li>\n<li>\u6570\u636e\u5e93\u9009\u62e9\u5df2\u6709\u7684 <code>mysql:8.4.8<\/code>\uff0c\u521b\u5efa\u5bf9\u5e94\u6570\u636e\u5e93\u3002<\/li>\n<\/ul>\n<div><\/div>\n<\/li>\n<li><strong>\u6062\u590d\u6570\u636e<\/strong>\n<ul>\n<li>\u5c06 <code>\/root\/wordpress-backup<\/code> \u5185\u7684\u6587\u4ef6\u4e0a\u4f20\u81f3\u65b0\u7ad9\u70b9\u7684\u7f51\u7ad9\u6839\u76ee\u5f55\u3002<\/li>\n<li>\u5bfc\u5165 <code>\/root\/wordpress-db.sql<\/code> \u81f3\u65b0\u5efa\u7684\u6570\u636e\u5e93\u3002<\/li>\n<\/ul>\n<div><\/div>\n<\/li>\n<li><strong>\u505c\u6b62\u5e76\u5220\u9664\u65e7 WordPress \u5bb9\u5668<\/strong>\n<div>\n<div dir=\"ltr\">\n<div>\n<div>\n<div tabindex=\"0\" aria-describedby=\"lbnfkjb\">\n<div>bash<\/div>\n<div><\/div>\n<\/div>\n<div>\n<div>\u8fd0\u884c<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<pre><code>docker stop 1Panel-wordpress-yHZZ\r\ndocker rm 1Panel-wordpress-yHZZ\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<\/li>\n<li><strong>\u4fee\u6539\u57df\u540d\u89e3\u6790<\/strong>\n<ul>\n<li>\u82e5\u539f\u7ad9\u70b9\u901a\u8fc7 8080 \u7aef\u53e3\u8bbf\u95ee\uff0c\u9700\u5c06\u65b0\u7ad9\u70b9\u7aef\u53e3\u6539\u4e3a 80\uff0c\u6216\u5728 1Panel \u4e2d\u914d\u7f6e\u53cd\u5411\u4ee3\u7406\uff0c\u5b9e\u73b0\u901a\u8fc7\u57df\u540d\u76f4\u63a5\u8bbf\u95ee\u3002<\/li>\n<\/ul>\n<div><\/div>\n<\/li>\n<\/ol>\n<h3>\u9a8c\u8bc1\u6548\u679c<\/h3>\n<div><\/div>\n<div>\u6267\u884c\u4f18\u5316 \/ \u8fc1\u79fb\u540e\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u786e\u8ba4\uff1a<\/div>\n<div><\/div>\n<div>\n<div dir=\"ltr\">\n<div>\n<div>\n<div tabindex=\"0\" aria-describedby=\"dohiuaw\">\n<div>bash<\/div>\n<div><\/div>\n<\/div>\n<div>\n<div>\u8fd0\u884c<\/div>\n<div tabindex=\"0\" aria-describedby=\"rb6922u\"><\/div>\n<div tabindex=\"0\" aria-describedby=\"5p948i8\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<pre><code># \u67e5\u770b apache2 \u8fdb\u7a0b\u662f\u5426\u6d88\u5931\uff08\u65b9\u6848\u4e09\uff09\u6216\u6570\u91cf\u51cf\u5c11\uff08\u65b9\u6848\u4e00\/\u4e8c\uff09\r\ntop -o %MEM | grep apache2\r\n# \u67e5\u770b\u5185\u5b58\u6574\u4f53\u4f7f\u7528\u60c5\u51b5\r\nfree -h<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u7ed3\u8bba \u901a\u8fc7 docker ps \u8f93\u51fa\u786e\u8ba4\uff0c\u5185\u5b58\u5360\u7528\u8fc7\u9ad8\u7684 apache2 \u8fdb\u7a0b\u6765\u81ea wordpress:6.9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":["post-154","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/posts\/154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/comments?post=154"}],"version-history":[{"count":1,"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/posts\/154\/revisions"}],"predecessor-version":[{"id":155,"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/posts\/154\/revisions\/155"}],"wp:attachment":[{"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/media?parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/categories?post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/tags?post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}