{"id":19009,"date":"2024-11-19T16:31:37","date_gmt":"2024-11-19T08:31:37","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19009\/"},"modified":"2024-11-19T16:31:37","modified_gmt":"2024-11-19T08:31:37","slug":"%e8%81%8a%e8%81%8aubuntu%e4%b8%8a%e5%ae%89%e8%a3%85gitlab%e7%9a%84%e6%ad%a5%e9%aa%a4","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19009\/","title":{"rendered":"\u804a\u804aUbuntu\u4e0a\u5b89\u88c5GitLab\u7684\u6b65\u9aa4"},"content":{"rendered":"<p>ubuntu\u662f\u4e00\u79cd\u5e7f\u6cdb\u4f7f\u7528\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5b83\u57fa\u4e8edebian\u548clinux\u5185\u6838\u3002\u5bf9\u4e8e\u5f00\u53d1\u4eba\u5458\u6765\u8bf4\uff0cubuntu\u662f\u4e00\u4e2a\u5f88\u68d2\u7684\u5e73\u53f0\uff0c\u56e0\u4e3a\u5b83\u5728\u5f00\u53d1\u65b9\u9762\u63d0\u4f9b\u4e86\u8bb8\u591a\u529f\u80fd\u548c\u5de5\u5177\u3002\u5176\u4e2d\u4e00\u4e2a\u6700\u6d41\u884c\u7684\u5de5\u5177\u662fgitlab\uff0c\u5b83\u662f\u4e00\u4e2a\u5f00\u6e90\u9879\u76ee\uff0c\u63d0\u4f9b\u4e86\u4e00\u79cd\u96c6\u6210\u7684\u3001web-based\u7684git\u5b58\u50a8\u5e93\u7ba1\u7406\u7cfb\u7edf\u3002\u672c\u6587\u5c06\u5411\u60a8\u4ecb\u7ecd\u5728ubuntu\u4e0a\u5b89\u88c5gitlab\u7684\u6b65\u9aa4\u3002<\/p>\n<p>\u6b65\u9aa41\uff1a\u66f4\u65b0\u7cfb\u7edf<\/p>\n<p>\u5728\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u786e\u4fdd\u7cfb\u7edf\u662f\u6700\u65b0\u7248\u672c\u3002\u6253\u5f00\u7ec8\u7aef\u7a97\u53e3\u5e76\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>sudo apt update\nsudo apt upgrade<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b65\u9aa42\uff1a\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u9879<\/p>\n<p>\u5728\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u5fc5\u8981\u7684\u4f9d\u8d56\u9879\u3002\u5728\u7ec8\u7aef\u7a97\u53e3\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>sudo apt install curl openssh-server ca-certificates postfix<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b64\u547d\u4ee4\u5c06\u5b89\u88c5Curl\uff0cOpenSSH\u670d\u52a1\u5668\u548c\u8bc1\u4e66\u3001Postfix\u90ae\u4ef6\u670d\u52a1\u5668\u3002Postfix\u5c06\u7528\u4e8e\u5411\u7ba1\u7406\u5458\u53d1\u9001\u901a\u77e5\u3002<\/p>\n<p>\u6b65\u9aa43\uff1a\u5b89\u88c5GitLab<\/p>\n<p>\u5b89\u88c5\u4f9d\u8d56\u9879\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5GitLab\uff1a<\/p>\n<pre>curl -sS https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.deb.sh | sudo bash<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b64\u547d\u4ee4\u5c06\u5411\u7cfb\u7edf\u6dfb\u52a0GitLab\u5b58\u50a8\u5e93\uff0c\u5e76\u83b7\u53d6\u5b89\u88c5\u811a\u672c\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5GitLab\uff1a<\/p>\n<pre>sudo apt install gitlab-ce<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u9700\u8981\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u91cd\u65b0\u914d\u7f6eGitLab\uff1a<\/p>\n<pre>sudo gitlab-ctl reconfigure<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8be5\u547d\u4ee4\u5c06\u542f\u52a8GitLab\u7684\u914d\u7f6e\u8fc7\u7a0b\uff0c\u8be5\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u51e0\u5206\u949f\u65f6\u95f4\u3002<\/p>\n<p>\u6b65\u9aa44\uff1a\u8bbf\u95eeGitLab<\/p>\n<p>\u5728\u5b8c\u6210GitLab\u7684\u5b89\u88c5\u548c\u914d\u7f6e\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0bURL\u6765\u8bbf\u95ee\u5b83\uff1a<\/p>\n<pre>http:\/\/your-server-IP<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8bbf\u95eeURL\u65f6\uff0c\u8bf7\u5c06your-server-IP\u66ff\u6362\u4e3a\u60a8\u670d\u52a1\u5668\u7684IP\u5730\u5740\u3002<\/p>\n<p>\u6b65\u9aa45\uff1a\u767b\u5f55\u5230GitLab<\/p>\n<p>\u5728\u8bbf\u95eeURL\u540e\uff0c\u60a8\u5c06\u770b\u5230GitLab\u7684\u767b\u5f55\u9875\u9762\u3002\u4e3a\u4e86\u767b\u5f55\u5230GitLab\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u9ed8\u8ba4\u7ba1\u7406\u5458\u51ed\u636e\uff1a<\/p>\n<p>\u7528\u6237\u540d\uff1aroot<\/p>\n<p>\u5bc6\u7801\uff1a5iveL!fe<\/p>\n<p>\u767b\u5f55\u540e\uff0c\u60a8\u53ef\u4ee5\u66f4\u6539\u7ba1\u7406\u5458\u5bc6\u7801\u4ee5\u786e\u4fdd\u5b89\u5168\u6027\u3002<\/p>\n<p>\u7ed3\u8bba\uff1a<\/p>\n<p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5411\u60a8\u5c55\u793a\u4e86\u5728Ubuntu\u4e0a\u5b89\u88c5GitLab\u7684\u6b65\u9aa4\u3002\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u5148\u66f4\u65b0\u7cfb\u7edf\u5e76\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u9879\u3002\u7136\u540e\uff0c\u60a8\u9700\u8981\u4eceGitLab\u5b58\u50a8\u5e93\u5b89\u88c5GitLab\u3002\u6700\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95eeURL\u6765\u8bbf\u95eeGitLab\uff0c\u5e76\u4f7f\u7528\u7ba1\u7406\u5458\u51ed\u636e\u767b\u5f55\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u804a\u804aUbuntu\u4e0a\u5b89\u88c5GitLab\u7684\u6b65\u9aa4\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\u79cd\u5e7f\u6cdb\u4f7f\u7528\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5b83\u57fa\u4e8edebian\u548clinux\u5185\u6838\u3002\u5bf9\u4e8e\u5f00\u53d1\u4eba\u5458\u6765\u8bf4\uff0cubuntu\u662f\u4e00\u4e2a\u5f88\u68d2\u7684\u5e73\u53f0\uff0c\u56e0\u4e3a\u5b83\u5728\u5f00\u53d1\u65b9\u9762\u63d0\u4f9b\u4e86\u8bb8\u591a\u529f\u80fd\u548c\u5de5\u5177\u3002\u5176\u4e2d\u4e00\u4e2a\u6700\u6d41\u884c\u7684\u5de5\u5177\u662fgitlab\uff0c\u5b83\u662f\u4e00\u4e2a\u5f00\u6e90\u9879\u76ee\uff0c\u63d0\u4f9b\u4e86\u4e00\u79cd\u96c6\u6210\u7684\u3001web-based\u7684git\u5b58\u50a8\u5e93\u7ba1\u7406\u7cfb\u7edf\u3002\u672c\u6587\u5c06\u5411\u60a8\u4ecb\u7ecd\u5728ubuntu\u4e0a\u5b89\u88c5gitlab\u7684\u6b65\u9aa4\u3002 \u6b65\u9aa41\uff1a\u66f4\u65b0\u7cfb\u7edf \u5728\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u786e\u4fdd\u7cfb\u7edf\u662f\u6700\u65b0\u7248\u672c\u3002\u6253\u5f00\u7ec8\u7aef\u7a97\u53e3\u5e76\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a sudo apt update sudo apt upgrade \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa42\uff1a\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u9879 \u5728\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u5fc5\u8981\u7684\u4f9d\u8d56\u9879\u3002\u5728\u7ec8\u7aef\u7a97\u53e3\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a sudo apt install curl openssh-server ca-certificates postfix \u767b\u5f55\u540e\u590d\u5236 \u6b64\u547d\u4ee4\u5c06\u5b89\u88c5Curl\uff0cOpenSSH\u670d\u52a1\u5668\u548c\u8bc1\u4e66\u3001Postfix\u90ae\u4ef6\u670d\u52a1\u5668\u3002Postfix\u5c06\u7528\u4e8e\u5411\u7ba1\u7406\u5458\u53d1\u9001\u901a\u77e5\u3002 \u6b65\u9aa43\uff1a\u5b89\u88c5GitLab \u5b89\u88c5\u4f9d\u8d56\u9879\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5GitLab\uff1a curl -sS https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.deb.sh | sudo bash \u767b\u5f55\u540e\u590d\u5236 \u6b64\u547d\u4ee4\u5c06\u5411\u7cfb\u7edf\u6dfb\u52a0GitLab\u5b58\u50a8\u5e93\uff0c\u5e76\u83b7\u53d6\u5b89\u88c5\u811a\u672c\u3002 \u63a5\u4e0b\u6765\uff0c\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5GitLab\uff1a sudo apt install gitlab-ce \u767b\u5f55\u540e\u590d\u5236 \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u9700\u8981\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u91cd\u65b0\u914d\u7f6eGitLab\uff1a sudo gitlab-ctl reconfigure \u767b\u5f55\u540e\u590d\u5236 \u8be5\u547d\u4ee4\u5c06\u542f\u52a8GitLab\u7684\u914d\u7f6e\u8fc7\u7a0b\uff0c\u8be5\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u51e0\u5206\u949f\u65f6\u95f4\u3002 \u6b65\u9aa44\uff1a\u8bbf\u95eeGitLab \u5728\u5b8c\u6210GitLab\u7684\u5b89\u88c5\u548c\u914d\u7f6e\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0bURL\u6765\u8bbf\u95ee\u5b83\uff1a http:\/\/your-server-IP \u767b\u5f55\u540e\u590d\u5236 \u8bbf\u95eeURL\u65f6\uff0c\u8bf7\u5c06your-server-IP\u66ff\u6362\u4e3a\u60a8\u670d\u52a1\u5668\u7684IP\u5730\u5740\u3002 \u6b65\u9aa45\uff1a\u767b\u5f55\u5230GitLab \u5728\u8bbf\u95eeURL\u540e\uff0c\u60a8\u5c06\u770b\u5230GitLab\u7684\u767b\u5f55\u9875\u9762\u3002\u4e3a\u4e86\u767b\u5f55\u5230GitLab\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u9ed8\u8ba4\u7ba1\u7406\u5458\u51ed\u636e\uff1a \u7528\u6237\u540d\uff1aroot \u5bc6\u7801\uff1a5iveL!fe \u767b\u5f55\u540e\uff0c\u60a8\u53ef\u4ee5\u66f4\u6539\u7ba1\u7406\u5458\u5bc6\u7801\u4ee5\u786e\u4fdd\u5b89\u5168\u6027\u3002 \u7ed3\u8bba\uff1a \u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5411\u60a8\u5c55\u793a\u4e86\u5728Ubuntu\u4e0a\u5b89\u88c5GitLab\u7684\u6b65\u9aa4\u3002\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u5148\u66f4\u65b0\u7cfb\u7edf\u5e76\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u9879\u3002\u7136\u540e\uff0c\u60a8\u9700\u8981\u4eceGitLab\u5b58\u50a8\u5e93\u5b89\u88c5GitLab\u3002\u6700\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95eeURL\u6765\u8bbf\u95eeGitLab\uff0c\u5e76\u4f7f\u7528\u7ba1\u7406\u5458\u51ed\u636e\u767b\u5f55\u3002 [&hellip;]<\/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-19009","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19009","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=19009"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19009\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}