{"id":26876,"date":"2024-02-24T21:25:06","date_gmt":"2024-01-11T14:22:05","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84wordpress%e8%bf%81%e7%a7%bb%e8%87%b3aws-lightsail%e3%80%82\/"},"modified":"2025-08-11T23:33:50","modified_gmt":"2025-08-11T15:33:50","slug":"%e5%b0%86%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84wordpress%e8%bf%81%e7%a7%bb%e8%87%b3aws-lightsail%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84wordpress%e8%bf%81%e7%a7%bb%e8%87%b3aws-lightsail%e3%80%82\/","title":{"rendered":"\u5c06\u6b63\u5728\u8fd0\u884c\u7684WordPress\u8fc1\u79fb\u81f3AWS Lightsail"},"content":{"rendered":"<h2>\u9996\u5148<\/h2>\n<p>\u6211\u628a\u516c\u53f8\u8fd0\u8425\u7684WordPress\u7f51\u7ad9\u8fc1\u79fb\u5230\u4e86Lightsail\uff0c\u73b0\u5728\u5c06\u5176\u4f5c\u4e3a\u5907\u5fd8\u5f55\u8bb0\u5f55\u4e0b\u6765\u3002<\/p>\n<p>\u5728WordPress\u7f51\u7ad9\u670d\u52a1\u5668\u8fc1\u79fb\u65b9\u9762\uff0c\u6709\u4f7f\u7528\u63d2\u4ef6\u7684\u65b9\u6cd5\uff0c\u4f46\u7531\u4e8e\u5176\u64cd\u4f5c\u65b9\u5f0f\u5e38\u5e38\u662f\u9ed1\u76d2\u5b50\uff0c\u56e0\u6b64\u6211\u4eec\u9009\u62e9\u624b\u52a8\u8fdb\u884c\u670d\u52a1\u5668\u8fc1\u79fb\u3002<br \/>\n\u6211\u4eec\u4fdd\u6301\u6b63\u5728\u8fd0\u884c\u7684WordPress\u4e0d\u53d8\uff0c\u5728Lightsail\u4e0a\u590d\u5236\u540c\u6837\u7684WordPress\uff0c\u6700\u540e\u5c06\u57df\u540d\u91cd\u5b9a\u5411\u5230Lightsail\uff0c\u8fd9\u6837\u5b8c\u6210\u6574\u4e2a\u8fc7\u7a0b\u3002<\/p>\n<h2>\u4f7f\u7528Lightsail\u521b\u5efaWordPress<\/h2>\n<div>\n                            <img decoding=\"async\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657c2773d0c9c81e0f5d0e7c\/4-0.png\" class='post-images' alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2020-11-16 14.58.01.png\" title=\"\">\n                        <\/div>\n<p>\u5f53\u5b9e\u4f8b\u542f\u52a8\u65f6\uff0c\u521b\u5efa\u9759\u6001IP\u5e76\u5c06\u5176\u7ed1\u5b9a\u5230\u5df2\u542f\u52a8\u7684\u5b9e\u4f8b\u4e0a\u3002<br \/>\n\u5982\u679c\u5728\u7f51\u7edc\u4e0a\u641c\u7d22\uff0c\u5c06\u4f1a\u51fa\u73b0\u8bb8\u591a\u5e26\u6709\u56fe\u50cf\u89e3\u91ca\u7684\u7f51\u7ad9\uff0c\u8be6\u7ec6\u8bf4\u660e\u4e86\u8fd9\u4e2a\u8fc7\u7a0b\u3002<\/p>\n<p>\u5982\u679c\u4ece\u6d4f\u89c8\u5668\u8bbf\u95eeIP\u540e\u80fd\u591f\u663e\u793aWordPress\u7684\u521d\u59cb\u754c\u9762\uff0c\u5c31\u662f\u6b63\u5e38\u7684\u3002<\/p>\n<h4>\u5728\u8fdb\u884c\u8fc1\u79fb\u4e4b\u524d\uff0c\u5c06WordPress\u7248\u672c\u8fdb\u884c\u8c03\u6574\u3002<\/h4>\n<p>Lightsail\u7684WordPress\u65e0\u6cd5\u9009\u62e9\u7248\u672c\uff08\u5199\u8fd9\u7bc7\u6587\u7ae0\u65f6\u7684\u7248\u672c\u4e3a5.4.2\u56fa\u5b9a\uff09\u3002<br \/>\n\u5982\u679c\u8981\u8fc1\u79fb\u7684WordPress\u7248\u672c\u8f83\u65e7\uff0c\u5219\u6700\u597d\u63d0\u524d\u5347\u7ea7\u5e76\u63a5\u8fd1\u5f53\u524d\u7248\u672c\u4ee5\u786e\u4fdd\u7a33\u5b9a\u6027\u3002<br \/>\n\u7136\u800c\uff0c\u7531\u4e8e\u7279\u6b8a\u539f\u56e0\uff0c\u6211\u65e0\u6cd5\u5728\u6211\u7684\u73af\u5883\u4e2d\u8fdb\u884c\u5347\u7ea7\uff0c\u56e0\u6b64\u6211\u76f4\u63a5\u5c064.7.3\u7248\u672c\u7684WordPress\u8fc1\u79fb\u8fc7\u6765\uff0c\u4f46\u5e76\u6ca1\u6709\u51fa\u73b0\u4efb\u4f55\u95ee\u9898\u3002<\/p>\n<h2>\u5c06WordPress\u6838\u5fc3\u8fdb\u884c\u8fc1\u79fb<\/h2>\n<p>\u5c3d\u7ba1WordPress\u672c\u8eab\u5305\u542b\u7740\u8bb8\u591a\u6587\u4ef6\uff0c\u6211\u4eec\u53ea\u9700\u8981\u4f7f\u7528\u65b0\u5efa\u7684WordPress\u7684\u6838\u5fc3\u6587\u4ef6\uff0c\u7136\u540e\u5c06\u63d2\u4ef6\u548c\u4e3b\u9898\u6587\u4ef6\u5939\uff08\u5373wp-content\u76ee\u5f55\uff09\u4ece\u65e7\u7684WordPress\u4e2d\u8fc1\u79fb\u8fc7\u6765\u3002<\/p>\n<p>\u7528SSH\u767b\u5f55\u5230Lightsail\u5e76\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\"># \u65e7WordPress\u3092Lightsail\u306e\u4e2d\u306b\u6301\u3063\u3066\u304f\u308b<\/span>\r\ngit clone git@github.com:best-teacher-production\/myapp.git\r\n<span class=\"c\"># Lightsail\u306eWordpress\u672c\u4f53\u304c\u914d\u7f6e\u3055\u308c\u3066\u3044\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5<\/span>\r\n<span class=\"nb\">cd<\/span> \/home\/bitnami\/apps\/wordpress\/htdocs\r\n<span class=\"c\"># \u65b0WordPress\u306ewp-content\u3092\u30ea\u30cd\u30fc\u30e0\u3057\u3066<\/span>\r\n<span class=\"nb\">mv <\/span>wp-content\/ wp-content.original\r\n<span class=\"c\"># \u65e7WordPress\u306ewp-content\u306e\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u3092\u8cbc\u308b<\/span>\r\n<span class=\"nb\">ln<\/span> <span class=\"nt\">-s<\/span> \/home\/bitnami\/myapp\/wp-content\r\n<\/code><\/pre>\n<p>\u7531\u4e8e\u6211\u7684WordPress\u7f51\u7ad9\u662f\u4f7f\u7528git\u8fdb\u884c\u7ba1\u7406\uff0c\u6240\u4ee5\u6211\u9700\u8981\u505a\u4e00\u4e9b\u9ebb\u70e6\u7684\u5de5\u4f5c\u3002\u4f46\u662f\uff0c\u5982\u679c\u4e0d\u9700\u8981\u4f7f\u7528git\u8fdb\u884c\u7ba1\u7406\uff0c\u53ea\u9700\u8981\u7b80\u5355\u5730\u5c06\/home\/bitnami\/apps\/wordpress\/htdocs\/wp-content\/\u66ff\u6362\u4e3a\u65e7\u7684WordPress\u7684wp-content\u5373\u53ef\uff0c\u6ca1\u6709\u4efb\u4f55\u95ee\u9898\u3002<\/p>\n<h2>\u4fee\u6539wp-config.php<\/h2>\n<p>Lightsail\u7684wp-config.php\u6587\u4ef6\u4f4d\u4e8e\/home\/bitnami\/apps\/wordpress\/htdocs\/wp-config.php\u4e2d\u3002<\/p>\n<p>\u9ed8\u8ba4\u8bbe\u7f6e\u60c5\u51b5\u4e0b\uff0c\u7f51\u7ad9\u5185\u7684\u94fe\u63a5\u5730\u5740\u5c06\u4f1a\u53d8\u4e3aIP\u5730\u5740\uff0c\u4e3a\u4e86\u5c06\u5176\u53d8\u4e3a\u57df\u540d\uff0c\u8bf7\u8fdb\u884c\u4ee5\u4e0b\u4fee\u6b63\u64cd\u4f5c\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"gd\">- define('WP_SITEURL', 'http:\/\/' . $_SERVER['HTTP_HOST'] . '\/');\r\n- define('WP_HOME', 'http:\/\/' . $_SERVER['HTTP_HOST'] . '\/');\r\n<\/span><span class=\"gi\">+ define('WP_SITEURL', 'https:\/\/\u81ea\u5206\u306e\u30c9\u30e1\u30a4\u30f3\u540d');\r\n+ define('WP_HOME', 'https:\/\/\u81ea\u5206\u306e\u30c9\u30e1\u30a4\u30f3\u540d');\r\n<\/span><\/code><\/pre>\n<p>\u6b64\u5916\uff0c\u5982\u679c\u5728wp-config.php\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e86\u81ea\u5b9a\u4e49\u8bbe\u7f6e\uff08\u5982\u81ea\u5b9a\u4e49\u5e38\u91cf\u7b49\uff09\uff0c\u5c06\u628a\u8fd9\u4e9b\u8bbe\u7f6e\u8fc1\u79fb\u5230\u65b0\u7684wp-config.php\u6587\u4ef6\u4e2d\u3002<\/p>\n<p>\u4e00\u65e6\u4fee\u6539\u8bbe\u7f6e\u540e\uff0c\u9700\u8981\u91cd\u65b0\u542f\u52a8Apache\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nb\">sudo<\/span> \/opt\/bitnami\/ctlscript.sh restart apache\r\n<\/code><\/pre>\n<h2>\u5c06DB\u6570\u636e\u5e93\u8fc1\u79fb<\/h2>\n<p>\u5c06DB\u6570\u636e\u5b8c\u5168\u5907\u4efd\u4e3amysqldump\u6587\u4ef6\uff0c\u5c06\u65e7WordPress\u7684MySQL\u6570\u636e\u6062\u590d\u5230\u65b0\u7684WordPress\u7684MySQL\u4e2d\u3002<\/p>\n<p>\u5c06\u5907\u4efd\u6587\u4ef6backup.sql\u79fb\u52a8\u5230Lightsail\uff0c\u5e76\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\"># \u30e6\u30fc\u30b6\u30fc\u540d\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\/apps\/wordpress\/htdocs\/wp-config.php\u3067\u78ba\u8a8d\u53ef<\/span>\r\nmysql <span class=\"nt\">-u<\/span> \u30e6\u30fc\u30b6\u30fc\u540d <span class=\"nt\">-p<\/span>\u30d1\u30b9\u30ef\u30fc\u30c9 bitnami_wordpress &lt; backup.sql\r\n<\/code><\/pre>\n<p>\u56e0\u4e3a\u5728\u6211\u7684\u73af\u5883\u4e2d\uff0c\u6211\u5c06\u7248\u672c\u4e3a4.7.3\u7684\u6570\u636e\u6062\u590d\u5230\u4e865.4.2\u7684WordPress\uff0c\u6240\u4ee5\u5728\u6062\u590d\u5b8c\u6210\u540e\uff0c\u4eea\u8868\u76d8\u51fa\u73b0\u4e86\u201c\u9700\u8981\u66f4\u65b0\u6570\u636e\u5e93\u201d\u7684\u63d0\u793a\u4fe1\u606f\uff0c\u4e0d\u8fc7\u6211\u70b9\u51fb\u4e86\u66f4\u65b0\u6309\u94ae\u540e\u6210\u529f\u5730\u8fdb\u884c\u4e86\u66f4\u65b0\u3002WordPress\u80fd\u591f\u68c0\u6d4b\u5230\u5e94\u7528\u7a0b\u5e8f\u548c\u6570\u636e\u5e93\u4e4b\u95f4\u7684\u7248\u672c\u5dee\u5f02\uff0c\u5e76\u4e3a\u6211\u6267\u884c\u66f4\u65b0\u64cd\u4f5c\u3002<\/p>\n<h2>SSL\u652f\u6301<\/h2>\n<p>\u5728\u5207\u6362DNS\u4e4b\u524d\uff0c\u9700\u8981\u63d0\u524d\u8fc1\u79fbSSL\u8bc1\u4e66\u3002<br \/>\n\u5173\u4e8eSSL\u8bc1\u4e66\u7684\u8fc1\u79fb\uff0c\u53ef\u4ee5\u9009\u62e9\u7ee7\u7eed\u4f7f\u7528\u5f53\u524d\u670d\u52a1\u5668\u7684\u8bc1\u4e66\uff0c\u6216\u8005\u91cd\u65b0\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u8bc1\u4e66\uff0c\u6839\u636e\u60c5\u51b5\u8fdb\u884c\u9009\u62e9\u3002<br \/>\n\u5982\u679c\u6b63\u5728\u4f7f\u7528\u7c7b\u4f3cLet&#8217;s Encrypt\u7684\u514d\u8d39\u8bc1\u4e66\uff0c\u8003\u8651\u5230\u540e\u7eed\u66f4\u65b0\u7684\u95ee\u9898\uff0c\u5efa\u8bae\u5728\u65b0\u670d\u52a1\u5668\u4e0a\u91cd\u65b0\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u8bc1\u4e66\u6bd4\u8f83\u65b9\u4fbf\u3002<br \/>\n\u8fd9\u6b21\u6211\u4eec\u51b3\u5b9a\u4f7f\u7528\u4e00\u4e2a\u540d\u4e3acertbot\u7684\u5de5\u5177\u6765\u521b\u5efa\u65b0\u8bc1\u4e66\u3002<br \/>\nhttps:\/\/github.com\/certbot\/certbot<\/p>\n<p>\u8bf7\u6ce8\u610f\uff0c\u5728\u8fd9\u4e2a\u9636\u6bb5\uff0c\u57df\u540d\u5c1a\u4e0d\u9002\u7528\u4e8eLightsail\uff0c\u56e0\u6b64\u9700\u8981\u4f7f\u7528DNS-01\u6311\u6218\u65b9\u5f0f\u6765\u521b\u5efa\u8bc1\u4e66\u3002<br \/>\n\uff08\u901a\u5e38\u5728\u7f51\u7edc\u4e0a\u641c\u7d22certbot\u547d\u4ee4\u65f6\uff0c\u5927\u591a\u6570\u4f1a\u4ecb\u7ecdHTTP-01\u6311\u6218\u65b9\u5f0f\u3002\u4ec5\u5f53\u57df\u540d\u5df2\u7ecf\u6307\u5411\u60a8\u81ea\u5df1\u7684\u670d\u52a1\u5668\u65f6\uff0c\u624d\u53ef\u4ee5\u4f7f\u7528\u8be5\u6311\u6218\u65b9\u5f0f\u3002\uff09<\/p>\n<p>\u5173\u4e8e\u6311\u6218\u6a21\u5f0f<\/p>\n<p>\u6709\u5173certbot\u547d\u4ee4\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605\u4ee5\u4e0b\u6587\u4ef6\uff1a<br \/>\nhttps:\/\/certbot.eff.org\/docs\/<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\"># certbot\u3092git clone\u3059\u308b<\/span>\r\ngit clone https:\/\/github.com\/certbot\/certbot\r\n<span class=\"nb\">cd <\/span>certbot\r\n<span class=\"c\"># \u30c1\u30e3\u30ec\u30f3\u30b8\u65b9\u5f0f\u306bDNS-01\u3092\u6307\u5b9a\u3057\u3066SSL\u8a3c\u660e\u66f8\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9<\/span>\r\n.\/certbot-auto certonly <span class=\"nt\">--manual<\/span> <span class=\"nt\">--preferred-challenges<\/span> dns-01 <span class=\"nt\">-d<\/span> \u81ea\u5206\u306e\u30c9\u30e1\u30a4\u30f3\u540d\r\n<\/code><\/pre>\n<p>\u5f53\u6267\u884c\u6b64\u547d\u4ee4\u65f6\uff0c\u65e5\u5fd7\u5c06\u4ee5\u4ee5\u4e0b\u65b9\u5f0f\u6d41\u52a8\u3002<\/p>\n<pre class=\"post-pre\"><code>Requesting to rerun .\/certbot-auto with root privileges...\r\n.\/certbot-auto has insecure permissions!\r\nTo learn how to fix them, visit https:\/\/community.letsencrypt.org\/t\/certbot-auto-deployment-best-practices\/91979\/\r\nSaving debug log to \/var\/log\/letsencrypt\/letsencrypt.log\r\nPlugins selected: Authenticator manual, Installer None\r\nObtaining a new certificate\r\nPerforming the following challenges:\r\ndns-01 challenge <span class=\"k\">for <\/span>\u81ea\u5206\u306e\u30c9\u30e1\u30a4\u30f3\u540d\r\n\r\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\r\nNOTE: The IP of this machine will be publicly logged as having requested this\r\ncertificate. If you<span class=\"s1\">'re running certbot in manual mode on a machine that is not\r\nyour server, please ensure you'<\/span>re okay with that.\r\n\r\nAre you OK with your IP being logged?\r\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\r\n<span class=\"o\">(<\/span>Y<span class=\"o\">)<\/span>es\/<span class=\"o\">(<\/span>N<span class=\"o\">)<\/span>o: Y\r\n\r\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\r\nPlease deploy a DNS TXT record under the name\r\n_acme-challenge.\u81ea\u5206\u306e\u30c9\u30e1\u30a4\u30f3\u540d with the following value:\r\n\r\n<span class=\"c\"># \u3053\u3053\u306b\u8a8d\u8a3c\u6587\u5b57\u5217\u304c\u8868\u793a\u3055\u308c\u308b<\/span>\r\n\r\nBefore continuing, verify the record is deployed.\r\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\r\nPress Enter to Continue\r\n<\/code><\/pre>\n<p>\u5728\u8fd9\u91cc\u65e5\u5fd7\u53d1\u9001\u505c\u6b62\uff0c\u6309\u7167\u6307\u793a\uff0c\u5c06\u663e\u793a\u7684\u8ba4\u8bc1\u5b57\u7b26\u4e32\u6ce8\u518c\u5230DNS\u7684TXT\u8bb0\u5f55\u4e2d\uff0c\u7136\u540e\u6309\u4e0bEnter\u952e\u3002<br \/>\n\u5982\u679c\u6210\u529f\u8ba4\u8bc1\uff0c\u5c06\u751f\u6210SSL\u8bc1\u4e66\u3002<\/p>\n<p>\u5c06\u5df2\u521b\u5efa\u7684SSL\u8bc1\u4e66\u914d\u7f6e\u5230Apache\u5e76\u91cd\u65b0\u542f\u52a8\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nb\">sudo cp<\/span> \/etc\/letsencrypt\/live\/\u81ea\u5206\u306e\u30c9\u30e1\u30a4\u30f3\u540d\/fullchain.pem \/opt\/bitnami\/apache2\/conf\/server.crt\r\n<span class=\"nb\">sudo cp<\/span> \/etc\/letsencrypt\/live\/\u81ea\u5206\u306e\u30c9\u30e1\u30a4\u30f3\u540d\/privkey.pem \/opt\/bitnami\/apache2\/conf\/server.key\r\n<span class=\"nb\">sudo<\/span> \/opt\/bitnami\/ctlscript.sh restart apache\r\n<\/code><\/pre>\n<h4>\u5f3a\u5236\u4f7f\u7528https\u8bbf\u95ee<\/h4>\n<p>\u7531\u4e8e\u5373\u4f7f\u652f\u6301SSL\uff0c\u76f4\u63a5\u952e\u5165http\u4e5f\u53ef\u4ee5\u8bbf\u95ee\uff0c\u56e0\u6b64\u6211\u4eec\u5c06http\u7684\u8bbf\u95ee\u91cd\u5b9a\u5411\u5230https\u3002<br \/>\n\u5728Lightsail\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\/opt\/bitnami\/apps\/wordpress\/conf\/httpd-prefix.conf\u8fdb\u884c\u8bbe\u7f6e\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"gd\">- RewriteCond \"%{HTTP_HOST}\" ^ec2-([0-9]{1,3})-([0-9]{1,3})-([0-9]{1,3})-([0-9]{1,3})\\..*\\.amazonaws.com(:[0-9]*)?$\r\n- RewriteRule \"^\/?(.*)\" \"%{REQUEST_SCHEME}:\/\/%1.%2.%3.%4%5\/$1\" [L,R=302,NE]\r\n<\/span><span class=\"gi\">+ RewriteCond %{HTTPS} !=on\r\n+ RewriteRule ^\/(.*) https:\/\/\u81ea\u5206\u306e\u30c9\u30e1\u30a4\u30f3\u540d\/$1 [R,L]\r\n<\/span><\/code><\/pre>\n<p>\u5982\u679c\u8fdb\u884c\u4e86\u4fee\u6b63\uff0c\u5c06\u91cd\u65b0\u542f\u52a8Apache\u3002<\/p>\n<p>Note: Since Chinese is a context-dependent language, the best translation may vary depending on the specific usage or context.<\/p>\n<pre class=\"post-pre\"><code><span class=\"nb\">sudo<\/span> \/opt\/bitnami\/ctlscript.sh restart apache\r\n<\/code><\/pre>\n<h2>\u4fee\u6539\u57df\u540d\u7684\u5f15\u7528\u76ee\u6807<\/h2>\n<p>\u5b8c\u6210\u51c6\u5907\u540e\uff0c\u6700\u540e\u4fee\u6539DNS\u8bb0\u5f55\uff0c\u5c06\u57df\u540d\u7684\u6307\u5411\u4ece\u65e7\u670d\u52a1\u5668\u5207\u6362\u5230Lightsail\u3002\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95eehttps:\/\/\u81ea\u5df1\u7684\u57df\u540d\uff0c\u5982\u679c\u65e5\u5fd7\u5728\u4ee5\u4e0b\u8bbf\u95ee\u65e5\u5fd7\u4e2d\u6d41\u52a8\uff0c\u5219\u8fc1\u79fb\u5b8c\u6210\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nb\">tail<\/span> <span class=\"nt\">-f<\/span> \/opt\/bitnami\/apache2\/logs\/access_log\r\n<\/code><\/pre>\n<h2>\u5176\u4ed6\u8a2d\u7f6e<\/h2>\n<h4>\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/h4>\n<p>\u5728\u4f7f\u7528\u73af\u5883\u53d8\u91cf\u65f6\uff0c\u8bf7\u5c06\u5176\u914d\u7f6e\u5230\/opt\/bitnami\/php\/etc\/php-fpm.conf\u6587\u4ef6\u4e2d\u3002<br \/>\n\u4fee\u6539\u5b8c\u6bd5\u540e\uff0c\u8bf7\u91cd\u65b0\u542f\u52a8php-fpm\u670d\u52a1\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nb\">sudo<\/span> \/opt\/bitnami\/ctlscript.sh restart php-fpm\r\n<\/code><\/pre>\n<h4>\u8bf7\u7528\u4e2d\u6587\u539f\u751f\u5f62\u5f0f\u8f6c\u8ff0\u4ee5\u4e0b\u5185\u5bb9\uff0c\u53ea\u9700\u63d0\u4f9b\u4e00\u4e2a\u7248\u672c\uff1a<\/p>\n<p>.htaccess\u6587\u4ef6\u3002<\/h4>\n<p>\u5728\u8bbe\u7f6e\u8bbf\u95ee\u9650\u5236\uff08\u5982\u57fa\u672c\u8ba4\u8bc1\uff09\u65f6\uff0c\u901a\u5e38\u5728\u5e38\u89c4\u7684Web\u670d\u52a1\u5668\u4e0a\u4f7f\u7528.htaccess\u6587\u4ef6\u3002\u4f46\u5728Lightsail\u4e2d\uff0c\u6709\u4e00\u4e2a\u540d\u4e3a\/home\/bitnami\/apps\/wordpress\/conf\/htaccess.conf\u7684\u914d\u7f6e\u6587\u4ef6\u53ef\u4f9b\u4f7f\u7528\uff0c\u60a8\u53ef\u4ee5\u5c06\u8bbe\u7f6e\u4fe1\u606f\u5199\u5165\u8be5\u6587\u4ef6\u3002<\/p>\n<h2>\u6700\u540e<\/h2>\n<p>\u8fd9\u6b21\u6211\u4eec\u8f6c\u79fb\u5230\u4e86Lightsail\uff0c\u4f46\u5373\u4f7f\u5728\u4e0d\u540c\u7684\u73af\u5883\u4e2d\u8fdb\u884c\u8fc1\u79fb\uff0c\u6211\u8ba4\u4e3a\u4e5f\u53ef\u4ee5\u5e94\u7528\u540c\u6837\u7684\u65b9\u6cd5\u3002\u53ea\u9700\u505a\u7684\u662f\u51c6\u5907\u4e00\u4efd\u5168\u65b0\u7684WordPress\uff0c\u5e76\u5c06wp-content\u548c\u6570\u636e\u5e93\u6570\u636e\u8fc1\u79fb\u5230\u90a3\u91cc\u5373\u53ef\u3002<\/p>\n<p>\u7531\u4e8eLightsail\u5728\u5404\u79cd\u914d\u7f6e\u6587\u4ef6\u7684\u4f4d\u7f6e\u4e0a\u6709\u4e00\u4e9b\u7279\u6b8a\uff0c\u6240\u4ee5\u4e00\u5f00\u59cb\u6709\u4e9b\u56f0\u60d1\u3002\u56e0\u4e3a\u5b83\u662f\u57fa\u4e8eBitnami\u8f6f\u4ef6\u7684\uff0c\u6240\u4ee5\u5728\u9047\u5230\u95ee\u9898\u65f6\uff0c\u53ea\u9700\u5728Bitnami WordPress\u4e0a\u8fdb\u884c\u641c\u7d22\uff0c\u5c31\u5f88\u5bb9\u6613\u627e\u5230\u76f8\u5173\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148 \u6211\u628a\u516c\u53f8\u8fd0\u8425\u7684WordPress\u7f51\u7ad9\u8fc1\u79fb\u5230\u4e86Lightsail\uff0c\u73b0\u5728\u5c06\u5176\u4f5c\u4e3a\u5907\u5fd8\u5f55\u8bb0\u5f55\u4e0b\u6765\u3002 \u5728Word [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-26876","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5c06\u6b63\u5728\u8fd0\u884c\u7684WordPress\u8fc1\u79fb\u81f3AWS Lightsail - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8e\u5c06\u6b63\u5728\u8fd0\u884c\u7684WordPress\u8fc1\u79fb\u81f3AWS Lightsail\u7684\u6280\u672f\u6587\u7ae0\" \/>\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.silicloud.com\/zh\/blog\/\u5c06\u6b63\u5728\u8fd0\u884c\u7684wordpress\u8fc1\u79fb\u81f3aws-lightsail\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5c06\u6b63\u5728\u8fd0\u884c\u7684WordPress\u8fc1\u79fb\u81f3AWS Lightsail\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8e\u5c06\u6b63\u5728\u8fd0\u884c\u7684WordPress\u8fc1\u79fb\u81f3AWS Lightsail\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5c06\u6b63\u5728\u8fd0\u884c\u7684wordpress\u8fc1\u79fb\u81f3aws-lightsail\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-11T14:22:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-11T15:33:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657c2773d0c9c81e0f5d0e7c\/4-0.png\" \/>\n<meta name=\"author\" content=\"\u5b87, \u534e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5b87, \u534e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84wordpress%e8%bf%81%e7%a7%bb%e8%87%b3aws-lightsail%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84wordpress%e8%bf%81%e7%a7%bb%e8%87%b3aws-lightsail%e3%80%82\/\",\"name\":\"\u5c06\u6b63\u5728\u8fd0\u884c\u7684WordPress\u8fc1\u79fb\u81f3AWS Lightsail - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2024-01-11T14:22:05+00:00\",\"dateModified\":\"2025-08-11T15:33:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\"},\"description\":\"\u5173\u4e8e\u5c06\u6b63\u5728\u8fd0\u884c\u7684WordPress\u8fc1\u79fb\u81f3AWS Lightsail\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84wordpress%e8%bf%81%e7%a7%bb%e8%87%b3aws-lightsail%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84wordpress%e8%bf%81%e7%a7%bb%e8%87%b3aws-lightsail%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84wordpress%e8%bf%81%e7%a7%bb%e8%87%b3aws-lightsail%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5c06\u6b63\u5728\u8fd0\u884c\u7684WordPress\u8fc1\u79fb\u81f3AWS Lightsail\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\",\"name\":\"\u5b87, \u534e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"caption\":\"\u5b87, \u534e\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84wordpress%e8%bf%81%e7%a7%bb%e8%87%b3aws-lightsail%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5c06\u6b63\u5728\u8fd0\u884c\u7684WordPress\u8fc1\u79fb\u81f3AWS Lightsail - Blog - Silicon Cloud","description":"\u5173\u4e8e\u5c06\u6b63\u5728\u8fd0\u884c\u7684WordPress\u8fc1\u79fb\u81f3AWS Lightsail\u7684\u6280\u672f\u6587\u7ae0","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.silicloud.com\/zh\/blog\/\u5c06\u6b63\u5728\u8fd0\u884c\u7684wordpress\u8fc1\u79fb\u81f3aws-lightsail\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5c06\u6b63\u5728\u8fd0\u884c\u7684WordPress\u8fc1\u79fb\u81f3AWS Lightsail","og_description":"\u5173\u4e8e\u5c06\u6b63\u5728\u8fd0\u884c\u7684WordPress\u8fc1\u79fb\u81f3AWS Lightsail\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5c06\u6b63\u5728\u8fd0\u884c\u7684wordpress\u8fc1\u79fb\u81f3aws-lightsail\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2024-01-11T14:22:05+00:00","article_modified_time":"2025-08-11T15:33:50+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657c2773d0c9c81e0f5d0e7c\/4-0.png"}],"author":"\u5b87, \u534e","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5b87, \u534e","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84wordpress%e8%bf%81%e7%a7%bb%e8%87%b3aws-lightsail%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84wordpress%e8%bf%81%e7%a7%bb%e8%87%b3aws-lightsail%e3%80%82\/","name":"\u5c06\u6b63\u5728\u8fd0\u884c\u7684WordPress\u8fc1\u79fb\u81f3AWS Lightsail - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2024-01-11T14:22:05+00:00","dateModified":"2025-08-11T15:33:50+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458"},"description":"\u5173\u4e8e\u5c06\u6b63\u5728\u8fd0\u884c\u7684WordPress\u8fc1\u79fb\u81f3AWS Lightsail\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84wordpress%e8%bf%81%e7%a7%bb%e8%87%b3aws-lightsail%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84wordpress%e8%bf%81%e7%a7%bb%e8%87%b3aws-lightsail%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84wordpress%e8%bf%81%e7%a7%bb%e8%87%b3aws-lightsail%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5c06\u6b63\u5728\u8fd0\u884c\u7684WordPress\u8fc1\u79fb\u81f3AWS Lightsail"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458","name":"\u5b87, \u534e","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","caption":"\u5b87, \u534e"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84wordpress%e8%bf%81%e7%a7%bb%e8%87%b3aws-lightsail%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/26876","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=26876"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/26876\/revisions"}],"predecessor-version":[{"id":82378,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/26876\/revisions\/82378"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=26876"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=26876"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=26876"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}