{"id":19041,"date":"2024-11-19T09:46:34","date_gmt":"2024-11-19T01:46:34","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19041\/"},"modified":"2024-11-19T09:46:34","modified_gmt":"2024-11-19T01:46:34","slug":"%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85gitlab%e8%bd%af%e4%bb%b6%e5%8c%85","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19041\/","title":{"rendered":"\u5982\u4f55\u5b89\u88c5GitLab\u8f6f\u4ef6\u5305"},"content":{"rendered":"<p>gitlab\u662f\u4e00\u4e2a\u57fa\u4e8egit\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u7684web\u5e73\u53f0\uff0c\u53ef\u7528\u4e8e\u4ee3\u7801\u6258\u7ba1\u3001\u56e2\u961f\u534f\u4f5c\u548c\u9879\u76ee\u7ba1\u7406\u3002\u672c\u6587\u5c06\u8bb2\u89e3\u5982\u4f55\u5b89\u88c5gitlab\u8f6f\u4ef6\u5305\u3002<\/p>\n<ol>\n<li>\u4e0b\u8f7dGitLab\u5b89\u88c5\u5305<br \/>GitLab\u6709\u4e24\u79cd\u5b89\u88c5\u5305\uff1aCE\uff08\u793e\u533a\u7248\uff09\u548cEE\uff08\u4f01\u4e1a\u7248\uff09\u3002\u4f60\u53ef\u4ee5\u6839\u636e\u4f60\u7684\u9700\u8981\u9009\u62e9\u4e0d\u540c\u7248\u672c\u3002CE\u7248\u672c\u662f\u514d\u8d39\u7684\uff0c\u800cEE\u7248\u672c\u9700\u8981\u4ed8\u8d39\uff0c\u4f46\u63d0\u4f9b\u66f4\u591a\u529f\u80fd\u548c\u652f\u6301\u3002<\/li>\n<\/ol>\n<p>\u8bbf\u95eehttps:\/\/about.gitlab.com\/install\/\uff0c\u9009\u62e9\u5408\u9002\u7684\u7248\u672c\u8fdb\u884c\u4e0b\u8f7d\u3002\u6211\u8fd9\u91cc\u9009\u62e9CE\u7248\u672c\u8fdb\u884c\u6f14\u793a\u3002\u5728\u4e0b\u8f7d\u4e4b\u524d\uff0c\u4f60\u9700\u8981\u9009\u62e9\u6240\u9700\u7684\u5b89\u88c5\u65b9\u5f0f\uff0c\u5305\u62ecDocker\u3001\u4ece\u6e90\u4ee3\u7801\u7f16\u8bd1\u548c\u4e0b\u8f7d\u5b89\u88c5\u5305\u3002<\/p>\n<ol>\n<li>\u5b89\u88c5\u4f9d\u8d56\u8f6f\u4ef6<br \/>GitLab\u662f\u4e00\u4e2a\u5305\u542b\u591a\u4e2a\u7ec4\u4ef6\u7684\u5e94\u7528\u8f6f\u4ef6\uff0c\u5b83\u9700\u8981\u4f9d\u8d56\u5176\u4ed6\u8f6f\u4ef6\u624d\u80fd\u6b63\u5e38\u8fd0\u884c\u3002<\/li>\n<\/ol>\n<p>\u5728\u5f00\u59cb\u5b89\u88c5\u4e4b\u524d\uff0c\u4f60\u9700\u8981\u5148\u5b89\u88c5\u4ee5\u4e0b\u4f9d\u8d56\u8f6f\u4ef6\uff1a<\/p>\n<ul>\n<li>curl<\/li>\n<li>openssh-server<\/li>\n<li>ca-certificates<\/li>\n<li>postfix<\/li>\n<li>tzdata<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u4f9d\u8d56\u8f6f\u4ef6\uff1a<\/p>\n<pre>sudo apt-get install curl openssh-server ca-certificates postfix tzdata<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u4f60\u9700\u8981\u4e3aPostfix\u9009\u62e9\u4e00\u4e2a\u914d\u7f6e\u6a21\u677f\u3002\u6211\u9009\u62e9\u4e86&#8221;Internet Site&#8221;\uff0c\u5e76\u4e3a\u5176\u8bbe\u7f6e\u4e86\u90ae\u4ef6\u5730\u5740\u3002\u4f60\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u8981\u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n<ol>\n<li>\u5b89\u88c5GitLab<br \/>\u5b89\u88c5GitLab\u7684\u8fc7\u7a0b\u5f88\u7b80\u5355\u3002\u9996\u5148\uff0c\u5c06\u4e0b\u8f7d\u7684GitLab\u5b89\u88c5\u5305\u4e0a\u4f20\u5230\u670d\u52a1\u5668\u3002\u5982\u679c\u4f60\u901a\u8fc7wget\u547d\u4ee4\u4e0b\u8f7d\u7684\u5b89\u88c5\u5305\uff0c\u5219\u53ef\u4ee5\u8df3\u8fc7\u6b64\u6b65\u9aa4\u3002<\/li>\n<\/ol>\n<p>\u5728\u4e0a\u4f20\u5b8c\u6210\u540e\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u89e3\u538b\u5b89\u88c5\u5305\uff1a<\/p>\n<pre>sudo tar -xf gitlab-ce-&lt;version&gt;.tar.gz<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u8fdb\u5165GitLab\u76ee\u5f55\u5e76\u8fd0\u884c\u5b89\u88c5\u547d\u4ee4\uff1a<\/p>\n<pre>sudo dpkg -i gitlab-ce-&lt;version&gt;.deb<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5b89\u88c5\u8fc7\u7a0b\u53ef\u80fd\u4f1a\u9700\u8981\u4e00\u4e9b\u65f6\u95f4\u3002\u5728\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u91cd\u7f6eGitLab\u7684root\u5bc6\u7801\uff1a<\/p>\n<pre>sudo gitlab-ctl reset-root-password<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee http:\/\/your-server-ip\/ \u6765\u8bbf\u95eeGitLab\u3002<\/p>\n<ol>\n<li>\u7279\u522b\u6ce8\u610f\u4e8b\u9879<br \/>\u5728\u5b89\u88c5GitLab\u65f6\uff0c\u8bf7\u6ce8\u610f\u4ee5\u4e0b\u4e8b\u9879\uff1a<\/li>\n<\/ol>\n<ul>\n<li>\u9700\u8981\u5360\u7528\u81f3\u5c114GB\u5185\u5b58\u7684\u670d\u52a1\u5668\u3002<\/li>\n<li>\u786e\u4fdd80\u7aef\u53e3\u672a\u88ab\u5360\u7528\uff0c\u5426\u5219\u9700\u8981\u5c06GitLab\u8bbe\u7f6e\u4e3a\u5176\u4ed6\u7aef\u53e3\u3002<\/li>\n<li>\u786e\u4fdd\u670d\u52a1\u5668\u7684\u57df\u540d\u5df2\u6b63\u786e\u914d\u7f6e\u3002<\/li>\n<\/ul>\n<p>\u603b\u4e4b\uff0cGitLab\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u7248\u672c\u7ba1\u7406\u548c\u56e2\u961f\u534f\u4f5c\u5de5\u5177\uff0c\u5b89\u88c5GitLab\u662f\u4e00\u4e2a\u76f8\u5bf9\u7b80\u5355\u7684\u8fc7\u7a0b\u3002\u5e0c\u671b\u8fd9\u4e2a\u6559\u7a0b\u80fd\u591f\u5e2e\u52a9\u4f60\u5b89\u88c5GitLab\u5e76\u7ba1\u7406\u4f60\u7684\u9879\u76ee\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5b89\u88c5GitLab\u8f6f\u4ef6\u5305\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>gitlab\u662f\u4e00\u4e2a\u57fa\u4e8egit\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u7684web\u5e73\u53f0\uff0c\u53ef\u7528\u4e8e\u4ee3\u7801\u6258\u7ba1\u3001\u56e2\u961f\u534f\u4f5c\u548c\u9879\u76ee\u7ba1\u7406\u3002\u672c\u6587\u5c06\u8bb2\u89e3\u5982\u4f55\u5b89\u88c5gitlab\u8f6f\u4ef6\u5305\u3002 \u4e0b\u8f7dGitLab\u5b89\u88c5\u5305GitLab\u6709\u4e24\u79cd\u5b89\u88c5\u5305\uff1aCE\uff08\u793e\u533a\u7248\uff09\u548cEE\uff08\u4f01\u4e1a\u7248\uff09\u3002\u4f60\u53ef\u4ee5\u6839\u636e\u4f60\u7684\u9700\u8981\u9009\u62e9\u4e0d\u540c\u7248\u672c\u3002CE\u7248\u672c\u662f\u514d\u8d39\u7684\uff0c\u800cEE\u7248\u672c\u9700\u8981\u4ed8\u8d39\uff0c\u4f46\u63d0\u4f9b\u66f4\u591a\u529f\u80fd\u548c\u652f\u6301\u3002 \u8bbf\u95eehttps:\/\/about.gitlab.com\/install\/\uff0c\u9009\u62e9\u5408\u9002\u7684\u7248\u672c\u8fdb\u884c\u4e0b\u8f7d\u3002\u6211\u8fd9\u91cc\u9009\u62e9CE\u7248\u672c\u8fdb\u884c\u6f14\u793a\u3002\u5728\u4e0b\u8f7d\u4e4b\u524d\uff0c\u4f60\u9700\u8981\u9009\u62e9\u6240\u9700\u7684\u5b89\u88c5\u65b9\u5f0f\uff0c\u5305\u62ecDocker\u3001\u4ece\u6e90\u4ee3\u7801\u7f16\u8bd1\u548c\u4e0b\u8f7d\u5b89\u88c5\u5305\u3002 \u5b89\u88c5\u4f9d\u8d56\u8f6f\u4ef6GitLab\u662f\u4e00\u4e2a\u5305\u542b\u591a\u4e2a\u7ec4\u4ef6\u7684\u5e94\u7528\u8f6f\u4ef6\uff0c\u5b83\u9700\u8981\u4f9d\u8d56\u5176\u4ed6\u8f6f\u4ef6\u624d\u80fd\u6b63\u5e38\u8fd0\u884c\u3002 \u5728\u5f00\u59cb\u5b89\u88c5\u4e4b\u524d\uff0c\u4f60\u9700\u8981\u5148\u5b89\u88c5\u4ee5\u4e0b\u4f9d\u8d56\u8f6f\u4ef6\uff1a curl openssh-server ca-certificates postfix tzdata \u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u4f9d\u8d56\u8f6f\u4ef6\uff1a sudo apt-get install curl openssh-server ca-certificates postfix tzdata \u767b\u5f55\u540e\u590d\u5236 \u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u4f60\u9700\u8981\u4e3aPostfix\u9009\u62e9\u4e00\u4e2a\u914d\u7f6e\u6a21\u677f\u3002\u6211\u9009\u62e9\u4e86&#8221;Internet Site&#8221;\uff0c\u5e76\u4e3a\u5176\u8bbe\u7f6e\u4e86\u90ae\u4ef6\u5730\u5740\u3002\u4f60\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u8981\u8fdb\u884c\u914d\u7f6e\u3002 \u5b89\u88c5GitLab\u5b89\u88c5GitLab\u7684\u8fc7\u7a0b\u5f88\u7b80\u5355\u3002\u9996\u5148\uff0c\u5c06\u4e0b\u8f7d\u7684GitLab\u5b89\u88c5\u5305\u4e0a\u4f20\u5230\u670d\u52a1\u5668\u3002\u5982\u679c\u4f60\u901a\u8fc7wget\u547d\u4ee4\u4e0b\u8f7d\u7684\u5b89\u88c5\u5305\uff0c\u5219\u53ef\u4ee5\u8df3\u8fc7\u6b64\u6b65\u9aa4\u3002 \u5728\u4e0a\u4f20\u5b8c\u6210\u540e\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u89e3\u538b\u5b89\u88c5\u5305\uff1a sudo tar -xf gitlab-ce-&lt;version&gt;.tar.gz \u767b\u5f55\u540e\u590d\u5236 \u63a5\u4e0b\u6765\uff0c\u8fdb\u5165GitLab\u76ee\u5f55\u5e76\u8fd0\u884c\u5b89\u88c5\u547d\u4ee4\uff1a sudo dpkg -i gitlab-ce-&lt;version&gt;.deb \u767b\u5f55\u540e\u590d\u5236 \u5b89\u88c5\u8fc7\u7a0b\u53ef\u80fd\u4f1a\u9700\u8981\u4e00\u4e9b\u65f6\u95f4\u3002\u5728\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u91cd\u7f6eGitLab\u7684root\u5bc6\u7801\uff1a sudo gitlab-ctl reset-root-password \u767b\u5f55\u540e\u590d\u5236 \u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee http:\/\/your-server-ip\/ \u6765\u8bbf\u95eeGitLab\u3002 \u7279\u522b\u6ce8\u610f\u4e8b\u9879\u5728\u5b89\u88c5GitLab\u65f6\uff0c\u8bf7\u6ce8\u610f\u4ee5\u4e0b\u4e8b\u9879\uff1a \u9700\u8981\u5360\u7528\u81f3\u5c114GB\u5185\u5b58\u7684\u670d\u52a1\u5668\u3002 \u786e\u4fdd80\u7aef\u53e3\u672a\u88ab\u5360\u7528\uff0c\u5426\u5219\u9700\u8981\u5c06GitLab\u8bbe\u7f6e\u4e3a\u5176\u4ed6\u7aef\u53e3\u3002 \u786e\u4fdd\u670d\u52a1\u5668\u7684\u57df\u540d\u5df2\u6b63\u786e\u914d\u7f6e\u3002 \u603b\u4e4b\uff0cGitLab\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u7248\u672c\u7ba1\u7406\u548c\u56e2\u961f\u534f\u4f5c\u5de5\u5177\uff0c\u5b89\u88c5GitLab\u662f\u4e00\u4e2a\u76f8\u5bf9\u7b80\u5355\u7684\u8fc7\u7a0b\u3002\u5e0c\u671b\u8fd9\u4e2a\u6559\u7a0b\u80fd\u591f\u5e2e\u52a9\u4f60\u5b89\u88c5GitLab\u5e76\u7ba1\u7406\u4f60\u7684\u9879\u76ee\u3002 \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5b89\u88c5GitLab\u8f6f\u4ef6\u5305\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-19041","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19041","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=19041"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19041\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}