{"id":748,"date":"2022-11-23T01:28:58","date_gmt":"2022-11-22T17:28:58","guid":{"rendered":"https:\/\/silverpond.cn\/?p=748"},"modified":"2022-12-16T04:04:28","modified_gmt":"2022-12-15T20:04:28","slug":"wiki-js%e6%90%ad%e5%bb%ba","status":"publish","type":"post","link":"https:\/\/silverpond.cn\/?p=748","title":{"rendered":"Wiki.js\u642d\u5efa"},"content":{"rendered":"<h2>\u4e00\u3001Wiki &amp; Wiki.js<\/h2>\n<p>1.<strong>Wiki\uff1a<\/strong>\u662f\u4e00\u79cd\u5728\u7f51\u7edc\u4e0a\u5f00\u653e\u4e14\u53ef\u4f9b\u591a\u4eba\u534f\u540c\u521b\u4f5c\u7684\u8d85\u6587\u672c\u7cfb\u7edf\uff0c\u7531\u7f8e\u56fd\u4eba\u6c83\u5fb7\u00b7\u574e\u5b81\u5b89\u4e8e1995\u5e74\u9996\u5148\u5f00\u53d1\u3002\u8fd9\u79cd\u8d85\u6587\u672c\u7cfb\u7edf\u652f\u6301\u9762\u5411\u793e\u7fa4\u7684\u534f\u4f5c\u5f0f\u5199\u4f5c\u3002<br \/>\n2.<strong>Wiki.js\uff1a<\/strong>\u662f\u4e00\u4e2a\u57fa\u4e8eNodeJS\u7684\u73b0\u4ee3\u3001\u8f7b\u91cf\u7ea7\u548c\u5f3a\u5927\u7684Wiki\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<h2>\u4e8c\u3001\u7cfb\u7edf\u67b6\u6784<\/h2>\n<ol>\n<li><strong>Node.js<\/strong>\uff1a\u57fa\u4e8eJavaScript\u8bed\u8a00\u548cV8\u5f15\u64ce\u7684\u5f00\u6e90Web\u670d\u52a1\u5668\u9879\u76ee\u3002<\/li>\n<li><strong>PostgreSQL\uff1a<\/strong>\u662f\u4e00\u4e2a\u514d\u8d39\u7684\u5bf9\u8c61-\u5173\u7cfb\u6570\u636e\u5e93\u670d\u52a1\u5668\uff08ORDBMS\uff09\uff0c\u5728\u7075\u6d3b\u7684BSD\u8bb8\u53ef\u8bc1\u4e0b\u53d1\u884c\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669127772905.png\" alt=\"file\" \/><\/li>\n<\/ol>\n<h2>\u4e09\u3001\u7cfb\u7edf\u90e8\u7f72<\/h2>\n<p>1.\u66f4\u65b0\u670d\u52a1\u5668\u7ec4\u4ef6\u5305<\/p>\n<pre><code class=\"language-shell\">yum update -y<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669132775710.png\" alt=\"file\" \/><\/p>\n<p>2.\u5b89\u88c5node 16\uff0cnode18.21.1 LTS\u4e0d\u9002\u914d<\/p>\n<pre><code class=\"language-shell\">## \u4e0b\u8f7dnode 16\nwget https:\/\/nodejs.org\/dist\/v16.13.2\/node-v16.13.2-linux-x64.tar.xz<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669133345197.png\" alt=\"file\" \/><\/p>\n<pre><code class=\"language-shell\">## xz\u547d\u4ee4\u89e3\u538bxxx.tar.xz\n xz -d node-v16.13.2-linux-x64.tar.xz<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669133425291.png\" alt=\"file\" \/><\/p>\n<pre><code class=\"language-shell\">## tar\u547d\u4ee4\u89e3\u538bxxx.tar\ntar xvf node-v16.13.2-linux-x64.tar<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669133641866.png\" alt=\"file\" \/><\/p>\n<pre><code class=\"language-shell\">## \u4fee\u6539\u6587\u4ef6\u540d\u79f0\u4e3anode\nmv node-v16.13.2-linux-x64 node\n## \u67e5\u770bnode\u670d\u52a1\u6240\u5728\u8def\u5f84\npwd\n## \u67e5\u770bPATH\u73af\u5883\u53d8\u91cf\necho $PATH\n## \u521b\u5efa\u8f6f\u94fe\u63a5\nln -s \/root\/node\/bin\/node \/usr\/local\/bin\/node\n## \u5168\u5c40\u9a8c\u8bc1\nnode -v<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669135031390.png\" alt=\"file\" \/><\/p>\n<p>3.\u5b89\u88c5PgSQL 15\u7248\u672c<\/p>\n<pre><code class=\"language-shell\">## \u5b89\u88c5Pgsql\nsudo yum install -y https:\/\/download.postgresql.org\/pub\/repos\/yum\/reporpms\/EL-7-x86_64\/pgdg-redhat-repo-latest.noarch.rpm\nsudo yum install -y postgresql15-server\nsudo \/usr\/pgsql-15\/bin\/postgresql-15-setup initdb\nsudo systemctl enable postgresql-15\nsudo systemctl start postgresql-15<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669133951359.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669134476279.png\" alt=\"file\" \/><\/p>\n<p>4.\u5b89\u88c5Wiki.js 2.0\u7248\u672c<\/p>\n<pre><code class=\"language-shell\">## \u4e0b\u8f7dwiki.js\u5b89\u88c5\u5305\nwget https:\/\/github.com\/Requarks\/wiki\/releases\/latest\/download\/wiki-js.tar.gz<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669133267421.png\" alt=\"file\" \/><\/p>\n<pre><code class=\"language-shell\">## \u5c06wiki\u89e3\u538b\u5728\u65b0\u5efa\u7684wiki\u76ee\u5f55\u4e0b\nmkdir wiki\ntar xzf wiki-js.tar.gz -C .\/wiki\ncd .\/wiki\n## \u8fdb\u5165\u76ee\u5f55\u5e76\u5c06\u793a\u4f8b\u914d\u7f6e\u6587\u4ef6\u6539\u540d\u4e3aconfig.yml\nmv config.sample.yml config.yml<\/code><\/pre>\n<pre><code class=\"language-shell\">## \u4fee\u6539PgSQL\u7684user\u548cpass\u4e3a\u9ed8\u8ba4\u7684postgres\nvim config.yml<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669136581804.png\" alt=\"file\" \/><\/p>\n<pre><code class=\"language-shell\">## \u8fde\u63a5\u6570\u636e\u5e93\npsql -U postgres\n## \u8fde\u63a5\u6570\u636e\u5e93\u51fa\u9519\uff0c\u9700\u4fee\u6539pg_hba.conf\u6587\u4ef6\u4e0b\u7684\u53c2\u6570\nvim \/var\/lib\/pgsql\/15\/data\/pg_hba.conf\n## \u91cd\u65b0\u542f\u52a8\u6570\u636e\u5e93\u5e76\u786e\u8ba4\nsystemctl restart postgresql-15\nsystemctl status postgresql-15<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669136847997.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669136967793.png\" alt=\"file\" \/><\/p>\n<pre><code class=\"language-shell\">## \u8fde\u63a5\u6570\u636e\u5e93\n psql -U postgres\n## \u521b\u5efawiki\u5e93\n create database wiki;\n## \u5bc6\u7801\u91cd\u590d\u4fee\u6539\u4e3apostgres,\u907f\u514d\u65e0\u6cd5\u8fde\u63a5\n alter user postgres with password 'postgres';\n## \u5728wiki\u4e0b\u542f\u52a8\u670d\u52a1\uff0c\u5728\u7aef\u53e33000\u8fdb\u884c\u8bbf\u95ee\n node server<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669137624401.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669137590863.png\" alt=\"file\" \/><\/p>\n<pre><code class=\"language-shell\">## \u586b\u5199\u597d\u90ae\u7bb1\u3001\u5bc6\u7801\u3001\u57df\u540d\uff0c\u8fdb\u884c\u5b89\u88c5\n## \u5b89\u88c5\u5b8c\u6210\u540e\u767b\u9646\u8fdb\u884c\u5177\u4f53\u7684\u914d\u7f6e\u548c\u4f7f\u7528<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669137849509.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669137866830.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669137908253.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669137959220.png\" alt=\"file\" \/><\/p>\n<h2>\u56db\u3001\u540e\u53f0\u8fd0\u884c<\/h2>\n<p>1.<strong>Matter:<\/strong>\u5173\u95ed\u670d\u52a1\u5668SSH\u8fde\u63a5\u65f6\uff0c\u65e0\u6cd5\u5c06\u670d\u52a1\u79fb\u52a8\u5230\u540e\u53f0\u8fdb\u884c\u8fd0\u884c\uff0c\u4e8e\u662f\u670d\u52a1\u88ab\u5f3a\u884c\u5173\u6389\uff0c\u524d\u7aef\u65e0\u6cd5\u518d\u8fdb\u884c\u8bbf\u95ee\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669125022612.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/silverpond.cn\/wp-content\/uploads\/2022\/11\/image-1669125068801.png\" alt=\"file\" \/><\/p>\n<p>2.<strong>Solve\uff1a<\/strong><\/p>\n<ul>\n<li>Systemd\uff1aWiki.js\u5b98\u65b9\u63a8\u8350\u4f7f\u7528\uff1b<\/li>\n<li>nohup\uff1a<\/li>\n<\/ul>\n<p>3.<strong>\u884d\u751f<\/strong>\uff1aSystemd\u5165\u95e8\u6559\u7a0b\uff08\u962e\u4e00\u5cf0\uff09<br \/>\n<a href=\"http:\/\/ruanyifeng.com\/blog\/2016\/03\/systemd-tutorial-commands.html\">http:\/\/ruanyifeng.com\/blog\/2016\/03\/systemd-tutorial-commands.html<\/a><br \/>\n<a href=\"https:\/\/systemd.io\/\">https:\/\/systemd.io\/<\/a><\/p>\n<h2>\u4e94\u3001\u540e\u53f0\u8fd0\u884c\u6700\u7b80\u5355\u5b9e\u73b0<\/h2>\n<p>1\u3001nohup cmd &amp;\uff1a<br \/>\n\u4f7f\u7528<code>nohup node server &amp;<\/code>\u542f\u52a8wiki\u670d\u52a1\uff0c\u5373\u4f7f\u5173\u95edSSH\u8fde\u63a5\u670d\u52a1\u4e5f\u4e0d\u4f1a\u518d\u5173\u95ed\uff0c\u4f46\u662f\u5982\u4f55\u505c\u6b62\u6b64\u670d\u52a1\u5462\uff1f<\/p>\n<pre><code class=\"language-shell\"># \u627e\u51fa\u6240\u6709\u7684node\u8fdb\u7a0b\nps -ax |grep node\n\n# \u4f9d\u636e\u8fdb\u7a0b\u7684pid\u6740\u6b7b\u8fdb\u884c\nkill -9 pid<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001Wiki &amp; Wiki.js 1.Wiki\uff1a\u662f\u4e00<span class=\"excerpt-fade\"><\/span><\/p>\n","protected":false},"author":1,"featured_media":775,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[78],"tags":[22,69,68],"class_list":["post-748","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-78","tag-node","tag-postgressql","tag-wiki-js"],"_links":{"self":[{"href":"https:\/\/silverpond.cn\/index.php?rest_route=\/wp\/v2\/posts\/748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/silverpond.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/silverpond.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/silverpond.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/silverpond.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=748"}],"version-history":[{"count":6,"href":"https:\/\/silverpond.cn\/index.php?rest_route=\/wp\/v2\/posts\/748\/revisions"}],"predecessor-version":[{"id":884,"href":"https:\/\/silverpond.cn\/index.php?rest_route=\/wp\/v2\/posts\/748\/revisions\/884"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/silverpond.cn\/index.php?rest_route=\/wp\/v2\/media\/775"}],"wp:attachment":[{"href":"https:\/\/silverpond.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/silverpond.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/silverpond.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}