{"id":18803,"date":"2024-11-19T17:46:47","date_gmt":"2024-11-19T09:46:47","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18803\/"},"modified":"2024-11-19T17:46:47","modified_gmt":"2024-11-19T09:46:47","slug":"centos%e4%b8%8a%e6%80%8e%e4%b9%88%e6%90%ad%e5%bb%bagitlab%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18803\/","title":{"rendered":"CentOS\u4e0a\u600e\u4e48\u642d\u5efaGitLab\u670d\u52a1\u5668"},"content":{"rendered":"<p>gitlab\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u57fa\u4e8eweb\u7684git\u5b58\u50a8\u5e93\u7ba1\u7406\u5e94\u7528\u7a0b\u5e8f\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u56e2\u961f\u66f4\u597d\u5730\u7f16\u5199\u3001\u7ba1\u7406\u548c\u534f\u4f5c\u4ee3\u7801\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728centos\u4e0a\u642d\u5efagitlab\u670d\u52a1\u5668\uff0c\u4ee5\u65b9\u4fbf\u56e2\u961f\u534f\u4f5c\u5f00\u53d1\u3002<\/p>\n<p>\u6b65\u9aa4\u4e00\uff1a\u5b89\u88c5\u4f9d\u8d56<\/p>\n<p>\u5728\u5f00\u59cb\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u5b89\u88c5\u4e00\u4e9b\u4f9d\u8d56\u8f6f\u4ef6\uff1a<\/p>\n<pre>sudo yum install curl policycoreutils-python openssh-server openssh-clients\nsudo systemctl enable sshd\nsudo systemctl start sshd\nsudo firewall-cmd --permanent --add-service=http\nsudo systemctl reload firewalld<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b65\u9aa4\u4e8c\uff1a\u5b89\u88c5GitLab<\/p>\n<p>\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u6dfb\u52a0GitLab\u8f6f\u4ef6\u5305\u7684\u6e90\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cCentOS\u4ed3\u5e93\u4e2d\u6ca1\u6709GitLab\u8f6f\u4ef6\u5305\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u9700\u8981\u624b\u52a8\u5c06\u6e90\u6dfb\u52a0\u5230CentOS\u4e2d\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre>curl https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.rpm.sh | sudo bash<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5f53\u6dfb\u52a0\u6e90\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u9700\u8981\u66f4\u65b0\u4e00\u4e0b\u7cfb\u7edf\u5e76\u5b89\u88c5GitLab\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>sudo yum install gitlab-ce<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u65f6\uff0cGitLab\u88ab\u5b89\u88c5\u5728\u4e86\u7cfb\u7edf\u7684\/opt\/gitlab\uff0f\u4e0b\u9762\uff0c\u800c\u914d\u7f6e\u6587\u4ef6\u5728\/etc\/gitlab\/\u4e2d\u3002<\/p>\n<p>\u6b65\u9aa4\u4e09\uff1a\u914d\u7f6eGitLab<\/p>\n<p>\u5b89\u88c5\u5b8cGitLab\u4e4b\u540e\uff0c\u6211\u4eec\u9700\u8981\u8fdb\u884c\u914d\u7f6e\uff0c\u5728GitLab\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fdb\u884c\u76f8\u5173\u8bbe\u7f6e\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91\u4ee5\u4e0b\u6587\u4ef6\uff1a<\/p>\n<pre>sudo vim \/etc\/gitlab\/gitlab.rb<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5728\u8be5\u6587\u4ef6\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u914d\u7f6eGitLab\u7684\u5404\u79cd\u9009\u9879\uff0c\u4f8b\u5982\u7535\u5b50\u90ae\u4ef6\u7684SMTP\uff0c\u5907\u4efd\u8def\u5f84\u7b49\u7b49\u3002\u5728\u4e00\u4e9b\u7279\u6b8a\u60c5\u51b5\u4e0b\uff0c\u4f8b\u5982\u81ea\u5b9a\u4e49\u57df\uff0c\u9700\u8981\u8fdb\u4e00\u6b65\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u3002\u8bbe\u7f6e\u7ed3\u675f\u540e\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u4f7f\u66f4\u6539\u751f\u6548\u3002<\/p>\n<pre>sudo gitlab-ctl reconfigure<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>GitLab\u7684\u914d\u7f6e\u8fc7\u7a0b\u5230\u6b64\u7ed3\u675f\uff0c\u6211\u4eec\u53ef\u4ee5\u5f00\u59cb\u6d4b\u8bd5GitLab\u670d\u52a1\u5668\u662f\u5426\u80fd\u591f\u6b63\u5e38\u8bbf\u95ee\u4e86\u3002<\/p>\n<p>\u6b65\u9aa4\u56db\uff1a\u767b\u5f55GitLab<\/p>\n<p>\u5f53\u6211\u4eec\u5b8c\u6210\u4e86\u524d\u9762\u7684\u8bbe\u7f6e\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95ee\u4ee5\u4e0b\u5730\u5740\u67e5\u770bGitLab\u7684Web\u754c\u9762\u3002<\/p>\n<pre>http:\/\/&lt;GitLab\u670d\u52a1\u5668IP-address&gt;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5728\u8bbf\u95ee\u5730\u5740\u540e\uff0c\u4f1a\u8df3\u8f6c\u5230\u767b\u5f55\u9875\u9762\uff0c\u5728\u7b2c\u4e00\u6b21\u767b\u5f55\u524d\uff0c\u9700\u8981\u8bbe\u7f6e\u4e00\u4e2a\u9ed8\u8ba4\u7684\u7ba1\u7406\u5458\u5bc6\u7801\u3002<\/p>\n<p>\u603b\u7ed3<\/p>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u6211\u4eec\u6210\u529f\u5730\u5728CentOS\u4e0a\u642d\u5efa\u4e86GitLab\u670d\u52a1\u5668\uff0c\u914d\u7f6e\u6210\u529f\u540e\uff0c\u4f60\u53ef\u4ee5\u548c\u4f60\u7684\u56e2\u961f\u6210\u5458\u534f\u4f5c\u5f00\u53d1\u3002\u5728\u6b64\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c GitLab\u670d\u52a1\u5668\u7684\u6709\u6548\u6027\u59cb\u7ec8\u6765\u81ea\u4e8e\u5b89\u5168\uff0c\u6211\u4eec\u5e94\u8be5\u5408\u7406\u89c4\u5212\u548c\u7ba1\u7406\u8d26\u6237\u3001\u6743\u9650\u7b49\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fCentOS\u4e0a\u600e\u4e48\u642d\u5efaGitLab\u670d\u52a1\u5668\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\u5f00\u6e90\u7684\u57fa\u4e8eweb\u7684git\u5b58\u50a8\u5e93\u7ba1\u7406\u5e94\u7528\u7a0b\u5e8f\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u56e2\u961f\u66f4\u597d\u5730\u7f16\u5199\u3001\u7ba1\u7406\u548c\u534f\u4f5c\u4ee3\u7801\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728centos\u4e0a\u642d\u5efagitlab\u670d\u52a1\u5668\uff0c\u4ee5\u65b9\u4fbf\u56e2\u961f\u534f\u4f5c\u5f00\u53d1\u3002 \u6b65\u9aa4\u4e00\uff1a\u5b89\u88c5\u4f9d\u8d56 \u5728\u5f00\u59cb\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u5b89\u88c5\u4e00\u4e9b\u4f9d\u8d56\u8f6f\u4ef6\uff1a sudo yum install curl policycoreutils-python openssh-server openssh-clients sudo systemctl enable sshd sudo systemctl start sshd sudo firewall-cmd &#8211;permanent &#8211;add-service=http sudo systemctl reload firewalld \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4\u4e8c\uff1a\u5b89\u88c5GitLab \u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u6dfb\u52a0GitLab\u8f6f\u4ef6\u5305\u7684\u6e90\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cCentOS\u4ed3\u5e93\u4e2d\u6ca1\u6709GitLab\u8f6f\u4ef6\u5305\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u9700\u8981\u624b\u52a8\u5c06\u6e90\u6dfb\u52a0\u5230CentOS\u4e2d\uff0c\u5982\u4e0b\u6240\u793a\uff1a curl https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.rpm.sh | sudo bash \u767b\u5f55\u540e\u590d\u5236 \u5f53\u6dfb\u52a0\u6e90\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u9700\u8981\u66f4\u65b0\u4e00\u4e0b\u7cfb\u7edf\u5e76\u5b89\u88c5GitLab\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a sudo yum install gitlab-ce \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u65f6\uff0cGitLab\u88ab\u5b89\u88c5\u5728\u4e86\u7cfb\u7edf\u7684\/opt\/gitlab\uff0f\u4e0b\u9762\uff0c\u800c\u914d\u7f6e\u6587\u4ef6\u5728\/etc\/gitlab\/\u4e2d\u3002 \u6b65\u9aa4\u4e09\uff1a\u914d\u7f6eGitLab \u5b89\u88c5\u5b8cGitLab\u4e4b\u540e\uff0c\u6211\u4eec\u9700\u8981\u8fdb\u884c\u914d\u7f6e\uff0c\u5728GitLab\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fdb\u884c\u76f8\u5173\u8bbe\u7f6e\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91\u4ee5\u4e0b\u6587\u4ef6\uff1a sudo vim \/etc\/gitlab\/gitlab.rb \u767b\u5f55\u540e\u590d\u5236 \u5728\u8be5\u6587\u4ef6\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u914d\u7f6eGitLab\u7684\u5404\u79cd\u9009\u9879\uff0c\u4f8b\u5982\u7535\u5b50\u90ae\u4ef6\u7684SMTP\uff0c\u5907\u4efd\u8def\u5f84\u7b49\u7b49\u3002\u5728\u4e00\u4e9b\u7279\u6b8a\u60c5\u51b5\u4e0b\uff0c\u4f8b\u5982\u81ea\u5b9a\u4e49\u57df\uff0c\u9700\u8981\u8fdb\u4e00\u6b65\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u3002\u8bbe\u7f6e\u7ed3\u675f\u540e\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u4f7f\u66f4\u6539\u751f\u6548\u3002 sudo gitlab-ctl reconfigure \u767b\u5f55\u540e\u590d\u5236 GitLab\u7684\u914d\u7f6e\u8fc7\u7a0b\u5230\u6b64\u7ed3\u675f\uff0c\u6211\u4eec\u53ef\u4ee5\u5f00\u59cb\u6d4b\u8bd5GitLab\u670d\u52a1\u5668\u662f\u5426\u80fd\u591f\u6b63\u5e38\u8bbf\u95ee\u4e86\u3002 \u6b65\u9aa4\u56db\uff1a\u767b\u5f55GitLab [&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-18803","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18803","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=18803"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18803\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}