{"id":192,"date":"2017-11-13T11:10:06","date_gmt":"2017-11-13T03:10:06","guid":{"rendered":"https:\/\/damogame.cn\/?p=192"},"modified":"2019-06-25T19:47:19","modified_gmt":"2019-06-25T11:47:19","slug":"%e7%a7%81%e4%ba%ba%e4%ba%91%e7%ac%94%e8%ae%b0-leanote-%e6%9c%8d%e5%8a%a1%e7%ab%af%e6%90%ad%e5%bb%ba%e6%8c%87%e5%8d%97-%e8%ae%a9%e8%87%aa%e5%b7%b1%e7%9a%84%e7%ac%94%e8%ae%b0%e6%97%a0%e5%a4%84%e4%b8%8d","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/192","title":{"rendered":"\u79c1\u4eba\u4e91\u7b14\u8bb0 Leanote \u670d\u52a1\u7aef\u642d\u5efa\u6307\u5357 \u8ba9\u81ea\u5df1\u7684\u7b14\u8bb0\u65e0\u5904\u4e0d\u5728"},"content":{"rendered":"<header class=\"entry-header\"><\/header>\n<div class=\"entry-content\">\n<p>\u6240\u5c5e\u5206\u7c7b\uff1a<a href=\"https:\/\/www.idaybreak.com\/category\/android-apps\/tutorial-guide\/\" rel=\"category tag\">\u6559\u7a0b\u6307\u5357<\/a><\/p>\n<div class=\"single-content\">\n<div id=\"log-box\">\n<div id=\"catalog\">\n<ul id=\"catalog-ul\">\n<li><i class=\"be be-arrowright\"><\/i>\u00a0<a title=\"\u5b89\u88c5\u524d\u51c6\u5907\u5de5\u4f5c\" href=\"https:\/\/www.idaybreak.com\/install-leanote-server.html#title-0\">\u5b89\u88c5\u524d\u51c6\u5907\u5de5\u4f5c<\/a><\/li>\n<li><i class=\"be be-arrowright\"><\/i>\u00a0<a title=\"\u5b89\u88c5 VPS \u73af\u5883\" href=\"https:\/\/www.idaybreak.com\/install-leanote-server.html#title-1\">\u5b89\u88c5 VPS \u73af\u5883<\/a><\/li>\n<li><i class=\"be be-arrowright\"><\/i>\u00a0<a title=\"\u4e86\u89e3 Leanote \u670d\u52a1\u7aef\" href=\"https:\/\/www.idaybreak.com\/install-leanote-server.html#title-2\">\u4e86\u89e3 Leanote \u670d\u52a1\u7aef<\/a><\/li>\n<li><i class=\"be be-arrowright\"><\/i>\u00a0<a title=\"\u5b89\u88c5 golang \u73af\u5883\" href=\"https:\/\/www.idaybreak.com\/install-leanote-server.html#title-3\">\u5b89\u88c5 golang \u73af\u5883<\/a><\/li>\n<li><i class=\"be be-arrowright\"><\/i>\u00a0<a title=\"\u83b7\u53d6 revel \u6e90\u7801\" href=\"https:\/\/www.idaybreak.com\/install-leanote-server.html#title-4\">\u83b7\u53d6 revel \u6e90\u7801<\/a><\/li>\n<li><i class=\"be be-arrowright\"><\/i>\u00a0<a title=\"\u83b7\u53d6 Leanote \u6e90\u7801\" href=\"https:\/\/www.idaybreak.com\/install-leanote-server.html#title-5\">\u83b7\u53d6 Leanote \u6e90\u7801<\/a><\/li>\n<li><i class=\"be be-arrowright\"><\/i>\u00a0<a title=\"\u5b89\u88c5 MongoDB \u6570\u636e\u5e93\" href=\"https:\/\/www.idaybreak.com\/install-leanote-server.html#title-6\">\u5b89\u88c5 MongoDB \u6570\u636e\u5e93<\/a><\/li>\n<li><i class=\"be be-arrowright\"><\/i>\u00a0<a title=\"\u521d\u59cb\u5316\u6570\u636e\u5e93\" href=\"https:\/\/www.idaybreak.com\/install-leanote-server.html#title-7\">\u521d\u59cb\u5316\u6570\u636e\u5e93<\/a><\/li>\n<li><i class=\"be be-arrowright\"><\/i>\u00a0<a title=\"\u914d\u7f6e Leanote \u670d\u52a1\u7aef\" href=\"https:\/\/www.idaybreak.com\/install-leanote-server.html#title-8\">\u914d\u7f6e Leanote \u670d\u52a1\u7aef<\/a><\/li>\n<li><i class=\"be be-arrowright\"><\/i>\u00a0<a title=\"\u8fd0\u884c Leanote \u670d\u52a1\u7aef\" href=\"https:\/\/www.idaybreak.com\/install-leanote-server.html#title-9\">\u8fd0\u884c Leanote \u670d\u52a1\u7aef<\/a><\/li>\n<li><i class=\"be be-arrowright\"><\/i>\u00a0<a title=\"\u914d\u7f6e\u5f00\u673a\u542f\u52a8\" href=\"https:\/\/www.idaybreak.com\/install-leanote-server.html#title-10\">\u914d\u7f6e\u5f00\u673a\u542f\u52a8<\/a><\/li>\n<li><i class=\"be be-arrowright\"><\/i>\u00a0<a title=\"\u914d\u7f6e https\" href=\"https:\/\/www.idaybreak.com\/install-leanote-server.html#title-11\">\u914d\u7f6e https<\/a><\/li>\n<li><i class=\"be be-arrowright\"><\/i>\u00a0<a title=\"\u4e0b\u8f7d\u5ba2\u6237\u7aef\" href=\"https:\/\/www.idaybreak.com\/install-leanote-server.html#title-12\">\u4e0b\u8f7d\u5ba2\u6237\u7aef<\/a><\/li>\n<\/ul>\n<p><span class=\"log-zd\"><span class=\"log-close\"><a title=\"\u9690\u85cf\u76ee\u5f55\"><i class=\"be be-cross\"><\/i><strong>\u76ee\u5f55<\/strong><\/a><\/span><\/span><\/p>\n<\/div>\n<\/div>\n<p><a class=\"fancybox\" href=\"https:\/\/www.idaybreak.com\/wp-content\/uploads\/leanote_article_banner.png\" target=\"_bland\" data-fancybox-group=\"button\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3304\" src=\"https:\/\/www.idaybreak.com\/wp-content\/uploads\/leanote_article_banner.png\" sizes=\"auto, (max-width: 930px) 100vw, 930px\" srcset=\"https:\/\/www.idaybreak.com\/wp-content\/uploads\/leanote_article_banner.png 930w, https:\/\/www.idaybreak.com\/wp-content\/uploads\/leanote_article_banner-150x71.png 150w, https:\/\/www.idaybreak.com\/wp-content\/uploads\/leanote_article_banner-300x142.png 300w, https:\/\/www.idaybreak.com\/wp-content\/uploads\/leanote_article_banner-768x363.png 768w\" alt=\"\u79c1\u4eba\u4e91\u7b14\u8bb0 Leanote \u670d\u52a1\u7aef\u642d\u5efa\u6307\u5357 \u8ba9\u81ea\u5df1\u7684\u7b14\u8bb0\u65e0\u5904\u4e0d\u5728\" width=\"930\" height=\"440\" \/><\/a><\/p>\n<p>\u4e4b\u524d\u4e00\u76f4\u7528\u00a0<a title=\"\u70b9\u51fb\u6b64\u5904\u6253\u5f00\u94fe\u63a5\" href=\"https:\/\/www.idaybreak.com\/go.php?https:\/\/play.google.com\/store\/apps\/details?id=com.google.android.keep\" target=\"_bland\" rel=\"noopener noreferrer\">Google Keep<\/a>\u00a0\u6765\u540c\u6b65\u7b14\u8bb0\uff0c\u4f46\u662f\u7531\u4e8e\u90a3\u9053\u957f\u57ce\u7816\u5934\u5bfc\u81f4\u5fc5\u987b\u6302\u68af\u5b50\u624d\u80fd\u540c\u6b65\uff0c\u7d27\u6025\u60c5\u51b5\u9700\u8981\u540c\u6b65\u65f6\u7565\u9ebb\u70e6\uff0c\u4e8e\u662f\u6539\u7528\u81ea\u5df1\u7684 NAS \u540c\u6b65\u7b14\u8bb0\uff0c\u4f46\u662f NAS \u5bfc\u51fa\u7684\u5907\u4efd\u683c\u5f0f\u4e0d\u901a\u7528\uff0c\u6570\u636e\u4e22\u5931\u540e\u6062\u590d\u8d77\u6765\u4e0d\u65b9\u4fbf\u4e5f\u4e0d\u5b89\u5168\uff0c\u4e00\u756a\u6298\u817e\u540e\u51b3\u5b9a\u627e\u4e2a\u5f00\u6e90\u4e91\u7b14\u8bb0\u670d\u52a1\u7aef\u6765\u642d\u5efa\uff0c\u5728\u81ea\u5df1\u53ef\u63a7\u7684\u8303\u56f4\u5185\u540c\u6b65\u7b14\u8bb0\u603b\u5f52\u662f\u5b89\u5168\u7684\u3002<\/p>\n<p>\u8fd9\u6b3e\u5f00\u6e90\u4e91\u7b14\u8bb0\u53eb\u4f5c\u00a0<strong>Leanote<\/strong>\uff08\u4e2d\u6587\u540d\u201c\u8682\u8681\u7b14\u8bb0\u201d\uff09\uff0c\u6a2a\u8de8 Windows\u3001MacOS\u3001Android\u3001iOS\u3001Linux \u591a\u5e73\u53f0\uff0c\u652f\u6301\u5bcc\u6587\u672c\u548c Markdown \u6587\u672c\u683c\u5f0f\uff0c\u81ea\u7531\u5ea6\u975e\u5e38\u4e4b\u9ad8\uff0c\u4f60\u53ef\u4ee5\u8ba9\u7b14\u8bb0\u5185\u5bb9\u73a9\u51fa\u65b0\u82b1\u6837\u6765\u3002\u9664\u4e86\u4e3b\u6253\u7684\u7b14\u8bb0\u540c\u6b65\u3001\u7f16\u8f91\u529f\u80fd\u5916\uff0c\u8fd8\u652f\u6301\u5f00\u8bbe\u535a\u5ba2\uff0c\u5c55\u793a\u4f60\u516c\u5f00\u7684\u7b14\u8bb0\u5185\u5bb9\u3002\u535a\u5ba2\u8fd9\u529f\u80fd\u89c1\u4ec1\u89c1\u667a\uff0c\u6211\u4e3b\u8981\u5bf9\u5b83\u7684\u4e91\u540c\u6b65\u548c\u7b14\u8bb0\u7f16\u8f91\u529f\u80fd\u6bd4\u8f83\u6ee1\u610f\u3002\u603b\u4f53\u6765\u8bf4 Leanote \u4f7f\u7528\u8d77\u6765\u633a\u987a\u624b\uff0c\u624b\u673a\u7aef App \u5373\u5f00\u5373\u7528\uff0c\u642d\u5efa\u4e86\u7a33\u5b9a\u7684\u670d\u52a1\u7aef\u540e\u975e\u5e38\u9002\u5408\u65e5\u5e38\u8bb0\u4e8b\u3002<\/p>\n<p>\u4e0b\u9762\u5c06\u670d\u52a1\u7aef\u642d\u5efa\u7684\u6b65\u9aa4\u5206\u4eab\u51fa\u6765\uff0c\u7ed9\u9700\u8981\u4f7f\u7528\u79c1\u4eba\u4e91\u7b14\u8bb0\u7684\u7b52\u5b50\u4eec\u3002\u5e9f\u8bdd\u4e0d\u591a\u8bf4\uff0c\u76f4\u63a5\u5f00\u59cb\u6559\u7a0b\u3002<\/p>\n<h4 id=\"title-0\">\u5b89\u88c5\u524d\u51c6\u5907\u5de5\u4f5c<\/h4>\n<ol>\n<li><em><u>\u57fa\u7840<\/u><\/em>\uff1a\u9996\u5148\u4f60\u8981\u6709\u6700\u6700\u6700\u57fa\u672c\u7684\u7f51\u7ad9\u642d\u5efa\u548c Linux \u57fa\u7840\uff0c\u5426\u5219\u4e0d\u5efa\u8bae\u4f60\u770b\u4e0b\u53bb\u3002<\/li>\n<li><em><u>\u57df\u540d<\/u><\/em>\uff1a\u53bb\u6ce8\u518c\u4e2a\u57df\u540d\uff0c\u4e0d\u8d35\uff0c\u963f\u91cc\u4e91\u6ce8\u518c\u4e00\u4e2a\u57df\u540d\u9996\u5e74\u51e0\u5341\u5757 RMB\u3002<\/li>\n<li><em><u>VPS<\/u><\/em>\uff1a\u53ef\u4ee5\u4e70\u4e2a\u56fd\u5916\u7684 VPS\uff0c\u670d\u52a1\u3001\u901f\u5ea6\u3001\u7a33\u5b9a\u3001\u4ef7\u683c\u90fd\u6bd4\u8f83\u5747\u8861\u7684\u56fd\u5916 VPS \u4e00\u4e2a\u6708\u6700\u591a\u4e5f\u4e0d\u4f1a\u8d85 100 RMB\u3002Linode\u3001Vultr\u3001DigitalOcean \u8fd9\u51e0\u4e2a\u6bd4\u8f83\u7a33\u5b9a\uff0c\u90fd\u53ef\u4ee5\u8bd5\u8bd5\uff0c\u54ea\u4e2a\u4fbf\u5b9c\u6311\u54ea\u4e2a\u3002<\/li>\n<\/ol>\n<h4 id=\"title-1\">\u5b89\u88c5 VPS \u73af\u5883<\/h4>\n<p>\u5982\u4f55\u4e70 VPS \u5c31\u4e0d\u591a\u8bf4\u4e86\uff0c\u767e\u5ea6\u4e00\u4e0b\u5c31\u77e5\u9053\u3002\u76f4\u63a5\u5f00\u59cb\u8bb2\u642d\u5efa VPS \u73af\u5883\u3002\u8fd9\u91cc\u63a8\u8350\u7528\u00a0<strong>lnmp\uff08Linux + Nginx + MySQL + PHP\uff09<\/strong>\uff0c\u642d\u5efa Leanote \u914d\u7f6e\u8d77\u6765\u4f1a\u8f7b\u677e\u4e00\u4e9b\u3002<\/p>\n<p>\u8fd9\u91cc\u662f lnmp \u7684\u5b98\u65b9\u5b89\u88c5\u6559\u7a0b #<a title=\"\u70b9\u51fb\u6b64\u5904\u6253\u5f00\u94fe\u63a5\" href=\"https:\/\/www.idaybreak.com\/go.php?https:\/\/lnmp.org\/install.html\" target=\"_bland\" rel=\"noopener noreferrer\">\u70b9\u6211\u8fdb\u5165<\/a>#\uff0c\u6309\u7167\u5b98\u65b9\u7684\u6b65\u9aa4\u5b89\u88c5\u5373\u53ef\u3002SSH \u5de5\u5177\u63a8\u8350\u7528\u00a0<a title=\"\u70b9\u51fb\u94fe\u63a5\u5f00\u59cb\u4e0b\u8f7d\" href=\"https:\/\/www.idaybreak.com\/\/download\/tools\/Xshell_5.0.1124_Portable.zip\" target=\"_bland\" rel=\"noopener noreferrer\">XShell<\/a>\uff0cFTP \u5de5\u5177\u63a8\u8350\u7528\u00a0<a title=\"\u70b9\u51fb\u94fe\u63a5\u5f00\u59cb\u4e0b\u8f7d\" href=\"https:\/\/www.idaybreak.com\/go.php?https:\/\/winscp.net\/\" target=\"_bland\" rel=\"noopener noreferrer\">WinSCP<\/a>\u3002<\/p>\n<p>lnmp \u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u5148\u9009\u62e9\u5b89\u88c5 Nginx\uff08\u65b9\u4fbf\u540e\u9762\u66f4\u6539 Leanote \u7684 SSL \u914d\u7f6e\uff09\uff0cMySQL \u5efa\u8bae\u9009\u62e9\u9ed8\u8ba4\u7248\u672c 5.5.48\u3002PHP \u7248\u672c\u6839\u636e\u4f60\u4e70\u7684 VPS \u914d\u7f6e\u5b9a\uff0c\u6709 1G \u6216\u4ee5\u4e0a\u5185\u5b58\u7684\u53ef\u4ee5\u9009\u62e9 5.6 \u6216\u4ee5\u4e0a\u7248\u672c\uff0c\u4e2a\u4eba\u5efa\u8bae\u9009 5.6.22\u3002\u540e\u9762\u7684\u6b65\u9aa4\u8ddf\u7740\u63d0\u793a\u4e00\u8def\u5f80\u4e0b\u8d70\uff0c\u76f4\u81f3\u5b89\u88c5\u5b8c\u6210\u3002<\/p>\n<p>\u4e0b\u9762\u7684\u6b65\u9aa4\u4f1a\u7528\u5230\u4e00\u4e9b\u5de5\u5177\uff0c\u4f8b\u5982 wget\uff0c\u5982\u679c\u4f60\u7684\u7cfb\u7edf\u6ca1\u6709\u7684\u8bdd\uff0c\u53ef\u4ee5\u76f4\u63a5\u5b89\u88c5\uff0c\u4f8b\u5982 CentOS \u7528\u547d\u4ee4\u00a0<code>yum install **<\/code>\u00a0\u5b89\u88c5\uff0cDebian\u3001Ubuntu \u7528\u547d\u4ee4\u00a0<code>apt-get install **<\/code>\u00a0\u5b89\u88c5\u3002<\/p>\n<h4 id=\"title-2\">\u4e86\u89e3 Leanote \u670d\u52a1\u7aef<\/h4>\n<p>Leanote \u670d\u52a1\u7aef\u662f\u7528 golang \u7f16\u5199\u7684\uff0c\u5b98\u65b9\u6587\u6863\u4e2d\u8bf4\u660e\u9700\u8981\u7528 revel Web \u6846\u67b6\u6765\u8fd0\u884c\u670d\u52a1\u7aef\uff0c\u4f7f\u7528\u7684\u662f MongoDB \u6570\u636e\u5e93\uff0c\u56e0\u6b64\u6211\u4eec\u8981\u5728 VPS \u4e2d\u914d\u7f6e\u597d golang\u3001revel \u73af\u5883\u548c MongoDB \u6570\u636e\u5e93\u3002<\/p>\n<p>\u5982\u4e0a\u9762\u6240\u8bf4\uff0c\u628a Leanote \u4e22\u5230\u865a\u62df\u7a7a\u95f4\u91cc\u8fd0\u884c\u4e0d\u592a\u73b0\u5b9e\uff0c\u800c\u4e14\u4e0d\u5229\u4e8e\u540e\u9762\u5f00\u542f https \u8bbf\u95ee\uff0c\u6240\u4ee5\u4e0b\u9762\u8fd8\u662f\u6309\u90e8\u5c31\u73ed\u7ee7\u7eed\u5b89\u88c5\u3002<\/p>\n<p><u>\u603b\u7ed3\u5c31\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a<\/u><\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>\u5b89\u88c5 golang \u73af\u5883<\/li>\n<li>\u4e0b\u8f7d revel Web \u6846\u67b6\u548c Leanote \u6e90\u7801<\/li>\n<li>\u5b89\u88c5 MongoDB \u6570\u636e<\/li>\n<li>\u521d\u59cb\u5316\u6570\u636e\u5e93<\/li>\n<li>\u914d\u7f6e Leanote \u670d\u52a1\u7aef<\/li>\n<li>\u8fd0\u884c Leanote \u670d\u52a1\u7aef<\/li>\n<li>\u914d\u7f6e\u5f00\u673a\u542f\u52a8<\/li>\n<li>\u914d\u7f6e https<\/li>\n<li>\u4e0b\u8f7d\u5ba2\u6237\u7aef<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h4 id=\"title-3\">\u5b89\u88c5 golang \u73af\u5883<\/h4>\n<p>\u7528 XShell \u8fde\u63a5 VPS\uff0c\u8fdb\u5165 \/root\uff08\u8fdb\u5165 \/root \u76ee\u5f55\u662f\u4e2a\u4eba\u4e60\u60ef\uff0c\u4f60\u4e5f\u53ef\u4ee5\u8fdb\u5165\u5176\u5b83\u76ee\u5f55\u8fdb\u884c\u5b89\u88c5\uff0c\u672c\u6587\u4ee5 \/root \u76ee\u5f55\u4e3a\u4f8b\u8bb2\u89e3\uff09\u3002\u7528 wget \u547d\u4ee4\u4e0b\u8f7d golang \u6e90\u7801\u3002\u8fdb\u5165\u00a0<a title=\"\u70b9\u51fb\u6b64\u5904\u6253\u5f00\u94fe\u63a5\" href=\"https:\/\/www.idaybreak.com\/go.php?https:\/\/golang.org\/\" target=\"_bland\" rel=\"noopener noreferrer\">golang \u5b98\u7f51<\/a>\uff0c\u70b9\u51fb\u5b98\u7f51\u4e2d\u7684 \u201cGetting Started \u2192 Download Go \u2192 Linux\u201d \u83b7\u5f97\u4e0b\u8f7d\u94fe\u63a5\uff0c\u7136\u540e\u7528 wget \u547d\u4ee4\u4e0b\u8f7d\u6e90\u7801\u5305\u3002\u622a\u6b62\u5230\u672c\u6587\u53d1\u51fa\u4e3a\u6b62\uff0cgolang \u6700\u65b0\u7248\u672c\u662f 1.8\uff0c\u5c31\u8f93\u5165\u4e0b\u9762\u7684\u547d\u4ee4\uff1a<\/p>\n<p><code>wget https:\/\/storage.googleapis.com\/golang\/go1.8.linux-amd64.tar.gz<\/code><\/p>\n<p>\u89e3\u538b<\/p>\n<p><code>tar -xzvf go1.3.1.linux-amd64.tar.gz<\/code><\/p>\n<p>\u521b\u5efa\u6587\u4ef6\u5939 gopackage \u7528\u4e8e\u5b58\u653e golang \u7684\u7a0b\u5e8f\u5305<\/p>\n<p><code>mkdir gopackage<\/code><\/p>\n<p>\u7f16\u8f91 \/etc\/profile \u914d\u7f6e\u6587\u4ef6\uff0c\u6dfb\u52a0 golang \u73af\u5883\u53d8\u91cf<\/p>\n<p><code>vi \/etc\/profile<\/code><br \/>\n\u6309 i \u952e\u8fdb\u5165\u7f16\u8f91\u6a21\u5f0f\uff0c\u5c06\u4e0b\u9762\u7684\u73af\u5883\u53d8\u91cf\u52a0\u5165 profile\uff0c\u5b8c\u6210\u540e\u6309 Esc \u952e\uff0c\u7136\u540e\u8f93\u5165\u00a0<code>:wq!<\/code>\u00a0\u540e\u6572\u56de\u8f66\u4fdd\u5b58\uff08\u6211\u662f\u5728 \/root \u76ee\u5f55\u5b89\u88c5\u7684\uff0c\u5982\u679c\u4f60\u9009\u62e9\u7684\u662f\u5176\u5b83\u76ee\u5f55\uff0c\u8981\u81ea\u5df1\u66f4\u6539\u53d8\u91cf\u4e2d\u7684\u8def\u5f84\uff09\uff1a<\/p>\n<p>export GOROOT=\/root\/go<br \/>\nexport GOPATH=\/root\/gopackage<br \/>\nexport PATH=$PATH:$GOROOT\/bin:$GOPATH\/bin<\/p>\n<p>\u8f93\u5165\u547d\u4ee4\u4f7f\u73af\u5883\u53d8\u91cf\u751f\u6548\uff1a<\/p>\n<p><code>source \/etc\/profile<\/code><\/p>\n<p>\u8f93\u5165\u547d\u4ee4\u68c0\u67e5 golang \u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<p><code>go version<\/code><\/p>\n<p>\u82e5\u5b89\u88c5\u6210\u529f\uff0c\u5219\u4f1a\u663e\u793a golang \u7248\u672c\u53f7\u3002<\/p>\n<h4 id=\"title-4\">\u83b7\u53d6 revel \u6e90\u7801<\/h4>\n<p>\u5b89\u88c5 git \u5de5\u5177\u3002\u82e5\u662f CentOS\uff0c\u8f93\u5165\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p><code>yum install -y git<\/code><\/p>\n<p>\u82e5\u662f Debian\/Ubuntu \uff0c\u8f93\u5165\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p><code>sudo apt-get install git-core mercurial openssh-server openssh-client<\/code><\/p>\n<p>\u8f93\u5165\u547d\u4ee4\u4e0b\u8f7d revel Web \u6846\u67b6\u6e90\u7801\uff0c\u4e0b\u8f7d\u901f\u5ea6\u89c6\u7f51\u7edc\u60c5\u51b5\u800c\u5b9a\uff0c\u53ef\u80fd\u65f6\u95f4\u6709\u70b9\u957f\uff0c\u8010\u5fc3\u7b49\u5f85\uff1a<\/p>\n<p><code>go get github.com\/revel\/cmd\/revel<\/code><\/p>\n<h4 id=\"title-5\">\u83b7\u53d6 Leanote \u6e90\u7801<\/h4>\n<p>\u4e0a\u9762\u5df2\u7ecf\u521b\u5efa\u4e86 gopackage \u6587\u4ef6\u5939\u7528\u4e8e\u5b58\u653e\u7a0b\u5e8f\u6e90\u7801\u5305\uff0c\u56e0\u6b64\u6211\u4eec\u53ea\u9700\u8981\u4e0b\u8f7d\u597d revel \u548c Leanote \u670d\u52a1\u7aef\u7684\u6e90\u7801\u5305\uff0c\u7136\u540e\u89e3\u538b\u653e\u5165 gopackage \u6587\u4ef6\u5939\u5373\u53ef\u3002<\/p>\n<p>\u63a5\u4e0a\u9762\u7684\u6b65\u9aa4\uff0c\u5f53\u524d\u5904\u4e8e \/root \u76ee\u5f55\uff0c\u8fdb\u5165 gopackage \u6587\u4ef6\u5939\uff1a<\/p>\n<p><code>cd gopackage<\/code><\/p>\n<p>\u4e0b\u8f7d Leanote \u670d\u52a1\u7aef\u6e90\u7801\uff08\u82e5\u547d\u4ee4\u4e0b\u8f7d\u4e0d\u6210\u529f\u7684\u8bdd\uff0c\u53ef\u4ee5\u624b\u52a8\u4e0b\u8f7d\u540e\u7528 FTP \u5de5\u5177\u4e0a\u4f20\u5230 gopackage \u6587\u4ef6\u5939\uff09\uff1a<\/p>\n<p><code>wget https:\/\/github.com\/leanote\/leanote-all\/archive\/master.zip<\/code><\/p>\n<p>\u89e3\u538b\uff1a<\/p>\n<p><code>unzip leanote-all-master.zip<\/code><\/p>\n<p>\u5c06\u89e3\u538b\u51fa\u6765\u7684 leanote-all-master \u6587\u4ef6\u5939\u5185\u7684 src \u6587\u4ef6\u5939\u79fb\u5230 gopackage \u6587\u4ef6\u5939\u5185\uff1a<\/p>\n<p><code>mv \/root\/gopackage\/leanote-all-master\/src \/root\/gopackage<\/code><\/p>\n<p>Leanote \u670d\u52a1\u7aef\u7684\u6e90\u7801\u6587\u4ef6\u5728\u76ee\u5f55 \/root\/gopackage\/src\/github.com\/leanote\/leanote \u4e2d\u3002\u4ee5\u540e\u8981\u4fee\u6539\u9875\u9762\u6548\u679c\u7684\u8bdd\u8fdb\u5165\u8fd9\u4e2a\u76ee\u5f55\u67e5\u627e\u76f8\u5e94\u7684\u6587\u4ef6\u8fdb\u884c\u4fee\u6539\u3002<\/p>\n<h4 id=\"title-6\">\u5b89\u88c5 MongoDB \u6570\u636e\u5e93<\/h4>\n<p>\u76ee\u524d MongoDB \u6570\u636e\u5e93\u6709 2.x \u548c 3.x \u4e24\u7c7b\u7248\u672c\uff0c\u4e2a\u4eba\u5efa\u8bae\u9009\u62e9 3.x \u7248\uff0c\u7248\u672c\u7528\u65b0\u4e0d\u7528\u65e7\u3002\u4e0b\u9762\u4ee5\u5b89\u88c5 3.x \u7248\u4e3a\u4f8b\u8bb2\u89e3\u3002<\/p>\n<p>\u56de\u5230 \/root \u76ee\u5f55\uff1a<\/p>\n<p><code>cd ~<\/code><\/p>\n<p>\u521b\u5efa mongodb \u6587\u4ef6\u5939\uff0c\u7528\u4e0e\u5b58\u653e MongoDB \u6570\u636e\u5e93\u6e90\u7801\u548c\u6570\u636e\u5e93\u6587\u4ef6\uff1a<\/p>\n<p><code>mkdir mongodb<\/code><\/p>\n<p>\u8fdb\u5165 mongodb \u6587\u4ef6\u5939\uff0c\u4e0b\u8f7d MongoDB \u6570\u636e\u5e93\u6e90\u7801\u5e76\u89e3\u538b\uff1a<\/p>\n<p><code>cd mongodb<\/code><br \/>\n<code>wget https:\/\/fastdl.mongodb.org\/linux\/mongodb-linux-x86_64-3.0.1.tgz<\/code><br \/>\n<code>tar -xzvf mongodb-linux-x86_64-3.0.1.tgz<\/code><\/p>\n<p>\u7f16\u8f91 \/etc\/profile \u914d\u7f6e\u6587\u4ef6\uff0c\u6dfb\u52a0 MongoDB \u6570\u636e\u5e93\u7684\u73af\u5883\u53d8\u91cf\uff1a<\/p>\n<p><code>vi \/etc\/profile<\/code><\/p>\n<p>\u6309 i \u952e\u8fdb\u5165\u7f16\u8f91\u6a21\u5f0f\uff0c\u5c06\u4e0b\u9762\u7684\u73af\u5883\u53d8\u91cf\u52a0\u5165 profile\uff0c\u5b8c\u6210\u540e\u6309 Esc \u952e\uff0c\u7136\u540e\u8f93\u5165\u00a0<code>:wq!<\/code>\u00a0\u540e\u6572\u56de\u8f66\u4fdd\u5b58\uff1a<\/p>\n<p><code>export PATH=$PATH:\/root\/mongodb\/mongodb-linux-x86_64-3.0.1\/bin<\/code><\/p>\n<p>\u8f93\u5165\u547d\u4ee4\u4f7f\u73af\u5883\u53d8\u91cf\u751f\u6548\uff1a<\/p>\n<p><code>source \/etc\/profile<\/code><\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u7528\u4e8e\u5b58\u653e\u6570\u636e\u5e93\u7684\u6587\u4ef6\u5939\uff1a<\/p>\n<p><code>mkdir data<\/code><\/p>\n<p>#\u8fd0\u884c\u6570\u636e\u5e93\uff08\u5207\u5165\u540e\u53f0\u8fd0\u884c\uff09\uff1a<\/p>\n<p><code>nohup mongod --dbpath \/root\/mongodb\/data 2&gt;&amp;1 &amp;<\/code><\/p>\n<h4 id=\"title-7\">\u521d\u59cb\u5316\u6570\u636e\u5e93<\/h4>\n<p>\u7531\u4e8e\u6211\u4eec\u5b89\u88c5\u7684\u662f MongoDB 3.x \u7248\u672c\uff0c\u56e0\u6b64\u8981\u8f93\u5165\u5bf9\u5e94 3.x \u7248\u672c\u7684\u547d\u4ee4\u6765\u521d\u59cb\u5316\u6570\u636e\u5e93\uff1a\uff08\u6211\u662f\u5728 \/root \u76ee\u5f55\u5b89\u88c5\u7684\uff0c\u5982\u679c\u4f60\u9009\u62e9\u7684\u662f\u5176\u5b83\u76ee\u5f55\uff0c\u8981\u81ea\u5df1\u66f4\u6539\u547d\u4ee4\u4e2d\u7684\u8def\u5f84\uff09<\/p>\n<p><code>mongorestore -h localhost -d leanote --dir \/root\/gopackage\/src\/github.com\/leanote\/leanote\/mongodb_backup\/leanote_install_data<\/code><\/p>\n<h4 id=\"title-8\">\u914d\u7f6e Leanote \u670d\u52a1\u7aef<\/h4>\n<p>\u8fdb\u5165 Leanote \u670d\u52a1\u7aef\u914d\u7f6e\u6587\u4ef6 app.conf \u6240\u5728\u7684\u76ee\u5f55\uff1a<\/p>\n<p><code>cd ~<\/code><br \/>\n<code>cd gopackage\/src\/github.com\/leanote\/leanote\/conf<\/code><\/p>\n<p>\u7f16\u8f91 app.conf \u914d\u7f6e\u6587\u4ef6\uff0c\u6309\u7167\u4e0b\u9762\u7684\u6807\u6ce8\u4fee\u6539\uff0c\u5b8c\u6210\u540e\u6309 Esc \u952e\uff0c\u7136\u540e\u8f93\u5165\u00a0<code>:wq!<\/code>\u00a0\u540e\u6572\u56de\u8f66\u4fdd\u5b58\uff08\u5982\u679c\u4e0d\u60f3\u7528 vi \u4fee\u6539\u7684\u8bdd\uff0c\u53ef\u4ee5\u7528 FTP \u5de5\u5177\u6253\u5f00\u914d\u7f6e\u6587\u4ef6\u8fdb\u884c\u4fee\u6539\uff09\uff1a<\/p>\n<p><code>vi app.conf<\/code><\/p>\n<p># \u8bbf\u95ee\u7aef\u53e3 \u53ef\u4ee5\u81ea\u5b9a\u4e49<br \/>\nhttp.port=9000<br \/>\n# \u8bbf\u95ee\u57df\u540d<br \/>\nsite.url=http:\/\/<br \/>\n# \u7ba1\u7406\u5458\u7528\u6237\u540d\uff08\u9ed8\u8ba4\u7528\u6237\u540dadmin\uff0c\u5bc6\u7801abc123\uff09<br \/>\nadminUsername=admin<br \/>\n# MongoDB \u6570\u636e\u5e93\u914d\u7f6e<br \/>\ndb.host=127.0.0.1<br \/>\ndb.port=27017<br \/>\ndb.dbname=leanote<br \/>\ndb.username=\u00a0#\u81ea\u5b9a\u4e49\u6570\u636e\u5e93\u5e10\u6237<br \/>\ndb.password=\u00a0#\u81ea\u5b9a\u4e49\u6570\u636e\u5e93\u5e10\u6237\u5bc6\u7801<br \/>\nmongodb:\/\/root:root123@localhost:27017\/leanote<br \/>\n# app\u5bc6\u94a5 \u5fc5\u987b\u8981\u81ea\u5df1\u4fee\u6539 \u968f\u4fbf\u6539\u6210\u4efb\u610f\u5927\u5c0f\u5199\u5b57\u6bcd\u52a0\u6570\u5b57\u7ec4\u5408<br \/>\napp.secret=OIJiokioHoIOHUY072893bhJHui765GHjkgjJK8989GVghUIY788<\/p>\n<p>\u53e6\u5916\uff0c\u5efa\u8bae\u589e\u52a0\u4e00\u4e2a\u6570\u636e\u5e93\u5e10\u6237\uff0c\u5f00\u542f\u6570\u636e\u5e93\u5e10\u6237\u9a8c\u8bc1\uff0c\u5426\u5219\u4f1a\u6709\u5b89\u5168\u9690\u60a3\u3002\u6211\u4eec\u5b89\u88c5\u7684\u662f 3.x \u7248 MongoDB\uff0c\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u521b\u5efa\u6570\u636e\u5e93\u5e10\u6237\uff0c\u7136\u540e\u5c06\u5e10\u6237\u586b\u5230\u4e0a\u9762\u7684\u914d\u7f6e\u91cc\uff08db.username \u548c db.password \u8fd9\u4e24\u9879\uff09\u3002<\/p>\n<p>#\u8fdb\u5165 MongoDB \u6570\u636e\u5e93\u547d\u4ee4\u6a21\u5f0f<\/p>\n<p><code>mongo<\/code><\/p>\n<p>#\u5207\u6362\u81f3 leanote \u6570\u636e\u5e93<\/p>\n<p><code>use leanote<\/code><\/p>\n<p>#\u5c06 root \u548c abc123 \u6539\u6210\u60a8\u60f3\u8981\u7684\u5e10\u6237\u540d\u548c\u5bc6\u7801<\/p>\n<p><code>db.addUser(\"root\", \"abc123\");{\"_id\" : ObjectId(\"53688d1950cc1813efb9564c\"),\"user\" :\"root\",\"readOnly\" : false,\"pwd\" : \"e014bfea4a9c3c27ab34e50bd1ef0955\"}<\/code><\/p>\n<p>#\u6d4b\u8bd5\u5e10\u6237\u662f\u5426\u6dfb\u52a0\u6210\u529f\u4ee5\u53ca\u5bc6\u7801\u662f\u5426\u6b63\u786e\uff0c\u8fd4\u56de\u6570\u503c 1 \u5373\u8868\u793a\u6210\u529f<\/p>\n<p><code>db.auth(\"root\", \"abc123\");<\/code><\/p>\n<h4 id=\"title-9\">\u8fd0\u884c Leanote \u670d\u52a1\u7aef<\/h4>\n<p>\u8f93\u5165\u547d\u4ee4\u8fd0\u884c Leanote \u670d\u52a1\u7aef\uff08\u5207\u5165\u540e\u53f0\u8fd0\u884c\uff09\uff1a<\/p>\n<p><code>nohup revel run github.com\/leanote\/leanote 2&gt;&amp;1 &amp;<\/code><\/p>\n<p>\u57df\u540d\u7ed1\u5b9a VPS \u4e3b\u673a IP\uff0c\u89e3\u6790\u5b8c\u6210\u540e\u5373\u901a\u8fc7\u57df\u540d\u53ef\u6b63\u5e38\u8bbf\u95ee Leanote \u9996\u9875<\/p>\n<h4 id=\"title-10\">\u914d\u7f6e\u5f00\u673a\u542f\u52a8<\/h4>\n<p>\u867d\u7136\u901a\u8fc7\u547d\u4ee4\u8ba9 Leanote \u8fdb\u7a0b\u8fdb\u5165\u540e\u53f0\u8fd0\u884c\u4e86\uff0c\u4f46\u662f\u4e00\u65e6\u91cd\u542f\u8fd8\u662f\u8981\u624b\u52a8\u5f00\u542f\uff0c\u7565\u9ebb\u70e6\uff0c\u8fd9\u65f6\u53ef\u4ee5\u81ea\u5df1\u65b0\u5efa *.sh \u811a\u672c\u6587\u4ef6\uff0c\u5c06\u547d\u4ee4\u5199\u5165\u811a\u672c\u6587\u4ef6\u91cc\uff0c\u7136\u540e\u5728 rc.local \u914d\u7f6e\u6587\u4ef6\u4e2d\u8fd0\u884c *.sh \u811a\u672c\u6587\u4ef6\u5c31\u80fd\u5b9e\u73b0\u5f00\u673a\u542f\u52a8 Leanote \u670d\u52a1\u7aef\u3002<\/p>\n<p>\u53ef\u4ee5\u53c2\u8003\u6211\u7684 *.sh \u5199\u6cd5\uff1a<\/p>\n<p>#!\/bin\/bash<br \/>\nnohup mongod &#8211;dbpath \/root\/mongodb\/data &#8211;auth 2&gt;&amp;1 &amp;<br \/>\nnohup revel run github.com\/leanote\/leanote 2&gt;&amp;1 &amp;<br \/>\nsstr=$(echo -e $str)<br \/>\necho &#8220;$sstr&#8221;<\/p>\n<p>\u82e5\u811a\u672c\u6587\u4ef6\u547d\u540d\u4e3a run.sh\uff0c\u4e14\u5b58\u653e\u5728 \/root\/gopackage \u76ee\u5f55\u91cc\uff0c\u53ef\u4ee5\u7f16\u8f91 rc.local \u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<p><code>vi \/etc\/rc.local<\/code><\/p>\n<p>\u52a0\u5165\u4e0b\u9762\u7684\u547d\u4ee4\u7136\u540e\u4fdd\u5b58\u5373\u53ef\uff1a<\/p>\n<p>source \/etc\/profile<br \/>\n\/root\/gopackage\/run.sh<\/p>\n<h4 id=\"title-11\">\u914d\u7f6e https<\/h4>\n<p>\u65e2\u7136\u662f\u79c1\u4eba\u4e91\u7b14\u8bb0\uff0c\u52a0\u5bc6\u4f20\u8f93\u6570\u636e\u80af\u5b9a\u662f\u6709\u5fc5\u8981\u7684\uff0c\u4e0d\u7136\u7b14\u8bb0\u91cc\u82e5\u4fdd\u5b58\u4e86\u4e00\u4e9b\u5e10\u53f7\u7684\u8bdd\u53ef\u80fd\u4f1a\u6709\u5b89\u5168\u9690\u60a3\u3002\u5728 Nginx \u4e0b\u53ea\u9700\u8981\u4fee\u6539\u4e0b\u914d\u7f6e\u6587\u4ef6\u5c31\u53ef\u4ee5\u5b9e\u73b0 https \u8bbf\u95ee Leanote\u3002\u53e6\u5916\u4f60\u8981\u5148\u7533\u8bf7\u597d SSL \u8bc1\u4e66\uff0c\u8fd9\u4e2a\u8981\u81ea\u5df1\u89e3\u51b3\uff0c\u53ef\u4ee5\u53bb\u817e\u8baf\u4e91\u6216\u963f\u91cc\u4e91\u7533\u8bf7\u514d\u8d39\u7684 SSL \u8bc1\u4e66\uff0c\u5f88\u7b80\u5355\uff0c\u767e\u5ea6\u4e00\u4e0b\u5c31\u6709\u76f8\u5e94\u7684\u6559\u7a0b\u3002\u7533\u8bf7\u5230 SSL \u8bc1\u4e66\u540e\uff0c\u5171\u6709 *.crt\u3001*.key \u4e24\u4e2a\u6587\u4ef6\uff0c\u53ef\u4ee5\u7528 FTP \u5de5\u5177\u4e0a\u4f20\u5230 VPS\uff08\u76ee\u5f55\u4f60\u81ea\u5df1\u5b9a\uff09\u3002\u7136\u540e\u6309\u7167\u4e0b\u9762\u7684\u6b65\u9aa4\u4fee\u6539\u914d\u7f6e\u5373\u53ef\u3002<\/p>\n<p>\u4fee\u6539 Nginx \u914d\u7f6e\u6587\u4ef6 \/usr\/local\/nginx\/conf\/nginx.conf\uff0c\u5c06\u4e0b\u9762\u7684\u914d\u7f6e\u52a0\u5165 http {} \u5185\uff1a<\/p>\n<p>#leanote_https<br \/>\nupstream xxx.com {\u00a0#xxx.com\u66ff\u6362\u6210\u4f60\u7684\u57df\u540d<br \/>\nserver *.*.*.*:9000;\u00a0#\u6b64\u5904\u586b\u5199\u4e3b\u673a IP \u6216\u57df\u540d<br \/>\n}<br \/>\nserver<br \/>\n{<br \/>\nlisten 80;<br \/>\nserver_name xxx.com;\u00a0#xxx.com\u66ff\u6362\u6210\u4f60\u7684\u57df\u540d<br \/>\nrewrite ^\/(.*) https:\/\/xxx.com\/$1 permanent;\u00a0##xxx.com\u66ff\u6362\u6210\u4f60\u7684\u57df\u540d<br \/>\nlocation \/ {<br \/>\nproxy_pass http:\/\/xxx.com;\u00a0#xxx.com\u66ff\u6362\u6210\u4f60\u7684\u57df\u540d<br \/>\nproxy_set_header Host $host;<br \/>\nproxy_set_header X-Real-IP $remote_addr;<br \/>\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/>\n}<br \/>\n}<br \/>\nserver<br \/>\n{<br \/>\nlisten 443;<br \/>\nserver_name xxx.com;\u00a0#xxx.com\u66ff\u6362\u6210\u4f60\u7684\u57df\u540d<br \/>\nssl_certificate \/root\/xx\/xx\/ssl.crt;\u00a0#\u6b64\u5904\u586b\u5199 ssl \u8bc1\u4e66\u7684\u8def\u5f84<br \/>\nssl_certificate_key \/root\/xx\/xx\/ssl.key;\u00a0# \u6b64\u5904\u586b\u5199 ssl \u8bc1\u4e66\u5bc6\u94a5\u7684\u8def\u5f84<br \/>\nlocation \/ {<br \/>\nproxy_pass http:\/\/xxx.com;\u00a0#xxx.com\u66ff\u6362\u6210\u4f60\u7684\u57df\u540d<br \/>\nproxy_set_header Host $host;<br \/>\nproxy_set_header X-Real-IP $remote_addr;<br \/>\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/>\n}<br \/>\n}<\/p>\n<p>\u8f93\u5165\u547d\u4ee4\u91cd\u542f lnmp \u5373\u53ef\u751f\u6548\uff1a<\/p>\n<p><code>lnmp restart<\/code><\/p>\n<p>\u8bbf\u95ee\u00a0<code>https:\/\/\u4f60\u7684\u57df\u540d<\/code>\u00a0\u5373\u53ef\u6253\u5f00 Leanote \u4e3b\u9875\u3002<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6240\u5c5e\u5206\u7c7b\uff1a\u6559\u7a0b\u6307\u5357 \u00a0\u5b89\u88c5\u524d\u51c6\u5907\u5de5\u4f5c \u00a0<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[],"tags":[117],"class_list":["post-192","post","type-post","status-publish","format-standard","hentry","tag-01-linux"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=192"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/192\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}