{"id":18715,"date":"2024-11-19T17:49:49","date_gmt":"2024-11-19T09:49:49","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18715\/"},"modified":"2024-11-19T17:49:49","modified_gmt":"2024-11-19T09:49:49","slug":"ubuntu%e7%b3%bb%e7%bb%9f%e4%b8%8a%e6%80%8e%e4%b9%88%e5%ae%89%e8%a3%85gitlab","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18715\/","title":{"rendered":"Ubuntu\u7cfb\u7edf\u4e0a\u600e\u4e48\u5b89\u88c5GitLab"},"content":{"rendered":"<p>gitlab\u662f\u4e00\u4e2a\u57fa\u4e8egit\u7684\u7248\u672c\u63a7\u5236\u5e73\u53f0\uff0c\u5b83\u662f\u4f7f\u7528ruby on rails\u7f16\u7a0b\u8bed\u8a00\u5f00\u53d1\u7684\u81ea\u6258\u7ba1git\u5b58\u50a8\u5e93\u3002gitlab\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u4ee3\u7801\u7ba1\u7406\u3001\u4ee3\u7801\u5ba1\u67e5\u3001\u95ee\u9898\u8ffd\u8e2a\u548c\u6301\u7eed\u96c6\u6210\u7684\u80fd\u529b\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728ubuntu 18.04\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5b89\u88c5gitlab\u3002<\/p>\n<p>\u6b65\u9aa41 \u2013 \u5b89\u88c5\u4f9d\u8d56<\/p>\n<p>\u5728\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u9700\u8981\u5148\u5b89\u88c5\u4e00\u4e9b\u4f9d\u8d56\u3002\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u4f9d\u8d56\uff1a<\/p>\n<pre>sudo apt-get update\nsudo apt-get install -y curl openssh-server ca-certificates<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5Postfix\uff0c\u8be5\u8f6f\u4ef6\u7528\u4e8e\u5728GitLab\u4e2d\u53d1\u9001\u90ae\u4ef6\u901a\u77e5\u3002<\/p>\n<pre>sudo apt-get install -y postfix<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5b89\u88c5\u671f\u95f4\uff0c\u4f1a\u5f39\u51fa\u4e00\u4e2a\u5bf9\u8bdd\u6846\uff0c\u8bf7\u9009\u62e9\u201cInternet Site\u201d\u9009\u9879\u3002\u968f\u540e\uff0c\u4f60\u9700\u8981\u8f93\u5165\u4f60\u7684\u90ae\u4ef6\u670d\u52a1\u5668\u5730\u5740\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.php.cn\/faq\/postfix_configure.png\" class=\"aligncenter\" title=\"Ubuntu\u7cfb\u7edf\u4e0a\u600e\u4e48\u5b89\u88c5GitLab\u63d2\u56fe\" alt=\"Ubuntu\u7cfb\u7edf\u4e0a\u600e\u4e48\u5b89\u88c5GitLab\u63d2\u56fe\" \/><\/p>\n<p>\u6b65\u9aa42 \u2013 \u5b89\u88c5GitLab<\/p>\n<p>\u5b89\u88c5\u4f9d\u8d56\u4e4b\u540e\uff0c\u9700\u8981\u4f7f\u7528curl\u4e0b\u8f7d\u5b89\u88c5\u811a\u672c\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>curl 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>\u5b89\u88c5\u811a\u672c\u8fd0\u884c\u540e\uff0c\u4f60\u5c06\u770b\u5230\u4ee5\u4e0b\u8f93\u51fa\uff1a<\/p>\n<pre>Detected operating system as ubuntu\/18.04.\nChecking for curl...\nDetected curl...\nRunning apt-get update... done.\nInstalling apt-transport-https... done.\nInstalling \/etc\/apt\/sources.list.d\/gitlab_gitlab-ce.list...done.\nImporting packagecloud gpg key... done.\nRunning apt-get update...done.\n\nThe repository is setup! You can now install packages.<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u811a\u672c\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5f00\u59cb\u6267\u884c\u5b9e\u9645\u7684\u5b89\u88c5\u3002\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>sudo apt-get install gitlab-ce<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5b89\u88c5\u671f\u95f4\uff0c\u60a8\u5c06\u88ab\u8981\u6c42\u8f93\u5165\u65b0\u7684GitLab\u7ba1\u7406\u5458\u5bc6\u7801\u3002\u8f93\u5165\u597d\u5bc6\u7801\u540e\uff0c\u5b89\u88c5\u5c06\u7ee7\u7eed\u8fdb\u884c\u3002<\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8GitLab\uff1a<\/p>\n<pre>sudo gitlab-ctl reconfigure<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236    \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5b8c\u6210\u540e\uff0cGitLab\u5c06\u5728\u9ed8\u8ba4\u7aef\u53e3\uff0880\uff09\u4e0a\u542f\u52a8\u3002\u5982\u679c\u60a8\u7684\u670d\u52a1\u5668\u4e0a\u6709\u9632\u706b\u5899\uff0c\u9700\u8981\u786e\u4fddGitLab\u670d\u52a1\u7684\u5165\u7ad9\u8fde\u63a5\u88ab\u5141\u8bb8\u3002<\/p>\n<p>\u8fd9\u65f6\uff0c\u4f60\u53ef\u4ee5\u6253\u5f00Web\u6d4f\u89c8\u5668\u5e76\u8bbf\u95eehttp:\/\/your_server_ip\u5730\u5740\uff0c\u5c06\u51fa\u73b0\u5982\u4e0b\u6240\u793a\u7684GitLab\u767b\u5f55\u754c\u9762\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.php.cn\/faq\/gitlab_login.png\" class=\"aligncenter\" title=\"Ubuntu\u7cfb\u7edf\u4e0a\u600e\u4e48\u5b89\u88c5GitLab\u63d2\u56fe1\" alt=\"Ubuntu\u7cfb\u7edf\u4e0a\u600e\u4e48\u5b89\u88c5GitLab\u63d2\u56fe1\" \/><\/p>\n<p>\u901a\u8fc7\u8f93\u5165\u521a\u521a\u7ecf\u8fc7\u8bbe\u7f6e\u7684GitLab\u7ba1\u7406\u5458\u5bc6\u7801\uff0c\u4f60\u5c06\u88ab\u91cd\u5b9a\u5411\u5230GitLab\u7684\u63a7\u5236\u9762\u677f\u3002<\/p>\n<p>\u6b65\u9aa43 \u2013 \u914d\u7f6e<\/p>\n<p>\u73b0\u5728\uff0c\u6211\u4eec\u5df2\u7ecf\u6210\u529f\u5730\u5b89\u88c5\u4e86GitLab\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u77ed\u6682\u5730\u4ecb\u7ecd\u4e00\u4e9b\u914d\u7f6e\u9009\u9879\u3002<\/p>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cGitLab\u914d\u7f6e\u6587\u4ef6\u4f4d\u4e8e\/etc\/gitlab\/gitlab.rb\u3002\u53ef\u4ee5\u7f16\u8f91\u6b64\u6587\u4ef6\u4ee5\u6309\u7167\u81ea\u5df1\u7684\u9700\u6c42\u66f4\u6539\u914d\u7f6e\u3002<\/p>\n<p>\u5176\u4e2d\uff0c\u6700\u5e38\u89c1\u7684\u914d\u7f6e\u9009\u9879\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>gitlab_url \u2013 \u6307\u5b9aGitLab\u7684\u516c\u5171URL\u3002<\/li>\n<li>external_url \u2013 \u6307\u5b9aGitLab\u4f7f\u7528\u7684URL\u3002<\/li>\n<li>gitlab_shell[&#8216;git_timeout&#8217;] \u2013 \u6307\u5b9aGit\u64cd\u4f5c\u7684\u6700\u5927\u8d85\u65f6\u65f6\u95f4\u3002<\/li>\n<\/ul>\n<p>\u5728\u7f16\u8f91\u5b8c\u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u9700\u8981\u91cd\u65b0\u914d\u7f6eGitLab\u4ee5\u542f\u7528\u66f4\u6539\u3002\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>sudo gitlab-ctl reconfigure<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236    \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5b8c\u6210\u540e\uff0c\u4f60\u7684\u66f4\u6539\u5c06\u751f\u6548\u3002<\/p>\n<p>\u603b\u7ed3<\/p>\n<p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u4ecb\u7ecd\u4e86\u5982\u4f55\u5728Ubuntu 18.04\u4e0a\u5b89\u88c5GitLab\u3002\u8fd9\u4e2a\u6d41\u7a0b\u5e76\u4e0d\u590d\u6742\uff0c\u8ddf\u968f\u4e0a\u8ff0\u6b65\u9aa4\u5373\u53ef\u6210\u529f\u3002\u6b64\u5916\uff0cGitLab\u8fd8\u63d0\u4f9b\u4e86\u8bb8\u591a\u529f\u80fd\u548c\u8bbe\u7f6e\u9009\u9879\uff0c\u4ee5\u4fbf\u60a8\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u8fdb\u884c\u5b9a\u5236\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fUbuntu\u7cfb\u7edf\u4e0a\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>gitlab\u662f\u4e00\u4e2a\u57fa\u4e8egit\u7684\u7248\u672c\u63a7\u5236\u5e73\u53f0\uff0c\u5b83\u662f\u4f7f\u7528ruby on rails\u7f16\u7a0b\u8bed\u8a00\u5f00\u53d1\u7684\u81ea\u6258\u7ba1git\u5b58\u50a8\u5e93\u3002gitlab\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u4ee3\u7801\u7ba1\u7406\u3001\u4ee3\u7801\u5ba1\u67e5\u3001\u95ee\u9898\u8ffd\u8e2a\u548c\u6301\u7eed\u96c6\u6210\u7684\u80fd\u529b\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728ubuntu 18.04\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5b89\u88c5gitlab\u3002 \u6b65\u9aa41 \u2013 \u5b89\u88c5\u4f9d\u8d56 \u5728\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u9700\u8981\u5148\u5b89\u88c5\u4e00\u4e9b\u4f9d\u8d56\u3002\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u4f9d\u8d56\uff1a sudo apt-get update sudo apt-get install -y curl openssh-server ca-certificates \u767b\u5f55\u540e\u590d\u5236 \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5Postfix\uff0c\u8be5\u8f6f\u4ef6\u7528\u4e8e\u5728GitLab\u4e2d\u53d1\u9001\u90ae\u4ef6\u901a\u77e5\u3002 sudo apt-get install -y postfix \u767b\u5f55\u540e\u590d\u5236 \u5b89\u88c5\u671f\u95f4\uff0c\u4f1a\u5f39\u51fa\u4e00\u4e2a\u5bf9\u8bdd\u6846\uff0c\u8bf7\u9009\u62e9\u201cInternet Site\u201d\u9009\u9879\u3002\u968f\u540e\uff0c\u4f60\u9700\u8981\u8f93\u5165\u4f60\u7684\u90ae\u4ef6\u670d\u52a1\u5668\u5730\u5740\u3002 \u6b65\u9aa42 \u2013 \u5b89\u88c5GitLab \u5b89\u88c5\u4f9d\u8d56\u4e4b\u540e\uff0c\u9700\u8981\u4f7f\u7528curl\u4e0b\u8f7d\u5b89\u88c5\u811a\u672c\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a curl https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.deb.sh | sudo bash \u767b\u5f55\u540e\u590d\u5236 \u5b89\u88c5\u811a\u672c\u8fd0\u884c\u540e\uff0c\u4f60\u5c06\u770b\u5230\u4ee5\u4e0b\u8f93\u51fa\uff1a Detected operating system as ubuntu\/18.04. Checking for curl&#8230; Detected curl&#8230; Running apt-get update&#8230; done. Installing apt-transport-https&#8230; [&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-18715","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18715","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=18715"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18715\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}