{"id":19574,"date":"2024-11-19T10:16:16","date_gmt":"2024-11-19T02:16:16","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19574\/"},"modified":"2024-11-19T10:16:16","modified_gmt":"2024-11-19T02:16:16","slug":"centos-7%e4%b8%8b%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85gitlab%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19574\/","title":{"rendered":"CentOS 7\u4e0b\u5982\u4f55\u5b89\u88c5GitLab\u670d\u52a1\u5668"},"content":{"rendered":"<p>gitlab\u662f\u4e00\u4e2a\u57fa\u4e8egit\u7684\u4ee3\u7801\u6258\u7ba1\u4e0e\u7248\u672c\u63a7\u5236\u5e73\u53f0\uff0c\u4e0d\u4ec5\u63d0\u4f9b\u4e00\u4e2a\u5f3a\u5927\u7684\u4ee3\u7801\u534f\u4f5c\u5e73\u53f0\uff0c\u8fd8\u96c6\u6210\u4e86ci\/cd\u529f\u80fd\uff0c\u4f01\u4e1a\u7528\u6237\u53ef\u4ee5\u501f\u6b64\u5b9e\u73b0\u9ad8\u6548\u7684\u8f6f\u4ef6\u5f00\u53d1\u3001\u6301\u7eed\u96c6\u6210\u3001\u6301\u7eed\u4ea4\u4ed8\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5728centos 7\u4e2d\u5982\u4f55\u5b89\u88c5gitlab\u670d\u52a1\u5668\u3002<\/p>\n<p>\u6b65\u9aa4\u4e00\uff1a\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u9879<\/p>\n<p>\u9996\u5148\uff0c\u6211\u4eec\u8981\u5b89\u88c5\u4e00\u4e9b\u5fc5\u8981\u7684\u4f9d\u8d56\u9879\uff0c\u4ee5\u4fbf\u80fd\u591f\u5728\u6211\u4eec\u7684\u7cfb\u7edf\u4e0a\u7f16\u8bd1\u548c\u5b89\u88c5\u8f6f\u4ef6\u5305\u3002\u4ee5\u4e0b\u662f\u5b89\u88c5\u6240\u9700\u4f9d\u8d56\u9879\u7684\u547d\u4ee4\uff1a<\/p>\n<pre>sudo yum install curl policycoreutils openssh-server openssh-clients \nsudo systemctl enable sshd\nsudo systemctl start sshd\nsudo firewall-cmd --permanent --add-service=http\nsudo firewall-cmd --permanent --add-service=https\nsudo systemctl reload firewalld<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b65\u9aa4\u4e8c\uff1a\u6dfb\u52a0GitLab\u5b58\u50a8\u5e93\u5e76\u5b89\u88c5GitLab<\/p>\n<p>\u7531\u4e8eGitLab\u4e0d\u5728CentOS\u8f6f\u4ef6\u6e90\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u624b\u52a8\u6dfb\u52a0GitLab\u5b58\u50a8\u5e93\u3002\u4ee5\u4e0b\u662f\u6dfb\u52a0\u5b58\u50a8\u5e93\u7684\u547d\u4ee4\uff1a<\/p>\n<pre>sudo curl -sS 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>\u63a5\u7740\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5GitLab\uff1a<\/p>\n<pre>sudo EXTERNAL_URL=\"http:\/\/gitlab.example.com\" yum install -y gitlab-ce<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5728\u4e0a\u9762\u7684\u547d\u4ee4\u4e2d\uff0c\u9700\u8981\u5c06<strong>http:\/\/gitlab.example.com<\/strong>\u66ff\u6362\u4e3a\u60a8\u7684GitLab\u670d\u52a1\u5668\u7684\u4e3b\u673a\u540d\u6216IP\u5730\u5740\u3002<\/p>\n<p>\u6b65\u9aa4\u4e09\uff1a\u914d\u7f6eGitLab<\/p>\n<p>\u5728\u5b89\u88c5GitLab\u540e\uff0c\u9700\u8981\u5bf9\u5176\u8fdb\u884c\u4e00\u4e9b\u57fa\u672c\u914d\u7f6e\uff0c\u5982\u914d\u7f6eSMTP\u548c\u5e10\u6237\u548c\u5bc6\u7801\u7b49\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91\u4ee5\u4e0b\u6587\u4ef6\u8fdb\u884c\u914d\u7f6e\uff1a<\/p>\n<pre>sudo vi \/etc\/gitlab\/gitlab.rb<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5728\u914d\u7f6eSMTP\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u914d\u7f6e\uff1a<\/p>\n<pre>gitlab_rails['smtp_enable'] = true\ngitlab_rails['smtp_address'] = \"smtp.qq.com\"\ngitlab_rails['smtp_port'] = 465\ngitlab_rails['smtp_user_name'] = \"yourname@qq.com\"\ngitlab_rails['smtp_password'] = \"yourpassword\"\ngitlab_rails['smtp_domain'] = \"smtp.qq.com\"\ngitlab_rails['smtp_authentication'] = \"login\"\ngitlab_rails['smtp_enable_starttls_auto'] = true\ngitlab_rails['smtp_tls'] = true<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8bf7\u6ce8\u610f\uff0c\u4e0a\u8ff0\u914d\u7f6e\u4e2d\uff0c\u9700\u8981\u5c06<strong>smtp_address<\/strong>\u66ff\u6362\u4e3a\u60a8\u7684SMTP\u670d\u52a1\u5668\u5730\u5740\uff0c\u5c06<strong>smtp_user_name<\/strong>\u548c<strong>smtp_password<\/strong>\u66ff\u6362\u4e3a\u60a8\u7684SMTP\u5e10\u6237\u548c\u5bc6\u7801\u3002<\/p>\n<p>\u63d0\u4ea4\u66f4\u6539\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u91cd\u65b0\u914d\u7f6eGitLab\uff1a<\/p>\n<pre>sudo gitlab-ctl reconfigure<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b65\u9aa4\u56db\uff1a\u8bbf\u95eeGitLab<\/p>\n<p>\u73b0\u5728\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95eeGitLab\u4e86\u3002\u4ec5\u9700\u5728\u5730\u5740\u680f\u4e2d\u8f93\u5165\u60a8\u7684\u670d\u52a1\u5668IP\u5730\u5740\u6216\u4e3b\u673a\u540d\uff0c\u5373\u53ef\u6253\u5f00GitLab\u754c\u9762\u3002\u7136\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u7ba1\u7406\u5458\u5e10\u6237\u767b\u5f55\u5e76\u5f00\u59cb\u4f7f\u7528GitLab\u3002<\/p>\n<p>\u603b\u7ed3<\/p>\n<p>\u5b89\u88c5GitLab\u670d\u52a1\u5668\u5e76\u4e0d\u590d\u6742\uff0c\u53ea\u9700\u6309\u7167\u4e0a\u8ff0\u6b65\u9aa4\u9010\u4e00\u6267\u884c\u5373\u53ef\u3002\u65e0\u8bba\u60a8\u662f\u5927\u578b\u4f01\u4e1a\u8fd8\u662f\u72ec\u7acb\u5f00\u53d1\u4eba\u5458\uff0cGitLab\u4f5c\u4e3a\u4ee3\u7801\u534f\u4f5c\u548c\u7248\u672c\u63a7\u5236\u5e73\u53f0\u90fd\u4e3a\u60a8\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u652f\u6301\u5173\u952e\u4e1a\u52a1\u6d41\u7a0b\u548c\u7075\u6d3b\u7684\u5f00\u53d1\u65b9\u5f0f\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fCentOS 7\u4e0b\u5982\u4f55\u5b89\u88c5GitLab\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\u57fa\u4e8egit\u7684\u4ee3\u7801\u6258\u7ba1\u4e0e\u7248\u672c\u63a7\u5236\u5e73\u53f0\uff0c\u4e0d\u4ec5\u63d0\u4f9b\u4e00\u4e2a\u5f3a\u5927\u7684\u4ee3\u7801\u534f\u4f5c\u5e73\u53f0\uff0c\u8fd8\u96c6\u6210\u4e86ci\/cd\u529f\u80fd\uff0c\u4f01\u4e1a\u7528\u6237\u53ef\u4ee5\u501f\u6b64\u5b9e\u73b0\u9ad8\u6548\u7684\u8f6f\u4ef6\u5f00\u53d1\u3001\u6301\u7eed\u96c6\u6210\u3001\u6301\u7eed\u4ea4\u4ed8\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5728centos 7\u4e2d\u5982\u4f55\u5b89\u88c5gitlab\u670d\u52a1\u5668\u3002 \u6b65\u9aa4\u4e00\uff1a\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u9879 \u9996\u5148\uff0c\u6211\u4eec\u8981\u5b89\u88c5\u4e00\u4e9b\u5fc5\u8981\u7684\u4f9d\u8d56\u9879\uff0c\u4ee5\u4fbf\u80fd\u591f\u5728\u6211\u4eec\u7684\u7cfb\u7edf\u4e0a\u7f16\u8bd1\u548c\u5b89\u88c5\u8f6f\u4ef6\u5305\u3002\u4ee5\u4e0b\u662f\u5b89\u88c5\u6240\u9700\u4f9d\u8d56\u9879\u7684\u547d\u4ee4\uff1a sudo yum install curl policycoreutils openssh-server openssh-clients sudo systemctl enable sshd sudo systemctl start sshd sudo firewall-cmd &#8211;permanent &#8211;add-service=http sudo firewall-cmd &#8211;permanent &#8211;add-service=https sudo systemctl reload firewalld \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4\u4e8c\uff1a\u6dfb\u52a0GitLab\u5b58\u50a8\u5e93\u5e76\u5b89\u88c5GitLab \u7531\u4e8eGitLab\u4e0d\u5728CentOS\u8f6f\u4ef6\u6e90\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u624b\u52a8\u6dfb\u52a0GitLab\u5b58\u50a8\u5e93\u3002\u4ee5\u4e0b\u662f\u6dfb\u52a0\u5b58\u50a8\u5e93\u7684\u547d\u4ee4\uff1a sudo curl -sS https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.rpm.sh | sudo bash \u767b\u5f55\u540e\u590d\u5236 \u63a5\u7740\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5GitLab\uff1a sudo EXTERNAL_URL=&#8221;http:\/\/gitlab.example.com&#8221; yum install -y gitlab-ce \u767b\u5f55\u540e\u590d\u5236 \u5728\u4e0a\u9762\u7684\u547d\u4ee4\u4e2d\uff0c\u9700\u8981\u5c06http:\/\/gitlab.example.com\u66ff\u6362\u4e3a\u60a8\u7684GitLab\u670d\u52a1\u5668\u7684\u4e3b\u673a\u540d\u6216IP\u5730\u5740\u3002 \u6b65\u9aa4\u4e09\uff1a\u914d\u7f6eGitLab \u5728\u5b89\u88c5GitLab\u540e\uff0c\u9700\u8981\u5bf9\u5176\u8fdb\u884c\u4e00\u4e9b\u57fa\u672c\u914d\u7f6e\uff0c\u5982\u914d\u7f6eSMTP\u548c\u5e10\u6237\u548c\u5bc6\u7801\u7b49\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91\u4ee5\u4e0b\u6587\u4ef6\u8fdb\u884c\u914d\u7f6e\uff1a sudo vi [&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-19574","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19574","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=19574"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19574\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}