{"id":215,"date":"2021-08-19T00:20:43","date_gmt":"2021-08-18T16:20:43","guid":{"rendered":"http:\/\/121.196.215.38\/wordpress\/?p=215"},"modified":"2022-09-12T23:22:52","modified_gmt":"2022-09-12T15:22:52","slug":"set-up-my-blog","status":"publish","type":"post","link":"https:\/\/whx.weiqs.cn\/blog\/index.php\/2021\/08\/19\/set-up-my-blog\/","title":{"rendered":"\u963f\u91cc\u4e91+Ubuntu+LAMP+WordPress\u642d\u5efa\u4e2a\u4eba\u535a\u5ba2\u7f51\u7ad9"},"content":{"rendered":"\n<p>\u4f7f\u7528\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>1.\u4fee\u6539\u4e3b\u673a\u540d(\u9009\u505a)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/etc\/hostname#\u4fee\u6539\u4e3b\u673a\u540d\uff0c\u963f\u91cc\u4e91\u4e3b\u673a\u540d\u5b57\u592a\u4e11<\/code><\/pre>\n\n\n\n<p>2.\u5b89\u88c5Apache<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-get install apache2 \/\/\u5b89\u88c5apache\nufw allow 80            \/\/\u5173\u95ed\u9632\u706b\u589980\u7aef\u53e3\u9650\u5236; \u6d4b\u8bd5\uff1a\u8bbf\u95ee\u516c\u7f51ip\uff0c\u51fa\u73b0It Works! Ubuntu\u7684IP\u7f51\u9875\uff0c <\/code><\/pre>\n\n\n\n<p>3.\u5b89\u88c5MySQL(\u914d\u7f6e\u6570\u636e\u5e93)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-get install mysql-server mysql-client \/\/\u5b89\u88c5 \nufw allow 3306                            \/\/\u5173\u95ed\u9632\u706b\u58993306\u7aef\u53e3\u9650\u5236    \nvi \/etc\/mysql\/mysql.conf.d\/mysqld.cnf     \/\/\u8bbe\u7f6e\u8fdc\u7a0b\u8bbf\u95ee, \u6ce8\u91ca\u6389bind-address = 127.0.0.1\uff0c\u5426\u5219\u53ea\u80fd\u81ea\u8eab\u8bbf\u95ee\nmysql -u root -p                          \/\/\u767b\u9646mysql\u914d\u7f6e\u6570\u636e\u5e93\ncreate database wordpress;                \/\/\u521b\u5efa\u4e00\u4e2a\u53ebwordpress\u7684\u6570\u636e\u5e93  \ncreate user \u7528\u6237\u540d;                        \/\/\u4e3a\u8fd9\u4e2a\u6570\u636e\u5e93\u8bbe\u7f6e\u4e00\u4e2a\u7528\u6237\nset password for \u7528\u6237\u540d = password(\"\u5bc6\u7801\");\ngrant  all privileges on wordpress.*    to \u7528\u6237\u540d identified by \"\u5bc6\u7801\";     \/\/\u4e3a\u8fd9\u4e2a\u7528\u6237\u914d\u7f6e\u6570\u636e\u5e93\u7684\u8bbf\u95ee\u6743\u9650\ngrant all on *.* to root@'%' identified by '\u5bc6\u7801' with grant option;        \/\/\u5141\u8bb8root\u7528\u6237\u8fdc\u7a0b\u8bbf\u95ee\nflush privileges;                         \/\/\u751f\u6548\u8fd9\u4e9b\u914d\u7f6e\nexit;<\/code><\/pre>\n\n\n\n<p>4.\u5b89\u88c5PHP<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-get install php7.2   libapache2-mod-php7.2  php7.2-mysql   php7.2-fpm\n#\u91cd\u542f\nservice apache2 restart\nservice mysql restart<\/code><\/pre>\n\n\n\n<p>5.\u5b89\u88c5phpMyAdmin<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install phpmyadmin#\u5b89\u88c5\u65f6\uff1a\u7a7a\u683c\u9009\u62e9apache2\uff0center\u786e\u5b9a\uff0c\u4e0b\u4e00\u6b65\u914d\u7f6e\u6570\u636e\u5e93\uff0c\u8f93\u5165\u5bc6\u7801\u3002\nsudo ln -s \/usr\/share\/phpmyadmin \/var\/www\/html   #\u521b\u5efaphpMyAdmin\u5feb\u6377\u65b9\u5f0f\nsudo a2enmod rewrite      #\u542f\u7528Apache mod_rewrite\u6a21\u5757\uff0c\u540e\u9762\u4fee\u6539wordpress\u94fe\u63a5\u65f6\u4f1a\u7528\n#\u91cd\u542f\u670d\u52a1\nservice php7.2-fpm restart  \nservice apache2 restart   #\u6d4b\u6d4f\u89c8\u5668\u8bbf\u95ee\uff1ahttp:\/\/\u516c\u7f51ip\/phpmyadmin <\/code><\/pre>\n\n\n\n<p>6.\u5b89\u88c5wordpress<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/cn.wordpress.org\/wordpress-5.8-zh_CN.tar.gz    \/\/\u4e0b\u8f7d\u538b\u7f29\u5305\ntar zxf wordpress-5.8-zh_CN.tar.gz -C \/var\/www\/html\/        \/\/\u89e3\u538b\u81f3 var\/www\/html\n\ncd \/var\/www\/html\/wordpress\ncp wp-config-sample.php wp-config.php\nvi wp-config.php          \/\/\u5c06\u6807\u8bb0\u7684\u5730\u65b9\u6539\u4e3a wordpress, \u4f60\u7684\u7528\u6237\u540d, \u4f60\u7684\u5bc6\u7801, \u4fdd\u5b58\u9000\u51fa\n\n\/\/\u5e76\u63d2\u5165\u4e09\u884c, define\u4e0b\u9762\n#define(\"FS_METHOD\", \"direct\");\n#define(\"FS_CHMOD_DIR\", 0777);\n#define(\"FS_CHMOD_FILE\", 0777);\n\n\/\/\u91cd\u542f\u670d\u52a1\nservice apache2 restart  \n\n\/\/\u63a5\u4e0b\u6765\u8fdb\u5165 \u4f60\u7684\u670d\u52a1\u5668\u516c\u7f51http:\/\/\u516c\u7f51ip\/wordpress \u586b\u5199\u4e4b\u524d\u521a\u5efa\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\uff0c\n\/\/\u5b8c\u6210\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528\u65b9\u6cd5\u5982\u4e0b\uff1a 1.\u4fee\u6539\u4e3b\u673a\u540d(\u9009\u505a) 2.\u5b89\u88c5Apache 3.\u5b89\u88c5MySQL(\u914d\u7f6e\u6570\u636e\u5e93) 4.\u5b89\u88c5PHP 5.\u5b89\u88c5phpMy &#8230;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[12],"class_list":["post-215","post","type-post","status-publish","format-standard","hentry","category-dry-goods","tag-dry-goods"],"_links":{"self":[{"href":"https:\/\/whx.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/whx.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/whx.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/whx.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/whx.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=215"}],"version-history":[{"count":14,"href":"https:\/\/whx.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/215\/revisions"}],"predecessor-version":[{"id":494,"href":"https:\/\/whx.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/215\/revisions\/494"}],"wp:attachment":[{"href":"https:\/\/whx.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/whx.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/whx.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}