{"id":850,"date":"2020-09-08T23:26:14","date_gmt":"2020-09-08T15:26:14","guid":{"rendered":"https:\/\/www.iotch.xyz\/?p=850"},"modified":"2020-09-08T23:26:14","modified_gmt":"2020-09-08T15:26:14","slug":"%e5%9c%a8-raspbian-%e4%b8%8a%e9%83%a8%e7%bd%b2-lnmp-pi-dashboard","status":"publish","type":"post","link":"https:\/\/www.iotch.xyz\/?p=850","title":{"rendered":"\u5728 Raspbian \u4e0a\u90e8\u7f72 LNMP + Pi Dashboard"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u524d\u8a00<\/h3>\n\n\n\n<p>\u4e4b\u524d\u6211\u4eec\u4ecb\u7ecd\u8fc7<a href=\"https:\/\/shumeipai.nxez.com\/2018\/04\/25\/install-pi-dashboard-with-nginx-php7-on-pi.html\" rel=\"noreferrer noopener\" target=\"_blank\" rel=\"nofollow\" >\u7ed9\u6811\u8393\u6d3e\u5b89\u88c5 Nginx + PHP7.0 + Pi Dashboard<\/a> \u7684\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p>Raspbian Buster \u7528 PHP7.1(2,3) \u66ff\u4ee3\u4e86 PHP7.0\uff0c\u6709\u5f88\u591a\u7fa4\u53cb\u8bf4\u627e\u4e0d\u5230\u8f6f\u4ef6\u5305\u4e86\u3002\u56e0\u6b64\u6211\u6765\u4ecb\u7ecd\u5982\u4f55\u7528\u5728\u6811\u8393\u6d3e\u4e0a\u90e8\u7f72\u65b0\u7684 LNMP \u73af\u5883(PHP7.3)\uff0c\u5e76\u90e8\u7f72\u597d Pi Dashboard \u7684\u65b9\u6cd5\u3002\u4e0b\u9762\u5047\u8bbe\u4f60\u5df2\u7ecf\u5237\u597d\u4e86 Raspbian Buster \u7cfb\u7edf\u3002\u6700\u597d\u662f\u628aapt\u8f6f\u4ef6\u6e90\u4e5f\u6362\u8fc7\u4e86\u3002<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5 Nginx \u548c PHP7<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u5b89\u88c5\u8f6f\u4ef6\u5305<\/h4>\n\n\n\n<p>\u5728 Pi \u7684\u7ec8\u7aef\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get update\nsudo apt-get install nginx php7.3-fpm php7.3-cli php7.3-curl php7.3-gd php7.3-cgi\nsudo service nginx start\nsudo service php7.3-fpm restart\n<\/pre>\n\n\n\n<p>\u5982\u679c\u5b89\u88c5\u6210\u529f\uff0c\u53ef\u901a\u8fc7 http:\/\/\u6811\u8393\u6d3eIP\/&nbsp;\u8bbf\u95ee\u5230 Nginx \u7684\u9ed8\u8ba4\u9875\u3002Nginx \u7684\u6839\u76ee\u5f55\u5728&nbsp;<code>\/var\/www\/html<\/code>\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u8ba9 Nginx \u80fd\u5904\u7406 PHP<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo nano \/etc\/nginx\/sites-available\/default<\/pre>\n\n\n\n<p>\u5c06\u5176\u4e2d\u7684\u5982\u4e0b\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">location \/ {\n                # First attempt to serve request as file, then\n                # as directory, then fall back to displaying a 404.\n                try_files $uri $uri\/ =404;\n        }\n<\/pre>\n\n\n\n<p>\u66ff\u6362\u4e3a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">location \/ {\nindex  index.html index.htm index.php default.html default.htm default.php;\n}\n \nlocation ~\\.php$ {\nfastcgi_pass unix:\/run\/php\/php7.3-fpm.sock;\n#fastcgi_pass 127.0.0.1:9000;\nfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\ninclude fastcgi_params;\n}\n<\/pre>\n\n\n\n<p>Ctrl + O \u4fdd\u5b58\u518d Ctrl + X \u9000\u51fa\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo service nginx restart<\/pre>\n\n\n\n<p>\u6700\u540e\u91cd\u542f Nginx \u5373\u53ef\uff0c\u4ee5\u4e0a\u6b65\u9aa4\u5728\u6811\u8393\u6d3e3B + Raspbian Buster \u7cfb\u7edf\u7248\u672c\u4e0a\u6d4b\u8bd5\u901a\u8fc7\u30024B\u4e5f\u53ef\u4ee5\u7528\u7684\uff0c\u522b\u778e\u60f3\u4e86\u3002\u4e0d\u80fd\u7528\u4e00\u5b9a\u662f\u56e0\u4e3a\u4f60\u6f0f\u6389\u4e86\u4ec0\u4e48\uff0c\u518d\u4ed4\u7ec6\u68c0\u67e5\u4e00\u4e0b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5\u914d\u7f6eMySQL<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u5b89\u88c5\u8f6f\u4ef6\u5305<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install mariadb-server-10.0<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u66f4\u6539\u5bc6\u7801<\/h4>\n\n\n\n<p>\u6267\u884c <code>mysql<\/code> \u547d\u4ee4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">MariaDB [(none)]&gt; use mysql;\nMariaDB [mysql]&gt; update user set plugin='mysql_native_password' where user='root';\nMariaDB [mysql]&gt; UPDATE user SET password=PASSWORD('\u4f60\u60f3\u8981\u8bbe\u5b9a\u7684\u5bc6\u7801') WHERE user='root';\nMariaDB [mysql]&gt; flush privileges;\nMariaDB [mysql]&gt; exit;\n<\/pre>\n\n\n\n<p>\u91cd\u542f\u670d\u52a1<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">service mysql restart<\/pre>\n\n\n\n<p>mysql\u914d\u7f6e\u5c31\u5b8c\u6210\u4e86\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Pi Dashboard \u4ecb\u7ecd<\/h3>\n\n\n\n<p>\u8bf7\u79fb\u6b65\u9879\u76ee\u4e3b\u9875\uff1a<a href=\"http:\/\/make.quwj.com\/project\/10\" target=\"_blank\" rel=\"noreferrer noopener\" rel=\"nofollow\" >http:\/\/make.quwj.com\/project\/10<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u90e8\u7f72 Pi Dashboard<\/h3>\n\n\n\n<p>GitHub \u90e8\u7f72<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/var\/www\/html\nsudo git clone https:\/\/github.com\/spoonysonny\/pi-dashboard.git\n<\/pre>\n\n\n\n<p>\u5373\u53ef\u901a\u8fc7&nbsp;http:\/\/\u6811\u8393\u6d3eIP\/pi-dashboard&nbsp;\u8bbf\u95ee\u90e8\u7f72\u597d\u4e86\u7684 Pi Dashboard\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u6b65\u9aa4\u5728\u6811\u8393\u6d3e3B + Raspbian Buster \u7cfb\u7edf\u7248\u672c\u4e0a\u6d4b\u8bd5\u901a\u8fc7\uff0c\u6bcf\u6761\u90fd\u4eb2\u81ea\u9a8c\u8bc1\u8fc7\u3002<strong>\u6587\u7ae0\u6807\u9898\uff1a<\/strong><a href=\"https:\/\/shumeipai.nxez.com\/2020\/03\/21\/install-pi-dashboard-with-nginx-php73-on-pi.html\" target=\"_blank\"  rel=\"nofollow\" >\u5728 Raspbian \u4e0a\u90e8\u7f72 LNMP + Pi Dashboard<\/a> - <a href=\"https:\/\/shumeipai.nxez.com\" target=\"_blank\"  rel=\"nofollow\" >\u6811\u8393\u6d3e\u5b9e\u9a8c\u5ba4<\/a><strong>\u56fa\u5b9a\u94fe\u63a5\uff1a<\/strong><a href=\"https:\/\/shumeipai.nxez.com\/2020\/03\/21\/install-pi-dashboard-with-nginx-php73-on-pi.html\" target=\"_blank\"  rel=\"nofollow\" >https:\/\/shumeipai.nxez.com\/2020\/03\/21\/install-pi-dashboard-with-nginx-php73-on-pi.html<\/a><\/p>\n<button class=\"simplefavorite-button\" data-postid=\"850\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u4e4b\u524d\u6211\u4eec\u4ecb\u7ecd\u8fc7\u7ed9\u6811\u8393\u6d3e\u5b89\u88c5 Nginx + PHP7.0 + Pi Dashboard \u7684\u65b9\u6cd5\u3002 Raspbian Bust &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-850","post","type-post","status-publish","format-standard","hentry","category-10"],"_links":{"self":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/850","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=850"}],"version-history":[{"count":0,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/850\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}