{"id":280,"date":"2015-01-29T10:59:58","date_gmt":"2015-01-29T02:59:58","guid":{"rendered":"http:\/\/heartofocean.cn\/?p=280"},"modified":"2015-01-29T10:59:58","modified_gmt":"2015-01-29T02:59:58","slug":"%e3%80%90%e8%bd%ac%e3%80%91%e6%a0%91%e8%8e%93%e6%b4%be%e6%90%ad%e5%bb%balnmp%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/li-yang.cn\/?p=280","title":{"rendered":"\u3010\u8f6c\u3011\u6811\u8393\u6d3e\u642d\u5efaLNMP\u73af\u5883"},"content":{"rendered":"<p>Raspberry Pi\u7684\u56fa\u4ef6\u6709\u5f88\u591a\uff0c\u6211\u5b89\u88c5\u7684\u662f\u5b98\u65b9\u7684Raspbian\u3002\u914d\u7f6eip\u3002\u7136\u540essh\u4e0a\u53bb\u540e\u5f00\u59cb\u5b89\u88c5\u3002<\/p>\n<p>\u63a8\u8350root\u6743\u9650\u6267\u884c<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo apt-get update sudo apt-get install nginx php5-fpm php5-cli php5-curl php5-gd php5-mcrypt php5-mysql php5-cgi mysql-server\n<\/pre>\n<p>\u9996\u6b21\u5b89\u88c5mysql\u7684\u65f6\u5019\u4f1a\u63d0\u793a\u8f93\u5165\u5bc6\u7801\uff0c\u5bc6\u7801\u4e0d\u8981\u5fd8\u8bb0\u5c31\u884c\u4e86\u3002<br \/>\n\u63a5\u4e0b\u6765\u6211\u4eec\u6765\u914d\u7f6eNginx\uff0c\u9996\u5148\u6253\u5f00\u914d\u7f6e\u6587\u4ef6\uff0c\/etc\/nginx\/nginx.conf \uff0c\u6309\u7167\u4e0b\u9762\u7684\u914d\u7f6e\u8fdb\u884c\u4fee\u6539\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nworker_processes 1;\nworker_connections 256;\ngzip on;\ngzip_disable &quot;msie6&quot;;\ngzip_vary on;\ngzip_proxied any;\ngzip_comp_level 6;\ngzip_buffers 16 8k;\ngzip_http_version 1.1;\ngzip_types text\/plain text\/css application\/json application\/x-javascript text\/xml application\/xml application\/xml+rss text\/javascript;\n<\/pre>\n<p>\u63a5\u4e0b\u6765\u6253\u5f00\/etc\/nginx\/sites-available\/default\u4e5f\u662f\u6309\u7167\u4e0b\u9762\u7684\u914d\u7f6e\u8fdb\u884c\u4fee\u6539\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nserver {\n\tlisten 80;#Web\u670d\u52a1\u7aef\u53e3\u53f7,\u5927\u9646\u7528\u6237\u53ef\u80fd\u9700\u8981\u4fee\u6539\u4e3a81\u62168080\u7b49\n\tserver_name raspiweb.dyndns.org;\n\troot \/media\/usb\/www\/;\n\taccess_log\t\/var\/log\/nginx\/localhost.access.log;\n\t#error_page\t404 \/404.html;\n\tif (!-e $request_filename)\n\t{\n\t\trewrite ^(.*)$ \/index.php$1 last;\n\t}\n\tlocation \/ {\n\t\tindex  index.html index.htm index.php default.html default.htm default.php;\n\t}\n\tlocation ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {\n\t\taccess_log\toff;\n\t\texpires\t1d;\n\t}\n\tlocation ~ .*.php(\/.*)*$ {\n\t\tfastcgi_split_path_info ^(.+.php)(\/.+)$;\n\t\tfastcgi_pass unix:\/var\/run\/php5-fpm.sock;\n\t\tfastcgi_index index.php;\n\t\tinclude fastcgi_params;\n\t}\n}\n<\/pre>\n<p>\u4e0b\u9762\u662f\u5bf9mysql\u7684\u8c03\u4f18\uff0c\u6253\u5f00\u914d\u7f6e\u6587\u4ef6\/etc\/mysql\/my.cnf\u4fee\u6539\u4ee5\u4e0b\u51e0\u5904\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n[mysqld]\nkey_buffer = 16k\nmax_allowed_packet = 1M\nthread_stack = 64K\nthread_cache_size = 4\nquery_cache_limit = 1M\ndefault-storage-engine = MYISAM\n<\/pre>\n<p>\u6700\u540e\u6211\u4eec\u6765\u914d\u7f6ephp.ini\uff0cphp-fpm\uff0c\u6253\u5f00\u914d\u7f6e\u6587\u4ef6\/etc\/php5\/fpm\/php.ini\u548c\/etc\/php5\/fpm\/php-fpm.conf\u4fee\u6539\u4ee5\u4e0b\u51e0\u5904\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nmemory_limit=16M\nprocess.max=4\n<\/pre>\n<p>\u5230\u8fd9\u91cc\u6211\u4eec\u7684lnmp\u73af\u5883\u914d\u7f6e\u5df2\u7ecf\u5927\u529f\u544a\u6210\uff01\u63a5\u4e0b\u6765\u662f\u5b89\u88c5phpmyadmin\u5230\u6307\u5b9a\u76ee\u5f55~\u8fd9\u91cc\u53ea\u8bb2\u5982\u4f55\u914d\u7f6elnmp\u3002<br \/>\n<a href=\"http:\/\/raspiweb.dyndns.org\/post-13.htm\" rel=\"nofollow\">via<\/a><\/p>\n<div class=\"post_copyright\">\u672c\u6587\u6765\u81ea\uff1a<a title=\"\u6811\u8393\u6d3e\u5b9e\u9a8c\u5ba4\" href=\"http:\/\/shumeipai.nxez.com\/\">\u6811\u8393\u6d3e\u5b9e\u9a8c\u5ba4<\/a><br \/>\u94fe\u63a5\u5730\u5740\uff1a<a rel=\"bookmark\" title=\"\u6811\u8393\u6d3e\u642d\u5efaLNMP\u73af\u5883\" href=\"http:\/\/shumeipai.nxez.com\/2013\/08\/25\/install-and-config-lnmp.html\">http:\/\/shumeipai.nxez.com\/2013\/08\/25\/install-and-config-lnmp.html<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Raspberry Pi\u7684\u56fa\u4ef6\u6709\u5f88\u591a\uff0c\u6211\u5b89\u88c5\u7684\u662f\u5b98 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-280","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/li-yang.cn\/index.php?rest_route=\/wp\/v2\/posts\/280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/li-yang.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/li-yang.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/li-yang.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/li-yang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=280"}],"version-history":[{"count":0,"href":"https:\/\/li-yang.cn\/index.php?rest_route=\/wp\/v2\/posts\/280\/revisions"}],"wp:attachment":[{"href":"https:\/\/li-yang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/li-yang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/li-yang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}