{"id":1583,"date":"2021-09-11T13:12:09","date_gmt":"2021-09-11T05:12:09","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=1583"},"modified":"2023-06-01T15:26:32","modified_gmt":"2023-06-01T07:26:32","slug":"1583","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/steven\/uncategorized\/1583\/","title":{"rendered":"\u96f2\u7aef\u5efa\u8a2d\u7b46\u8a18"},"content":{"rendered":"<p>https:\/\/cloud.linode.com\/linodes\/29998840<\/p>\n<p>\u9023\u7dda\u5de5\u5177 iTerm<br \/>\nssh root@198.123.52.34<br \/>\nssh + \u81ea\u5df1\u8a2d\u5b9a\u7684password<\/p>\n<p>\u9032\u5165\u865b\u64ec\u4e3b\u6a5f\uff0c\u5728 iTerm2 \u4e0a\u8f38\u5165 ssh root@\u865b\u64ec\u4e3b\u6a5f\u7684 IP address<br \/>\n\u8f38\u5165\u525b\u525b\u5728 Linode \u8a2d\u5b9a\u7684 Root Password<\/p>\n<p>\u5347\u7d1a ubuntu<br \/>\nsudo apt update &amp;&amp; sudo apt upgrade<\/p>\n<p>sudo apt-get install tasksel<\/p>\n<p>\u5b89\u88dd LAMP<br \/>\n(\u820a\u7248)<br \/>\nsudo tasksel install lamp-server<\/p>\n<p>(\u65b0\u7248 web server)<br \/>\nsudo tasksel<br \/>\n\u9032\u5165\u5f8c\u7a7a\u767d\u52fe\u9078&#8221;web server&#8221;<\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/badgameshow.com\/steven\/wp-content\/uploads\/2022\/11\/wp_editor_md_41458716ebb236ea8717e47795e6697e.jpg\"><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/steven\/wp-content\/uploads\/2022\/11\/wp_editor_md_41458716ebb236ea8717e47795e6697e.jpg\" alt=\"\" title=\"\"><\/a><br \/>\n\u8a2d\u5b9aApache<br \/>\napache2ctl configtest<br \/>\nvim \/etc\/apache2\/apache2.conf \u9032\u5165 vim \u7de8\u8f2f\u5668\uff0c\u5728\u6700\u4e0a\u65b9\u52a0\u4e0a ServerName \u865b\u64ec\u4e3b\u6a5f\u7684 IP address<br \/>\nsudo systemctl restart apache2 \u91cd\u555fApache<\/p>\n<p>\u8a2d\u5b9a\u9632\u706b\u7246<br \/>\nsudo ufw app list<br \/>\nsudo ufw app info &#8220;Apache Full&#8221;<br \/>\nsudo ufw allow in &#8220;Apache Full&#8221;<br \/>\nsudo ufw allow 21<br \/>\nsudo ufw allow 22<br \/>\nsudo ufw allow ssh<br \/>\nsudo ufw enable<\/p>\n<p>\u95dc\u9589 Auto Index\uff08\u5982\u679c\u6587\u4ef6\u4e2d\u6c92\u6709 index \u6a19\u984c\u7684\u6a94\u6848\uff0c\u6703\u76f4\u63a5\u51fa\u73fe\u4f60\u7684\u6839\u76ee\u9304\uff0c\u8981\u628a\u9019\u500b\u529f\u80fd\u95dc\u6389\uff09<br \/>\nsudo a2dismod autoindex<br \/>\nsudo systemctl restart apache2<\/p>\n<p>(\u65b0)<br \/>\nsudo apt install mysql-server<\/p>\n<p>\u8a2d\u5b9a MySQL \u7684 root \u5bc6\u78bc<br \/>\nsudo mysql -u root mysql<br \/>\nSELECT user,authentication_string,plugin,host FROM mysql.user;<br \/>\nUPDATE user SET plugin=&#8217;mysql_native_password&#8217; WHERE User=&#8217;root&#8217;;<br \/>\nSELECT user,authentication_string,plugin,host FROM mysql.user;<br \/>\nFLUSH PRIVILEGES;<br \/>\nexit<br \/>\nsudo mysql_secure_installation<\/p>\n<p>y 2 \u7b26\u5408\u5f37\u5ea6\u8981\u6c42\u7684\u5bc6\u78bc yyyyy&#8230;<\/p>\n<p>\u4ee5\u4e0b\u5be9\u7565<\/p>\n<p>\u66f4\u6539\u57f7\u884c index \u6a94\u6848\u7684\u9806\u5e8f<br \/>\nsudo vim \/etc\/apache2\/mods-enabled\/dir.conf<\/p>\n<p>\u67e5\u770b php \u8a73\u7d30\u8cc7\u6599<br \/>\nPHP\u5b89\u88dd(\u65b0)<br \/>\nsudo apt install php<\/p>\n<p>apt-cache show php-cli<br \/>\ncd \/var\/www\/html<br \/>\nsudo vim info.php<br \/>\n\u5728\u7db2\u5740\u8f38\u5165\u6846\u4e2d\u8f38\u5165 ip\u4f4d\u7f6e\/info.php \u5373\u53ef\u770b\u5230\u8a73\u7d30\u8cc7\u8a0a<\/p>\n<p>\u5b89\u88dd phpmyadmin<br \/>\nsudo apt install phpmyadmin php-mbstring<br \/>\nsudo phpenmod mbstring<br \/>\nsudo systemctl restart apache2<br \/>\n\u5728\u7db2\u5740\u8f38\u5165\u6846\u4e2d\u8f38\u5165 ip\u4f4d\u7f6e\/phpmyadmin \u5373\u53ef\u767b\u5165 phpmyadmin<br \/>\n\u5e33\u865f\u70ba root \u5bc6\u78bc\u70ba\u7b2c7\u6b65\u8a2d\u5b9a\u7684MySQL\u5bc6\u78bc<\/p>\n<p>\u5141\u8a31\u4f7f\u7528 PHP Short tag<br \/>\nvim \/etc\/php\/7.2\/apache2\/php.ini<br \/>\n\u627e\u5230 short_open_tag = \u6539\u6210 ON<br \/>\n\u96e2\u958b vim \u7de8\u8f2f\u5668<\/p>\n<p>\u5efa\u7acbLAMP<br \/>\nhttps:\/\/github.com\/Lidemy\/mentor-program-2nd-futianshen\/issues\/21<\/p>\n<p>SSL auto<br \/>\nhttps:\/\/www.digitalocean.com\/community\/tutorials\/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04<\/p>\n<p>wordpress:<br \/>\nSQL<br \/>\nmysql -u root -p<br \/>\nCREATE DATABASE <code>wordpress_bitneeds_db<\/code>;<\/p>\n<p>\u5916\u639b\u7121\u6cd5\u88dd\u554f\u984c<br \/>\nchown -R www-data:www-data ..\/html<\/p>\n<p>wordpress \u6c38\u4e45\u9023\u7d50\u7121\u6cd5\u6539\u554f\u984c<br \/>\nhttps:\/\/diary.taskinghouse.com\/posts\/664222-resolved-wordpress-permalinks-404-error\/<br \/>\nhttps:\/\/www.itread01.com\/content\/1548349208.html<\/p>\n<p>DNS\u8a2d\u5b9a \u7db2\u57df\u8a2d\u5b9a<br \/>\ngodaddy \u8a2d\u5b9a<br \/>\nhttps:\/\/tw.godaddy.com\/help\/add-a-subdomain-4080<\/p>\n<p>\/etc\/apache2\/sites-available<br \/>\n000-default-le-ssl.conf<\/p>\n<p>(\u9019\u500b\u65b0\u589e\u8def\u5f91)<br \/>\n000-default.conf<br \/>\n\u65b0\u589e \u7db2\u8def.conf<\/p>\n<p>\u91cd\u555f<br \/>\nsudo service apache2 restart<\/p>\n<p>\u932f\u8aa4<br \/>\nErrors were encountered while processing:<br \/>\n mysql-server-8.0<br \/>\nE: Sub-process \/usr\/bin\/dpkg returned an error code (1)<\/p>\n<p>\u89e3\u6cd5<br \/>\ncd \/var\/lib\/dpkg\/info<br \/>\nsudo rm -rf .\/mysql-*<br \/>\nsudo dpkg &#8211;remove &#8211;force-remove-reinstreq mysql-server-8.0<\/p>\n<p>sudo apt install libapache2-mod-php php-mysql<\/p>\n<p>\u5b89\u88ddwordpress<br \/>\ncd \/var\/www\/html<\/p>\n<p>wget https:\/\/github.com\/WordPress\/WordPress\/archive\/refs\/heads\/master.zip<br \/>\napt install unzip<br \/>\nunzip master.zip<\/p>\n<p>mv WordPress-master\/* .\/<br \/>\nrm -r WordPress-master<\/p>\n<p>wget https:\/\/tw.wordpress.org\/wordpress-6.1.1-zh_TW.zip<br \/>\nunzip wordpress-6.1.1-zh_TW.zip<\/p>\n<p>rm -r wordpress-6.1.1-zh_TW.zip<br \/>\nmv wordpress\/* .\/<br \/>\nrm -r wordpress<\/p>\n<p>WordPress\u5b89\u88dd\u5916\u639b\u6642\uff0c\u986f\u793a\u7121\u6cd5\u9023\u7dda\u81f3\u6a94\u6848\u7cfb\u7d71\u7684\u932f\u8aa4\u8a0a\u606f\uff1a\u300c\u5982\u9700\u57f7\u884c\u9019\u9805\u5fc5\u8981\u64cd\u4f5c\uff0c WordPress\u5fc5\u9808\u5b58\u53d6\u9019\u500b\u7db2\u7ad9\u7684\u7db2\u9801\u4f3a\u670d\u5668\u3002\u8acb\u8f38\u5165 FTP\u8a8d\u8b49\u4ee5\u7e7c\u7e8c\u3002\u5982\u4e0d\u8a18\u5f97\u8a8d\u8b49\u70ba\u4f55\uff0c\u8acb\u806f\u7d61\u9019\u500b\u7db2\u7ad9\u7684\u4e3b\u6a5f\u670d\u52d9\u5546\u3002\u300d<\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/badgameshow.com\/steven\/wp-content\/uploads\/2023\/03\/wp_editor_md_5697c3ef908ae02f020df8d4cd960912.jpg\"><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/steven\/wp-content\/uploads\/2023\/03\/wp_editor_md_5697c3ef908ae02f020df8d4cd960912.jpg\" alt=\"\" title=\"\"><\/a><\/p>\n<p>chown -R www-data:www-data \/var\/www\/html\/wp-content\/<br \/>\nchown -R www-data:www-data \/var\/www\/html\/wp-includes\/<\/p>\n<p>wp-config.php<br \/>\ndefine(&#8216;FS_METHOD&#8217;, &#8216;direct&#8217;);<\/p>\n<p>http:\/\/127.0.0.1\/index.php\/category\/\u4e2d\u6587\/<br \/>\n\u4e2d\u6587\u5206\u985e\u627e\u4e0d\u5230<\/p>\n<p>html\/index.php\u52a0\u5165<br \/>\n<span class=\"katex math inline\">_SERVER[&#8216;REQUEST_URI&#8217;] = urldecode(<\/span>_SERVER[&#8216;REQUEST_URI&#8217;]);<\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/cloud.linode.com\/&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1583","post","type-post","status-publish","format-aside","hentry","category-uncategorized","post_format-post-format-aside"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_shortlink":"https:\/\/wp.me\/scFK27-1583","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/1583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/comments?post=1583"}],"version-history":[{"count":13,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/1583\/revisions"}],"predecessor-version":[{"id":8812,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/1583\/revisions\/8812"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/media?parent=1583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=1583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=1583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}