{"id":16247,"date":"2024-11-03T11:12:06","date_gmt":"2024-11-03T03:12:06","guid":{"rendered":"http:\/\/999.zuizhuai.cn\/?p=16247"},"modified":"2024-11-03T11:12:06","modified_gmt":"2024-11-03T03:12:06","slug":"%e6%95%99%e4%bd%a0%e6%80%8e%e4%b9%88%e7%94%a8%e5%ae%9d%e5%a1%94%e6%90%ad%e5%bb%bahalo","status":"publish","type":"post","link":"http:\/\/puo.cn\/?p=16247","title":{"rendered":"\u6559\u4f60\u600e\u4e48\u7528\u5b9d\u5854\u642d\u5efaHalo"},"content":{"rendered":"<p><a data-fancybox=\"responsive\" data-src=\"https:\/\/s.rmimg.com\/2024-11-02\/1730480977-159342-image.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-16458\" src=\"http:\/\/loc-wp-cdnimg.jiyun.net\/blogtest\/2024\/11\/20241105130637476.png\" width=\"1839\" height=\"1031\" alt=\"20241105130637476\" title=\"20241105130637476\" \/><\/a><\/p>\n<h3>1. \u73af\u5883\u51c6\u5907<\/h3>\n<ol>\n<li><strong>\u5b89\u88c5\u5b9d\u5854\u9762\u677f<\/strong>\uff1a\u786e\u4fdd\u4f60\u7684\u670d\u52a1\u5668\u4e0a\u5df2\u7ecf\u5b89\u88c5\u4e86\u5b9d\u5854\u9762\u677f\uff08\u652f\u6301 Linux \u670d\u52a1\u5668\uff0c\u5982 CentOS\u3001Ubuntu \u7b49\uff09\u3002<\/li>\n<li><strong>\u5b89\u88c5\u73af\u5883<\/strong>\uff1aHalo \u662f\u7528 Java \u5f00\u53d1\u7684\uff0c\u5efa\u8bae\u5b89\u88c5 JDK 11 \u6216\u4ee5\u4e0a\u7248\u672c\u3002<\/li>\n<\/ol>\n<h3>2. \u521b\u5efa\u7f51\u7ad9\u76ee\u5f55<\/h3>\n<p>\u5728\u5b9d\u5854\u9762\u677f\u4e2d\uff0c\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\u7528\u4e8e\u5b58\u653e Halo \u6587\u4ef6\uff0c\u4f8b\u5982\u00a0<code>\/www\/wwwroot\/halo<\/code>\u3002<\/p>\n<h3>3. \u4e0b\u8f7d Halo \u5e76\u8fdb\u884c\u914d\u7f6e<\/h3>\n<ol>\n<li><strong>\u4e0b\u8f7d Halo<\/strong>\uff1a\u524d\u5f80\u00a0<a rel=\"nofollow\" href=\"https:\/\/github.com\/halo-dev\/halo\/releases\" target=\"_blank\" rel=\"ugc noopener nofollow\">Halo GitHub Release \u9875\u9762<\/a>\u4e0b\u8f7d\u6700\u65b0\u7684 Halo \u7a0b\u5e8f\uff0c\u9009\u62e9\u00a0<code>.jar<\/code>\u00a0\u6587\u4ef6\u3002<\/li>\n<li><strong>\u4e0a\u4f20\u6587\u4ef6<\/strong>\uff1a\u5c06\u00a0<code>.jar<\/code>\u00a0\u6587\u4ef6\u4e0a\u4f20\u81f3\u00a0<code>\/www\/wwwroot\/halo<\/code>\u00a0\u76ee\u5f55\u3002<\/li>\n<li><strong>\u914d\u7f6e\u6570\u636e\u5e93<\/strong>\uff1aHalo \u652f\u6301 MySQL \u548c SQLite\uff0c\u53ef\u4ee5\u9009\u62e9\u5728\u5b9d\u5854\u9762\u677f\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 MySQL \u6570\u636e\u5e93\uff0c\u8bb0\u5f55\u4e0b\u6570\u636e\u5e93\u4fe1\u606f\uff08\u5730\u5740\u3001\u7528\u6237\u540d\u3001\u5bc6\u7801\u7b49\uff09\u3002<\/li>\n<\/ol>\n<h3>4. \u914d\u7f6e Halo \u542f\u52a8\u6587\u4ef6<\/h3>\n<p>\u5728\u00a0<code>\/www\/wwwroot\/halo<\/code>\u00a0\u76ee\u5f55\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u914d\u7f6e\u6587\u4ef6\u00a0<code>application.yaml<\/code>\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<pre class=\"copy-ready\"><button class=\"clipboard cnblog\" data-clipboard-snippet=\"\"><i class=\"fas fa-code\"><\/i><\/button><code class=\"language-yaml hljs\" data-highlighted=\"yes\"><span class=\"hljs-attr\">spring:<\/span>\n  <span class=\"hljs-attr\">datasource:<\/span>\n    <span class=\"hljs-attr\">url:<\/span> <span class=\"hljs-string\">jdbc:mysql:\/\/localhost:3306\/\u6570\u636e\u5e93\u540d\u79f0?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false<\/span>\n    <span class=\"hljs-attr\">username:<\/span> <span class=\"hljs-string\">\u6570\u636e\u5e93\u7528\u6237\u540d<\/span>\n    <span class=\"hljs-attr\">password:<\/span> <span class=\"hljs-string\">\u6570\u636e\u5e93\u5bc6\u7801<\/span>\n<span class=\"hljs-attr\">halo:<\/span>\n  <span class=\"hljs-attr\">work-dir:<\/span> <span class=\"hljs-string\">.\/halo_data<\/span>  <span class=\"hljs-comment\"># \u6307\u5b9a\u6570\u636e\u76ee\u5f55<\/span>\n<span class=\"hljs-attr\">server:<\/span>\n  <span class=\"hljs-attr\">port:<\/span> <span class=\"hljs-number\">8090<\/span>  <span class=\"hljs-comment\"># \u8bbe\u7f6e\u7aef\u53e3\u53f7<\/span><\/code><\/pre>\n<p>\u66ff\u6362\u5176\u4e2d\u7684\u00a0<code>\u6570\u636e\u5e93\u540d\u79f0<\/code>\u3001<code>\u6570\u636e\u5e93\u7528\u6237\u540d<\/code>\u00a0\u548c\u00a0<code>\u6570\u636e\u5e93\u5bc6\u7801<\/code>\u3002<\/p>\n<h3>5. \u521b\u5efa\u5e76\u8fd0\u884c Halo \u542f\u52a8\u811a\u672c<\/h3>\n<p>\u5728\u00a0<code>\/www\/wwwroot\/halo<\/code>\u00a0\u4e2d\u521b\u5efa\u4e00\u4e2a\u00a0<code>start.sh<\/code>\u00a0\u811a\u672c\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<pre class=\"copy-ready\"><button class=\"clipboard cnblog\" data-clipboard-snippet=\"\"><i class=\"fas fa-code\"><\/i><\/button><code class=\"language-bash hljs\" data-highlighted=\"yes\"><span class=\"hljs-meta\">#!\/bin\/bash<\/span>\njava -jar halo.jar --spring.config.location=application.yaml<\/code><\/pre>\n<p>\u7ed9\u811a\u672c\u6267\u884c\u6743\u9650\uff1a<\/p>\n<pre class=\"copy-ready\"><button class=\"clipboard cnblog\" data-clipboard-snippet=\"\"><i class=\"fas fa-code\"><\/i><\/button><code class=\"language-bash hljs\" data-highlighted=\"yes\"><span class=\"hljs-built_in\">chmod<\/span> +x start.sh<\/code><\/pre>\n<p>\u7136\u540e\u542f\u52a8 Halo\uff1a<\/p>\n<pre class=\"copy-ready\"><button class=\"clipboard cnblog\" data-clipboard-snippet=\"\"><i class=\"fas fa-code\"><\/i><\/button><code class=\"language-bash hljs\" data-highlighted=\"yes\">.\/start.sh<\/code><\/pre>\n<h3>6. \u914d\u7f6e\u53cd\u5411\u4ee3\u7406<\/h3>\n<p>\u4e3a\u4e86\u901a\u8fc7\u57df\u540d\u8bbf\u95ee Halo\uff0c\u53ef\u4ee5\u5728\u5b9d\u5854\u9762\u677f\u4e2d\u8fdb\u884c\u53cd\u5411\u4ee3\u7406\u8bbe\u7f6e\uff1a<\/p>\n<ol>\n<li><strong>\u6dfb\u52a0\u7ad9\u70b9<\/strong>\uff1a\u5728\u5b9d\u5854\u9762\u677f\u7684\u201c\u7f51\u7ad9\u201d\u4e2d\u6dfb\u52a0\u7ad9\u70b9\uff0c\u8bbe\u7f6e\u4f60\u7684\u57df\u540d\u3002<\/li>\n<li><strong>\u914d\u7f6e\u53cd\u5411\u4ee3\u7406<\/strong>\uff1a\u8fdb\u5165\u7ad9\u70b9\u8bbe\u7f6e -&gt; \u53cd\u5411\u4ee3\u7406\uff0c\u8bbe\u7f6e\u4ee3\u7406\u76ee\u6807\u4e3a\u00a0<code>http:\/\/127.0.0.1:8090<\/code>\uff0c\u7136\u540e\u4fdd\u5b58\u3002<\/li>\n<\/ol>\n<h3>7. \u521d\u59cb\u5316 Halo<\/h3>\n<p>\u8bbf\u95ee\u4f60\u7684\u57df\u540d\uff0c\u4f8b\u5982\u00a0<code>http:\/\/yourdomain.com<\/code>\uff0c\u6309\u7167\u63d0\u793a\u521d\u59cb\u5316 Halo\uff0c\u521b\u5efa\u7ba1\u7406\u5458\u8d26\u6237\u5e76\u5b8c\u6210\u8bbe\u7f6e\u3002<\/p>\n<h3>8. \u8bbe\u7f6e\u5f00\u673a\u542f\u52a8\uff08\u53ef\u9009\uff09<\/h3>\n<p>\u53ef\u4ee5\u901a\u8fc7\u00a0<code>screen<\/code>\u00a0\u6216\u00a0<code>nohup<\/code>\u00a0\u6765\u4f7f Halo \u7a0b\u5e8f\u5728\u540e\u53f0\u8fd0\u884c\uff0c\u786e\u4fdd\u91cd\u542f\u540e\u81ea\u52a8\u542f\u52a8\uff1a<\/p>\n<pre class=\"copy-ready\"><button class=\"clipboard cnblog\" data-clipboard-snippet=\"\"><i class=\"fas fa-code\"><\/i><\/button><code class=\"language-bash hljs\" data-highlighted=\"yes\"><span class=\"hljs-built_in\">nohup<\/span> java -jar halo.jar --spring.config.location=application.yaml &gt; halo.log 2&gt;&amp;1 &amp;<\/code><\/pre>\n<p>\u81f3\u6b64\uff0c\u4f60\u7684 Halo \u535a\u5ba2\u5c31\u53ef\u4ee5\u901a\u8fc7\u57df\u540d\u6b63\u5e38\u8bbf\u95ee\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u73af\u5883\u51c6\u5907 \u5b89\u88c5\u5b9d\u5854\u9762\u677f\uff1a\u786e\u4fdd\u4f60\u7684\u670d\u52a1\u5668\u4e0a\u5df2\u7ecf\u5b89\u88c5\u4e86\u5b9d\u5854\u9762\u677f\uff08\u652f\u6301 Linux \u670d\u52a1\u5668\uff0c\u5982 CentOS\u3001Ubuntu \u7b49\uff09\u3002 \u5b89\u88c5\u73af\u5883\uff1aHalo \u662f\u7528 Java \u5f00\u53d1\u7684\uff0c\u5efa\u8bae\u5b89\u88c5 JDK 11 \u6216\u4ee5\u4e0a\u7248\u672c\u3002 2. \u521b\u5efa\u7f51\u7ad9\u76ee\u5f55 \u5728\u5b9d\u5854&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[140],"tags":[220,252],"topic":[],"class_list":["post-16247","post","type-post","status-publish","format-standard","hentry","category-domain-website","tag-220","tag-252"],"_links":{"self":[{"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/posts\/16247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16247"}],"version-history":[{"count":0,"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/posts\/16247\/revisions"}],"wp:attachment":[{"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16247"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16247"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftopic&post=16247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}