{"id":1,"date":"2022-08-30T09:53:35","date_gmt":"2022-08-30T01:53:35","guid":{"rendered":"http:\/\/www.leyiwangyou.top\/?p=1"},"modified":"2022-08-30T10:58:43","modified_gmt":"2022-08-30T02:58:43","slug":"hello-world","status":"publish","type":"post","link":"http:\/\/www.leyiwangyou.top\/?p=1","title":{"rendered":"WordPress\u642d\u5efa\u6307\u5357"},"content":{"rendered":"<ol>\n<li>\n<p>\u66f4\u65b0\u8f6f\u4ef6<\/p>\n<pre><code class=\"language-bash\">sudo apt update<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5b89\u88c5mysql<\/p>\n<ol>\n<li>\u5b89\u88c5mysql\u670d\u52a1\u5668\n<pre><code class=\"language-bash\">sudo apt install mysql-server<\/code><\/pre>\n<\/li>\n<li>\u65b0\u5efa\u7528\u6237\n<pre><code class=\"language-sql\">CREATE USER 'test'@'localhost' IDENTIFIED BY 'password';\nGRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' WITH GRANT OPTION;\nCREATE USER 'test'@'%' IDENTIFIED BY 'password';\nGRANT ALL PRIVILEGES ON *.* TO 'test'@'%' WITH GRANT OPTION;\nFLUSH PRIVILEGES;<\/code><\/pre>\n<\/li>\n<li>\n<p>\u4fee\u6539bind-address<\/p>\n<pre><code class=\"language-bash\">vim \/etc\/mysql\/mysql.conf.d\/mysqld.cnf\n#\u4fee\u6539\u4e3a0.0.0.0\nbind-address = 0.0.0.0\n\nsudo service mysql restart\nsudo ss -tap | grep mysql<\/code><\/pre>\n<\/li>\n<li>\u65b0\u5efa\u6570\u636e\u5e93\n<pre><code>CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;<\/code><\/pre>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u5b89\u88c5NGINX      <\/p>\n<pre><code>sudo apt install nginx\n<\/code><\/pre>\n<p>\u4fee\u6539nginx\u914d\u7f6e\u6587\u4ef6<\/p>\n<pre><code>server {\n    listen 80 default_server;\n    listen [::]:80 default_server;\n\n    root \/var\/www\/wordpress;\n\n    index index.php index.html index.htm index.nginx-debian.html;\n\n    server_name _;\n\n    location \/ {\n        try_files $uri $uri\/  \/index.php =404;\n    }\n\n    location ~ \\.php$ {\n        fastcgi_pass unix:\/var\/run\/php\/php7.4-fpm.sock;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; \n        include fastcgi_params;\n        include snippets\/fastcgi-php.conf;\n    }\n\n    location ~ \/\\.ht { \n        access_log off; \n        log_not_found off; \n    deny all;\n    }\n}\n<\/code><\/pre>\n<pre><code>sudo nginx -t\nsudo systemctl reload nginx<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5b89\u88c5PHP<\/p>\n<pre><code>sudo apt install php php-fpm php-mysql\nsudo apt install php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5b89\u88c5WordPress<\/p>\n<pre><code>wget https:\/\/cn.wordpress.org\/latest-zh_CN.tar.gz\n\ntar -zxvf latest-zh_CN.tar.gz \n\n#\u5c06\u89e3\u538b\u540e\u7684\u6587\u4ef6\u5939\u653e\u5165 \/var\/www\/wordpress\nsudo cp wordpress\/ \/var\/www\/wordpress<\/code><\/pre>\n<\/li>\n<li>\n<p>\u8bbf\u95ee\u9875\u9762http:\/\/IP\/wp-admin\/setup-config.php<br \/>\n<img decoding=\"async\" src=\"http:\/\/www.leyiwangyou.top\/wp-content\/uploads\/2022\/08\/img-20220829163415-300x214.png\" alt=\"\" \/><\/p>\n<p>\u586b\u5199\u6570\u636e\u5e93\u8fde\u63a5\u4fe1\u606f<br \/>\n<img decoding=\"async\" src=\"http:\/\/www.leyiwangyou.top\/wp-content\/uploads\/2022\/08\/img-20220829163531-300x215.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.leyiwangyou.top\/wp-content\/uploads\/2022\/08\/img-20220829164055-300x129.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.leyiwangyou.top\/wp-content\/uploads\/2022\/08\/img-20220829164237-264x300.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.leyiwangyou.top\/wp-content\/uploads\/2022\/08\/img-20220829164358-300x174.png\" alt=\"\" \/><\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u66f4\u65b0\u8f6f\u4ef6 sudo apt update<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.leyiwangyou.top\/index.php?rest_route=\/wp\/v2\/posts\/1","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.leyiwangyou.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.leyiwangyou.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.leyiwangyou.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.leyiwangyou.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1"}],"version-history":[{"count":1,"href":"http:\/\/www.leyiwangyou.top\/index.php?rest_route=\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":26,"href":"http:\/\/www.leyiwangyou.top\/index.php?rest_route=\/wp\/v2\/posts\/1\/revisions\/26"}],"wp:attachment":[{"href":"http:\/\/www.leyiwangyou.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.leyiwangyou.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.leyiwangyou.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}