{"id":18812,"date":"2024-11-19T10:40:35","date_gmt":"2024-11-19T02:40:35","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18812\/"},"modified":"2024-11-19T10:40:35","modified_gmt":"2024-11-19T02:40:35","slug":"ubuntu%e4%b8%ad%e6%80%8e%e4%b9%88%e5%ae%89%e8%a3%85gitlab","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18812\/","title":{"rendered":"ubuntu\u4e2d\u600e\u4e48\u5b89\u88c5gitlab"},"content":{"rendered":"<p>ubuntu\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5f00\u6e90\u64cd\u4f5c\u7cfb\u7edf\uff0c\u800cgitlab\u5219\u662f\u4e00\u4e2a\u7528\u4e8e\u7ba1\u7406git\u4ed3\u5e93\u7684web\u5e73\u53f0\u3002\u5728ubuntu\u4e2d\u5b89\u88c5gitlab\u53ef\u4ee5\u8ba9\u60a8\u66f4\u8f7b\u677e\u5730\u7ba1\u7406\u60a8\u7684\u4ee3\u7801\u5e93\u548c\u7248\u672c\u63a7\u5236\u5de5\u5177\u3002\u4e0b\u9762\u662f\u5982\u4f55\u5728ubuntu\u4e2d\u5b89\u88c5gitlab\u7684\u6b65\u9aa4\u3002<\/p>\n<p>\u7b2c\u4e00\u6b65\uff1a\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u9879<\/p>\n<p>\u9996\u5148\uff0c\u6253\u5f00\u7ec8\u7aef\u5e76\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u5b89\u88c5\u6240\u9700\u7684\u4f9d\u8d56\u9879\uff1a<\/p>\n<pre>sudo apt-get update\nsudo apt-get install -y curl openssh-server ca-certificates postfix<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5176\u4e2dcurl\u662f\u7528\u4e8e\u4e0b\u8f7dGitLab\u5b89\u88c5\u7a0b\u5e8f\u7684\u5de5\u5177\uff0copenssh-server\u7528\u4e8e\u652f\u6301GitLab SSH\u534f\u8bae\uff0cca-certificates\u7528\u4e8e\u9a8c\u8bc1\u7f51\u7ad9\u8bc1\u4e66\uff0cpostfix\u7528\u4e8e\u53d1\u9001\u90ae\u4ef6\u901a\u77e5\u3002\u5728\u5b89\u88c5\u671f\u95f4\uff0c\u7cfb\u7edf\u53ef\u80fd\u4f1a\u63d0\u793a\u60a8\u8f93\u5165SMTP\u670d\u52a1\u5668\u540d\u79f0\u6216\u8005\u914d\u7f6e\u5176\u5b83\u8bbe\u7f6e\u3002\u8bf7\u6309\u7167\u63d0\u793a\u8f93\u5165\u6b63\u786e\u7684\u4fe1\u606f\u5e76\u5b8c\u6210\u5b89\u88c5\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65\uff1a\u5b89\u88c5GitLab<\/p>\n<p>\u5728\u5b89\u88c5\u597d\u5fc5\u8981\u8f6f\u4ef6\u540e\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u4e0b\u8f7d\u5b89\u88c5GitLab\uff1a<\/p>\n<pre>curl -sS https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.deb.sh | sudo bash\nsudo apt-get install gitlab-ce<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5b89\u88c5\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u65f6\u95f4\uff0c\u53d6\u51b3\u4e8e\u60a8\u7684\u7f51\u7edc\u901f\u5ea6\u548c\u7cfb\u7edf\u6027\u80fd\u3002<\/p>\n<p>\u7b2c\u4e09\u6b65\uff1a\u914d\u7f6e\u5e76\u542f\u52a8GitLab<\/p>\n<p>\u4e00\u65e6GitLab\u5b89\u88c5\u5b8c\u6210\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u914d\u7f6e\u548c\u542f\u52a8GitLab\uff1a<\/p>\n<pre>sudo gitlab-ctl reconfigure\nsudo gitlab-ctl start<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4ee5\u4e0a\u547d\u4ee4\u5c06\u91cd\u65b0\u914d\u7f6eGitLab\u5e76\u542f\u52a8\u5fc5\u8981\u7684\u670d\u52a1\u3002\u5982\u679c\u60a8\u5728\u5b89\u88c5\u6216\u914d\u7f6e\u671f\u95f4\u9047\u5230\u4efb\u4f55\u95ee\u9898\uff0c\u8bf7\u67e5\u770bGitLab\u7684\u6587\u6863\u6216\u793e\u533a\u652f\u6301\u3002<\/p>\n<p>\u7b2c\u56db\u6b65\uff1a\u8bbf\u95eeGitLab\u5e73\u53f0<\/p>\n<p>\u5b89\u88c5\u548c\u914d\u7f6e\u5b8cGitLab\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0bURL\u6765\u8bbf\u95eeGitLabWeb\u754c\u9762\uff1a<\/p>\n<pre>http:\/\/&lt;your-server-ip-or-hostname&gt;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5176\u4e2d&#8221;your-server-ip-or-hostname&#8221;\u662f\u60a8\u5b89\u88c5GitLab\u7684\u670d\u52a1\u5668\u7684IP\u5730\u5740\u6216\u8005\u4e3b\u673a\u540d\u3002\u9996\u6b21\u8bbf\u95ee\u8be5\u7f51\u9875\u65f6\uff0c\u60a8\u9700\u8981\u8bbe\u7f6eroot\u7528\u6237\u7684\u5bc6\u7801\u3002\u7136\u540e\u5c31\u53ef\u4ee5\u767b\u5f55\u5e76\u5f00\u59cb\u4f7f\u7528GitLab\u6765\u7ba1\u7406\u60a8\u7684\u4ee3\u7801\u5e93\u4e86\u3002<\/p>\n<p>\u7ed3\u8bba<\/p>\n<p>\u5b89\u88c5GitLab\u7684\u8fc7\u7a0b\u5f88\u7b80\u5355\uff0c\u53ea\u9700\u8981\u51e0\u4e2a\u547d\u4ee4\u5c31\u53ef\u4ee5\u5b8c\u6210\u6574\u4e2a\u8fc7\u7a0b\u3002\u5728\u60a8\u5b89\u88c5\u548c\u914d\u7f6e\u597dGitLab\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5b83\u6765\u66f4\u8f7b\u677e\u5730\u7ba1\u7406\u548c\u7ef4\u62a4\u60a8\u7684\u4ee3\u7801\u5e93\u3002\u5982\u679c\u60a8\u6709\u4efb\u4f55\u95ee\u9898\u6216\u9700\u8981\u66f4\u591a\u5e2e\u52a9\uff0c\u8bf7\u53c2\u8003GitLab\u7684\u5b98\u65b9\u6587\u6863\u6216\u793e\u533a\u652f\u6301\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fubuntu\u4e2d\u600e\u4e48\u5b89\u88c5gitlab\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ubuntu\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5f00\u6e90\u64cd\u4f5c\u7cfb\u7edf\uff0c\u800cgitlab\u5219\u662f\u4e00\u4e2a\u7528\u4e8e\u7ba1\u7406git\u4ed3\u5e93\u7684web\u5e73\u53f0\u3002\u5728ubuntu\u4e2d\u5b89\u88c5gitlab\u53ef\u4ee5\u8ba9\u60a8\u66f4\u8f7b\u677e\u5730\u7ba1\u7406\u60a8\u7684\u4ee3\u7801\u5e93\u548c\u7248\u672c\u63a7\u5236\u5de5\u5177\u3002\u4e0b\u9762\u662f\u5982\u4f55\u5728ubuntu\u4e2d\u5b89\u88c5gitlab\u7684\u6b65\u9aa4\u3002 \u7b2c\u4e00\u6b65\uff1a\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u9879 \u9996\u5148\uff0c\u6253\u5f00\u7ec8\u7aef\u5e76\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u5b89\u88c5\u6240\u9700\u7684\u4f9d\u8d56\u9879\uff1a sudo apt-get update sudo apt-get install -y curl openssh-server ca-certificates postfix \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2dcurl\u662f\u7528\u4e8e\u4e0b\u8f7dGitLab\u5b89\u88c5\u7a0b\u5e8f\u7684\u5de5\u5177\uff0copenssh-server\u7528\u4e8e\u652f\u6301GitLab SSH\u534f\u8bae\uff0cca-certificates\u7528\u4e8e\u9a8c\u8bc1\u7f51\u7ad9\u8bc1\u4e66\uff0cpostfix\u7528\u4e8e\u53d1\u9001\u90ae\u4ef6\u901a\u77e5\u3002\u5728\u5b89\u88c5\u671f\u95f4\uff0c\u7cfb\u7edf\u53ef\u80fd\u4f1a\u63d0\u793a\u60a8\u8f93\u5165SMTP\u670d\u52a1\u5668\u540d\u79f0\u6216\u8005\u914d\u7f6e\u5176\u5b83\u8bbe\u7f6e\u3002\u8bf7\u6309\u7167\u63d0\u793a\u8f93\u5165\u6b63\u786e\u7684\u4fe1\u606f\u5e76\u5b8c\u6210\u5b89\u88c5\u3002 \u7b2c\u4e8c\u6b65\uff1a\u5b89\u88c5GitLab \u5728\u5b89\u88c5\u597d\u5fc5\u8981\u8f6f\u4ef6\u540e\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u4e0b\u8f7d\u5b89\u88c5GitLab\uff1a curl -sS https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.deb.sh | sudo bash sudo apt-get install gitlab-ce \u767b\u5f55\u540e\u590d\u5236 \u5b89\u88c5\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u65f6\u95f4\uff0c\u53d6\u51b3\u4e8e\u60a8\u7684\u7f51\u7edc\u901f\u5ea6\u548c\u7cfb\u7edf\u6027\u80fd\u3002 \u7b2c\u4e09\u6b65\uff1a\u914d\u7f6e\u5e76\u542f\u52a8GitLab \u4e00\u65e6GitLab\u5b89\u88c5\u5b8c\u6210\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u914d\u7f6e\u548c\u542f\u52a8GitLab\uff1a sudo gitlab-ctl reconfigure sudo gitlab-ctl start \u767b\u5f55\u540e\u590d\u5236 \u4ee5\u4e0a\u547d\u4ee4\u5c06\u91cd\u65b0\u914d\u7f6eGitLab\u5e76\u542f\u52a8\u5fc5\u8981\u7684\u670d\u52a1\u3002\u5982\u679c\u60a8\u5728\u5b89\u88c5\u6216\u914d\u7f6e\u671f\u95f4\u9047\u5230\u4efb\u4f55\u95ee\u9898\uff0c\u8bf7\u67e5\u770bGitLab\u7684\u6587\u6863\u6216\u793e\u533a\u652f\u6301\u3002 \u7b2c\u56db\u6b65\uff1a\u8bbf\u95eeGitLab\u5e73\u53f0 \u5b89\u88c5\u548c\u914d\u7f6e\u5b8cGitLab\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0bURL\u6765\u8bbf\u95eeGitLabWeb\u754c\u9762\uff1a http:\/\/&lt;your-server-ip-or-hostname&gt; \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d&#8221;your-server-ip-or-hostname&#8221;\u662f\u60a8\u5b89\u88c5GitLab\u7684\u670d\u52a1\u5668\u7684IP\u5730\u5740\u6216\u8005\u4e3b\u673a\u540d\u3002\u9996\u6b21\u8bbf\u95ee\u8be5\u7f51\u9875\u65f6\uff0c\u60a8\u9700\u8981\u8bbe\u7f6eroot\u7528\u6237\u7684\u5bc6\u7801\u3002\u7136\u540e\u5c31\u53ef\u4ee5\u767b\u5f55\u5e76\u5f00\u59cb\u4f7f\u7528GitLab\u6765\u7ba1\u7406\u60a8\u7684\u4ee3\u7801\u5e93\u4e86\u3002 \u7ed3\u8bba \u5b89\u88c5GitLab\u7684\u8fc7\u7a0b\u5f88\u7b80\u5355\uff0c\u53ea\u9700\u8981\u51e0\u4e2a\u547d\u4ee4\u5c31\u53ef\u4ee5\u5b8c\u6210\u6574\u4e2a\u8fc7\u7a0b\u3002\u5728\u60a8\u5b89\u88c5\u548c\u914d\u7f6e\u597dGitLab\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5b83\u6765\u66f4\u8f7b\u677e\u5730\u7ba1\u7406\u548c\u7ef4\u62a4\u60a8\u7684\u4ee3\u7801\u5e93\u3002\u5982\u679c\u60a8\u6709\u4efb\u4f55\u95ee\u9898\u6216\u9700\u8981\u66f4\u591a\u5e2e\u52a9\uff0c\u8bf7\u53c2\u8003GitLab\u7684\u5b98\u65b9\u6587\u6863\u6216\u793e\u533a\u652f\u6301\u3002 \u4ee5\u4e0a\u5c31\u662fubuntu\u4e2d\u600e\u4e48\u5b89\u88c5gitlab\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-18812","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=18812"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18812\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}