{"id":19030,"date":"2024-11-19T14:10:36","date_gmt":"2024-11-19T06:10:36","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19030\/"},"modified":"2024-11-19T14:10:36","modified_gmt":"2024-11-19T06:10:36","slug":"%e5%b8%a6%e4%bd%a0%e4%b8%80%e6%ad%a5%e6%ad%a5%e5%9c%a8centos%e5%ae%89%e8%a3%85gitlab","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19030\/","title":{"rendered":"\u5e26\u4f60\u4e00\u6b65\u6b65\u5728CentOS\u5b89\u88c5GitLab"},"content":{"rendered":"<p>\u968f\u7740\u73b0\u4ee3\u8f6f\u4ef6\u5f00\u53d1\u6d41\u7a0b\u7684\u4e0d\u65ad\u8fdb\u5316\uff0c\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u5df2\u7ecf\u6210\u4e3a\u6bcf\u4e2a\u5f00\u53d1\u56e2\u961f\u5fc5\u4e0d\u53ef\u5c11\u7684\u5de5\u5177\u3002\u800cgitlab\uff0c\u4f5c\u4e3a\u4e00\u4e2a\u5b8c\u6574\u7684\u5f00\u6e90git\u7ba1\u7406\u7cfb\u7edf\uff0c\u5df2\u6210\u4e3a\u8bb8\u591a\u516c\u53f8\u548c\u7ec4\u7ec7\u7684\u9996\u9009\uff0c\u4f7f\u56e2\u961f\u534f\u540c\u5de5\u4f5c\u66f4\u52a0\u9ad8\u6548\u5feb\u6377\u3002\u672c\u6587\u5c06\u5e26\u4f60\u4e00\u6b65\u6b65\u5b89\u88c5gitlab\uff0c\u5e76\u5728centos 7\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u914d\u7f6e\u5b83\u3002<\/p>\n<h2>\u51c6\u5907\u5de5\u4f5c<\/h2>\n<p>\u5728\u5f00\u59cb\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u786e\u4fdd\u4ee5\u4e0b\u51e0\u9879\u51c6\u5907\u5de5\u4f5c\uff1a<\/p>\n<ol>\n<li>CentOS 7\u64cd\u4f5c\u7cfb\u7edf<\/li>\n<li>\u5b89\u88c5\u5e76\u914d\u7f6e\u597dPostgreSQL\u6216MySQL\u6570\u636e\u5e93<\/li>\n<li>\u5b89\u88c5\u548c\u914d\u7f6e\u90ae\u4ef6\u670d\u52a1\u5668\uff08\u5982\u679c\u9700\u8981\uff09<\/li>\n<\/ol>\n<p>\u786e\u4fdd\u8fd9\u4e9b\u51c6\u5907\u5de5\u4f5c\u90fd\u5df2\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5f00\u59cb\u5b89\u88c5GitLab\u4e86\u3002<\/p>\n<h2>\u6b65\u9aa4 1\uff1a\u5b89\u88c5\u4f9d\u8d56\u9879<\/h2>\n<p>\u6211\u4eec\u9700\u8981\u5148\u5b89\u88c5\u4e00\u4e9b\u4f9d\u8d56\u9879\uff0c\u624d\u80fd\u6210\u529f\u5b89\u88c5GitLab\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u6240\u9700\u7684\u4f9d\u8d56\u9879\uff1a<\/p>\n<pre>sudo yum install -y curl policycoreutils 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<h2>\u6b65\u9aa4 2\uff1a\u5b89\u88c5GitLab<\/h2>\n<p>\u5728 CentOS \u4e0a\u5b89\u88c5 GitLab\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 Omnibus \u8f6f\u4ef6\u5305\u3002\u8981\u5b89\u88c5 Omnibus \u8f6f\u4ef6\u5305\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>curl https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.rpm.sh | sudo bash\nsudo yum install -y gitlab-ce<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4e0a\u8ff0\u547d\u4ee4\u5c06\u901a\u8fc7GitLab Repositories\u5b89\u88c5GitLab CE\u3002<\/p>\n<h2>\u6b65\u9aa4 3\uff1a\u914d\u7f6e\u548c\u542f\u52a8GitLab<\/h2>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u9700\u8981\u914d\u7f6e\u5e76\u542f\u52a8GitLab\u3002\u9996\u5148\uff0c\u60a8\u9700\u8981\u7f16\u8f91\u4ee5\u4e0b\u6587\u4ef6\uff1a<\/p>\n<pre>sudo vi \/etc\/gitlab\/gitlab.rb<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u60a8\u9700\u8981\u6839\u636e\u60a8\u81ea\u5df1\u7684\u9700\u8981\u914d\u7f6eGitLab\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4ec5\u4ecb\u7ecd\u4e00\u4e9b\u57fa\u672c\u914d\u7f6e\uff0c\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8fdb\u884c\u66f4\u6539\u3002<\/p>\n<pre>external_url 'http:\/\/gitlab.example.com'\n\n...\n...\n\npostgresql['enable'] = false\nmysql['enable'] = true\nmysql['client_encoding'] = 'utf8mb4'\nmysql['utf8mb4'] = true\n\n...\n...\n\ngitlab_rails['smtp_enable'] = true\ngitlab_rails['smtp_address'] = \"smtp.gmail.com\"\ngitlab_rails['smtp_port'] = 587\ngitlab_rails['smtp_user_name'] = \"gitlab@example.com\"\ngitlab_rails['smtp_password'] = \"smtp_password\"\ngitlab_rails['smtp_domain'] = \"example.com\"\ngitlab_rails['smtp_authentication'] = \"login\"\ngitlab_rails['smtp_enable_starttls_auto'] = true<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5728\u60a8\u5b8c\u6210\u914d\u7f6e\u540e\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u91cd\u542fGitLab\u670d\u52a1\uff1a<\/p>\n<pre>sudo gitlab-ctl reconfigure\nsudo gitlab-ctl restart<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<h2>\u6b65\u9aa4 4\uff1a\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95eeGitLab<\/h2>\n<p>\u73b0\u5728\u60a8\u53ef\u4ee5\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95eeGitLab\u3002\u5728\u6d4f\u89c8\u5668\u4e2d\u952e\u5165\u60a8\u5b89\u88c5\u7684\u670d\u52a1\u5668\u7684IP\u5730\u5740\u6216\u57df\u540d\uff0c\u540e\u9762\u52a0\u4e0a&#8217;\/&#8217;\u548c&#8217;users\/sign_in&#8217;\uff0c\u4ee5\u767b\u5f55\u5230GitLab\u3002<\/p>\n<pre>http:\/\/&lt;server-ip&gt;\/users\/sign_in<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u73b0\u5728\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u9884\u5148\u5b9a\u4e49\u7684\u9ed8\u8ba4\u7ba1\u7406\u5458\u5e10\u6237admin@example.com\u767b\u5f55\u5e76\u5f00\u59cb\u4f7f\u7528GitLab\u4e86\u3002\u4f46\u662f\uff0c\u4e3a\u4e86\u786e\u4fdd\u5b89\u5168\u6027\uff0c\u8bf7\u6839\u636e\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u7ba1\u7406\u5458\u5e10\u6237\u5e76\u5220\u9664\u9ed8\u8ba4\u7ba1\u7406\u5458\u5e10\u6237\u3002<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u5728\u672c\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u4ecb\u7ecd\u4e86\u5728 CentOS 7 \u4e0a\u5b89\u88c5 GitLab \u7684\u6b65\u9aa4\u3002\u6211\u4eec\u4f9d\u6b21\u5b89\u88c5\u4e86\u4f9d\u8d56\u9879\uff0c\u4f7f\u7528 Omnibus \u8f6f\u4ef6\u5305\u5b89\u88c5\u4e86 GitLab CE \uff0c\u7136\u540e\u914d\u7f6e\u548c\u542f\u52a8\u4e86 GitLab\u3002\u73b0\u5728\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 GitLab \u7ba1\u7406\u60a8\u7684\u9879\u76ee\u548c\u534f\u540c\u5de5\u4f5c\u4e86\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5e26\u4f60\u4e00\u6b65\u6b65\u5728CentOS\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>\u968f\u7740\u73b0\u4ee3\u8f6f\u4ef6\u5f00\u53d1\u6d41\u7a0b\u7684\u4e0d\u65ad\u8fdb\u5316\uff0c\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u5df2\u7ecf\u6210\u4e3a\u6bcf\u4e2a\u5f00\u53d1\u56e2\u961f\u5fc5\u4e0d\u53ef\u5c11\u7684\u5de5\u5177\u3002\u800cgitlab\uff0c\u4f5c\u4e3a\u4e00\u4e2a\u5b8c\u6574\u7684\u5f00\u6e90git\u7ba1\u7406\u7cfb\u7edf\uff0c\u5df2\u6210\u4e3a\u8bb8\u591a\u516c\u53f8\u548c\u7ec4\u7ec7\u7684\u9996\u9009\uff0c\u4f7f\u56e2\u961f\u534f\u540c\u5de5\u4f5c\u66f4\u52a0\u9ad8\u6548\u5feb\u6377\u3002\u672c\u6587\u5c06\u5e26\u4f60\u4e00\u6b65\u6b65\u5b89\u88c5gitlab\uff0c\u5e76\u5728centos 7\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u914d\u7f6e\u5b83\u3002 \u51c6\u5907\u5de5\u4f5c \u5728\u5f00\u59cb\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u786e\u4fdd\u4ee5\u4e0b\u51e0\u9879\u51c6\u5907\u5de5\u4f5c\uff1a CentOS 7\u64cd\u4f5c\u7cfb\u7edf \u5b89\u88c5\u5e76\u914d\u7f6e\u597dPostgreSQL\u6216MySQL\u6570\u636e\u5e93 \u5b89\u88c5\u548c\u914d\u7f6e\u90ae\u4ef6\u670d\u52a1\u5668\uff08\u5982\u679c\u9700\u8981\uff09 \u786e\u4fdd\u8fd9\u4e9b\u51c6\u5907\u5de5\u4f5c\u90fd\u5df2\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5f00\u59cb\u5b89\u88c5GitLab\u4e86\u3002 \u6b65\u9aa4 1\uff1a\u5b89\u88c5\u4f9d\u8d56\u9879 \u6211\u4eec\u9700\u8981\u5148\u5b89\u88c5\u4e00\u4e9b\u4f9d\u8d56\u9879\uff0c\u624d\u80fd\u6210\u529f\u5b89\u88c5GitLab\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u6240\u9700\u7684\u4f9d\u8d56\u9879\uff1a sudo yum install -y curl policycoreutils 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 2\uff1a\u5b89\u88c5GitLab \u5728 CentOS \u4e0a\u5b89\u88c5 GitLab\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 Omnibus \u8f6f\u4ef6\u5305\u3002\u8981\u5b89\u88c5 Omnibus \u8f6f\u4ef6\u5305\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a curl https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.rpm.sh | sudo bash sudo yum install [&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-19030","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19030","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=19030"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19030\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}