{"id":66,"date":"2016-05-11T12:24:06","date_gmt":"2016-05-11T04:24:06","guid":{"rendered":"http:\/\/www.lnzdl.com\/blog\/?p=66"},"modified":"2016-05-11T21:59:56","modified_gmt":"2016-05-11T13:59:56","slug":"%e5%b0%86%e6%a0%91%e8%8e%93%e6%b4%be%e5%8f%98%e6%88%90%e4%b8%80%e4%b8%aaweb%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"http:\/\/www.lnzdl.com\/blog\/%e5%b0%86%e6%a0%91%e8%8e%93%e6%b4%be%e5%8f%98%e6%88%90%e4%b8%80%e4%b8%aaweb%e6%9c%8d%e5%8a%a1%e5%99%a8\/","title":{"rendered":"\u5c06\u6811\u8393\u6d3e\u53d8\u6210\u4e00\u4e2aWeb\u670d\u52a1\u5668"},"content":{"rendered":"<p>\u5c06\u6811\u8393\u6d3e\u53d8\u6210\u4e00\u4e2aWeb\u670d\u52a1\u5668\uff0c\u901a\u8fc7\u8bbf\u95ee\u7f51\u9875\uff0c\u5c31\u53ef\u4ee5\u63a7\u5236\u6811\u8393\u6d3e\uff0c\u6bd4\u5982\uff1a\u67e5\u770b\u6444\u50cf\u5934\uff3c\u5f00\u706f\u7b49\u7b49\uff0e <\/p>\n<p>\u4e00\u60f3\u5230Linux Web\u670d\u52a1\u5668\uff0c\u6211\u4eec\u9996\u5148\u60f3\u5230\u7684\u662f\uff0cApache + MySql + Php\uff0e <\/p>\n<p>\u6811\u8393\u6d3e\u53ef\u4ee5\u5b89\u88c5\u8fd9\u4e2aLAMP\u7cfb\u5217\uff0c\u4f46Apache \u548c MySql\u5bf9\u4e8e\u6811\u8393\u6d3e\u8fd9\u4e2a\u5c0f\u5c0f\u7684\u673a\u5668\uff0c\u592a\u91cd\u4e86\uff0c\u4e3b\u8981\u662f\u6d88\u8017\u5185\u5b58\u591a\uff3c\u901f\u5ea6\u6162\uff3c\u5360\u7528\u78c1\u76d8\u5927(\u7ea6200M\u5427) <\/p>\n<p>\u6240\u4ee5\u8981\u5b89\u88c5\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684Web\u670d\u52a1\u5668\uff0e <\/p>\n<p>\u7ecf\u8bd5\u7528\uff0c\u63a8\u8350\u7ec4\u5408\u4e3a:&nbsp; nginx + php + sqlite <\/p>\n<p>&nbsp;&nbsp;&nbsp; nginx \u662f\u4e2a\u8f7b\u91cf\u7ea7\u7684Web\u670d\u52a1\u5668\uff0c\u6bd4Apache\u4e0d\u5dee <\/p>\n<p>&nbsp;&nbsp;&nbsp; sqlite \u662f\u4e2a\u6700\u8f7b\u91cf\u7ea7\u7684\u6570\u636e\u5e93 <\/p>\n<p>&nbsp;&nbsp;&nbsp; php&nbsp; \u5927\u5bb6\u90fd\u5f88\u719f\u6089\u4e86\uff0cWeb\u811a\u672c\u8bed\u8a00 <\/p>\n<p>1\uff0c\u5b89\u88c5nginx&nbsp; web\u670d\u52a1\u5668 (\u7ea66MB)<br \/>sudo apt-get install nginx <\/p>\n<p>2\uff0c\u542f\u52a8nginx<br \/>sudo \/etc\/init.d\/nginx start <\/p>\n<p>nginx\u7684www\u6839\u76ee\u5f55\u9ed8\u8ba4\u5728 \/usr\/share\/nginx\/www\u4e2d <\/p>\n<p>3\uff0c\u5b89\u88c5php\u548csqlite(\u7ea63MB)<br \/>sudo apt-get install php5-fpm php5-sqlite <\/p>\n<p>4\uff0c\u4fee\u6539nginx\u7684\u914d\u7f6e\u6587\u4ef6<br \/>sudo nano \/etc\/nginx\/sites-available\/default <\/p>\n<p>4.1\u3000\u627e\u5230listen\u884c\uff0c\u5c06\u5176\u524d\u9762\u7684#\u53f7\u6ce8\u91ca\u53bb\u6389\uff0c\u4fee\u6539\u540e\u5185\u5bb9\u5982\u4e0b<br \/>listen 80; ## listen for ipv4.<br \/>4.2\u3000\u627e\u5230index\u884c\uff0c\u52a0\u5165index.php\uff0c\u4fee\u6539\u540e\u5185\u5bb9\u5982\u4e0b<br \/>index index.php index.html index.htm<br \/>4.3\u3000\u627e\u5230php\u7684\u5b9a\u4e49\u6bb5\uff0c\u5c06\u8fd9\u4e9b\u884c\u7684\u6ce8\u91ca\u53bb\u6389 \uff0c\u4fee\u6539\u540e\u5185\u5bb9\u5982\u4e0b<br \/>location ~ \\.php$ {<br \/>\u3000fastcgi_pass unix:\/var\/run\/php5-fpm.sock;<br \/>\u3000fastcgi_index index.php;<br \/>\u3000include fastcgi_params;<br \/>} <\/p>\n<p>php\u6bb5\u4e2d\u6709\u4e00\u4e9b\u5176\u5b83\u5b9a\u4e49\uff0c\u4e0d\u8981\u53bb\u52a8\u5b83\uff0c\u6bd4\u5982\uff1a <\/p>\n<p>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fastcgi_split_path_info &#8230;<br \/>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fastcgi_pass 127.0.0.1:9000 <\/p>\n<p>5.\u91cd\u65b0\u52a0\u8f7dnginx\u7684\u914d\u7f6e<br \/>sudo \/etc\/init.d\/nginx reload <\/p>\n<p>6, \u6d4b\u8bd5\u4e00\u4e0b\uff0c\u901a\u8fc7\u4e3b\u673a\u7684IE\u8bbf\u95ee\u6811\u8393\u6d3e\uff0c\u53ef\u4ee5\u770b\u5230\u4e3b\u9875(\u8868\u793aWeb\u670d\u52a1\u5668\u5df2\u6b63\u5e38\u542f\u52a8) <\/p>\n<p><img decoding=\"async\" alt=\"1.png\" src=\"http:\/\/www.eeboard.com\/bbs\/data\/attachment\/forum\/201402\/19\/0904502phyxxxxkkk0spxj.png\" width=\"454\"> <\/p>\n<p>7. \u5728\u6811\u8393\u6d3e\u4e2d\u751f\u6210\u4e00php\u6587\u4ef6\uff0c\u6d4b\u8bd5\u4e00\u4e0bphp <\/p>\n<p>sudo nano \/usr\/share\/nginx\/www\/test.php <\/p>\n<p>\u5728\u6587\u4ef6\u4e2d\u8f93\u5165\u4ee5\u4e0b\u5185\u5bb9 <\/p>\n<p>&lt;?&nbsp; phpinfo(); ?&gt; <\/p>\n<p>\u5b58\u76d8\u9000\u51fa <\/p>\n<p>IE\u8bbf\u95ee\u4e00\u4e0b\u8fd9\u4e00\u9875\uff0c\u8bf4\u660ephp\u4e5f\u662fOK\u7684 <\/p>\n<p><img decoding=\"async\" alt=\"2.png\" src=\"http:\/\/www.eeboard.com\/bbs\/data\/attachment\/forum\/201402\/19\/090520yd7obfjb8yyjr18t.png\" width=\"454\"> <\/p>\n<p>8, \u6211\u4eec\u8fd8\u9700\u8981\u5b89\u88c5\u4e00\u4e2aftp\u670d\u52a1\u5668\uff0c\u7528\u4e8e\u5bf9web\u4e0a\u4e0b\u8f7d\u6587\u4ef6 <\/p>\n<p>\u5b89\u88c5vsftpd,\u7528\u4e8eweb\u5185\u5bb9\u7684ftpd\u4e0a\u4f20\uff0c\u5b89\u88c5\u65b9\u6cd5\u89c1<a href=\"http:\/\/www.eeboard.com\/bbs\/thread-27382-1-1.html\">\u6811\u8393\u6d3e(raspberry pi)\u5b66\u4e60\u4e4b\u5b89\u88c5ftp\u670d\u52a1\u5668<\/a> <\/p>\n<p>9\uff0c\u751f\u6210\u4e00\u4e2a\u7f51\u7ad9\u7ba1\u7406\u5458\u7528\u6237\uff0c\u7528\u4e8eftp\u4e0a\u4e0b\u8f7d\u7f51\u7ad9\u6587\u4ef6\uff0c\u5982\u4e0b <\/p>\n<p>\u589e\u52a0\u4e00\u4e2a\u7528\u6237\uff0c\u7528\u6237\u540d\u4e3awebadmin <\/p>\n<p>&nbsp;&nbsp;&nbsp; sudo useradd webadmin <\/p>\n<p>\u4fee\u6539\u7528\u6237webadmin\u7684\u5bc6\u7801<br \/>&nbsp;&nbsp;&nbsp; sudo passwd webadmin <\/p>\n<p>\u6309\u7cfb\u7edf\u63d0\u793a\uff0c\u8f93\u5165\u5bc6\u7801\uff0c\u4f8b\u5982\uff1a123456 <\/p>\n<p>\u8ba9\u7528\u6237webadmin\u62e5\u6709www\u6839\u76ee\u5f55\u7684\u6240\u6709\u6743<br \/>sudo chown -R webadmin \/usr\/share\/nginx\/www&nbsp; <\/p>\n<p>\u5c06\u7528\u6237webadmin\u7684\u767b\u5f55\u76ee\u5f55\u66f4\u6539\u4e3awww\u6839\u76ee\u5f55 <\/p>\n<p>sudo usermod -d \/usr\/share\/nginx\/www webadmin <\/p>\n<p>\u91cd\u542fvsftpd <\/p>\n<p>sudo service vsftpd restart <\/p>\n<p>OK\uff0c\u914d\u7f6e\u5b8c\u6210\uff0c\u7528\u6237webadmin\u767b\u5f55ftp\u540e\uff0c\u5c06\u76f4\u63a5\u8fdb\u5165www\u6839\u76ee\u5f55\uff0c\u5e76\u53ef\u4e0a\u4e0b\u8f7d\u6587\u4ef6\uff3c\u521b\u5efa\u76ee\u5f55\uff3c\u5220\u9664\u6587\u4ef6\u7b49\u7b49\uff0e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c06\u6811\u8393\u6d3e\u53d8\u6210\u4e00\u4e2aWeb\u670d\u52a1\u5668\uff0c\u901a\u8fc7\u8bbf\u95ee\u7f51\u9875\uff0c\u5c31\u53ef\u4ee5\u63a7\u5236\u6811\u8393\u6d3e\uff0c\u6bd4\u5982\uff1a\u67e5\u770b\u6444\u50cf\u5934\uff3c\u5f00\u706f\u7b49\u7b49\uff0e \u4e00\u60f3\u5230Linux Web\u670d\u52a1\u5668\uff0c\u6211\u4eec\u9996\u5148\u60f3\u5230\u7684\u662f\uff0cApache + MySql + Php\uff0e \u6811\u8393\u6d3e\u53ef\u4ee5\u5b89\u88c5\u8fd9\u4e2aLAMP\u7cfb\u5217\uff0c\u4f46Apache \u548c MySql\u5bf9\u4e8e\u6811\u8393\u6d3e\u8fd9\u4e2a\u5c0f\u5c0f\u7684\u673a\u5668\uff0c\u592a\u91cd\u4e86\uff0c\u4e3b\u8981\u662f\u6d88\u8017\u5185\u5b58\u591a\uff3c\u901f\u5ea6\u6162\uff3c\u5360\u7528\u78c1\u76d8\u5927(\u7ea6200M\u5427) \u6240\u4ee5\u8981\u5b89\u88c5\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684Web\u670d\u52a1\u5668\uff0e \u7ecf\u8bd5\u7528\uff0c\u63a8\u8350\u7ec4\u5408\u4e3a:&#038;nb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,8],"tags":[],"_links":{"self":[{"href":"http:\/\/www.lnzdl.com\/blog\/wp-json\/wp\/v2\/posts\/66"}],"collection":[{"href":"http:\/\/www.lnzdl.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.lnzdl.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.lnzdl.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.lnzdl.com\/blog\/wp-json\/wp\/v2\/comments?post=66"}],"version-history":[{"count":1,"href":"http:\/\/www.lnzdl.com\/blog\/wp-json\/wp\/v2\/posts\/66\/revisions"}],"predecessor-version":[{"id":67,"href":"http:\/\/www.lnzdl.com\/blog\/wp-json\/wp\/v2\/posts\/66\/revisions\/67"}],"wp:attachment":[{"href":"http:\/\/www.lnzdl.com\/blog\/wp-json\/wp\/v2\/media?parent=66"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.lnzdl.com\/blog\/wp-json\/wp\/v2\/categories?post=66"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.lnzdl.com\/blog\/wp-json\/wp\/v2\/tags?post=66"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}