{"id":19303,"date":"2024-11-19T14:39:06","date_gmt":"2024-11-19T06:39:06","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19303\/"},"modified":"2024-11-19T14:39:06","modified_gmt":"2024-11-19T06:39:06","slug":"%e8%af%a6%e8%a7%a3centos%e4%b8%ad%e4%b8%80%e9%94%ae%e5%ae%89%e8%a3%85gitlab%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19303\/","title":{"rendered":"\u8be6\u89e3centos\u4e2d\u4e00\u952e\u5b89\u88c5gitlab\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>gitlab \u662f\u4e00\u4e2a\u5f00\u6e90\u3001web \u754c\u9762\u7684 git \u4ee3\u7801\u6258\u7ba1\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5728\u56e2\u961f\u534f\u4f5c\u5f00\u53d1\u4e2d\u66f4\u597d\u5730\u7ba1\u7406\u4ee3\u7801\u3002\u5982\u679c\u4f60\u662f\u4e00\u540d\u5f00\u53d1\u8005\uff0c\u90a3\u4e48\u5f88\u53ef\u80fd\u4f1a\u9047\u5230\u4ee5\u4e0b\u60c5\u51b5\uff1a<\/p>\n<ul>\n<li>\u540c\u4e8b\u4fee\u6539\u4e86\u4f60\u7684\u4ee3\u7801\uff0c\u4f46\u6ca1\u6709\u901a\u77e5\u4f60\uff1b<\/li>\n<li>\u591a\u4e2a\u4eba\u5171\u540c\u7f16\u5199\u4e86\u540c\u4e00\u4e2a\u4ee3\u7801\u5e93\uff1b<\/li>\n<li>\u6ca1\u6709\u5907\u4efd\u4ee3\u7801\uff0c\u9020\u6210\u4ee3\u7801\u4e22\u5931\u3002<\/li>\n<\/ul>\n<p>\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 GitLab \u6765\u7ba1\u7406\u4ee3\u7801\uff0c\u4e0b\u9762\u6211\u4eec\u5c31\u6765\u4ecb\u7ecd\u4e00\u4e0b CentOS GitLab \u4e00\u952e\u5b89\u88c5\u65b9\u6cd5\u3002<\/p>\n<p>\u4e00\u3001\u5b89\u88c5\u6700\u65b0\u7248 Git<\/p>\n<p>\u5728\u5b89\u88c5 GitLab \u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u5b89\u88c5 Git\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>sudo yum -y update\nsudo yum -y install git<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4e8c\u3001\u5b89\u88c5\u4f9d\u8d56\u9879<\/p>\n<p>GitLab \u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9700\u8981\u4e00\u4e9b\u4f9d\u8d56\u9879\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<pre>sudo yum install -y 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>\u4e09\u3001\u5b89\u88c5 GitLab<\/p>\n<p>\u5728\u5b89\u88c5 GitLab \u524d\uff0c\u6211\u4eec\u9700\u8981\u6dfb\u52a0 GitLab \u955c\u50cf\u5e93\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>curl https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ee\/script.rpm.sh | sudo bash<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c GitLab \u5b89\u88c5\uff1a<\/p>\n<pre>sudo yum install -y gitlab-ee<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u56db\u3001\u914d\u7f6e GitLab<\/p>\n<p>\u8fdb\u5165 GitLab \u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<pre>sudo vim \/etc\/gitlab\/gitlab.rb<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ul>\n<li>\u4fee\u6539 GitLab \u7f51\u5740\uff1a<\/li>\n<\/ul>\n<p>\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u627e\u5230 \u201cExternal URL\u201d\uff0c\u5c06\u5176\u4fee\u6539\u4e3a\u81ea\u5df1\u7684\u670d\u52a1\u5668\u5730\u5740\u548c\u7aef\u53e3\u3002\u4f8b\u5982\uff1a<\/p>\n<pre>external_url 'http:\/\/192.168.1.100:80'<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ul>\n<li>\u4fee\u6539 SMTP \u90ae\u4ef6\u670d\u52a1\u5668\uff1a<\/li>\n<\/ul>\n<p>\u627e\u5230 \u201cgitlab_rails[\u2018smtp_enable\u2019] = true\u201d\uff0c\u5e76\u5c06\u5176\u4fee\u6539\u4e3a\uff1a<\/p>\n<pre>gitlab_rails['smtp_enable'] = true\ngitlab_rails['smtp_address'] = \"smtp.exmail.qq.com\"\ngitlab_rails['smtp_port'] = 465\ngitlab_rails['smtp_user_name'] = \"your_email@your_domain.com\"\ngitlab_rails['smtp_password'] = \"your_password\"\ngitlab_rails['smtp_authentication'] = \"login\"\ngitlab_rails['smtp_enable_starttls_auto'] = true\ngitlab_rails['smtp_tls'] = true\ngitlab_rails['smtp_openssl_verify_mode'] = 'none'<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4e94\u3001\u542f\u52a8 GitLab<\/p>\n<p>\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<pre>sudo gitlab-ctl reconfigure<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u542f\u52a8 GitLab\uff1a<\/p>\n<pre>sudo gitlab-ctl start<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u81f3\u6b64\uff0c\u6211\u4eec\u5df2\u7ecf\u5b8c\u6210\u4e86 CentOS GitLab \u4e00\u952e\u5b89\u88c5\uff0c\u53ef\u4ee5\u4f7f\u7528\u6d4f\u89c8\u5668\u8bbf\u95ee\u6211\u4eec\u7684 GitLab \u670d\u52a1\u4e86\u3002\u5728\u6d4f\u89c8\u5668\u5730\u5740\u680f\u8f93\u5165\u670d\u52a1\u5668\u5730\u5740\u548c\u7aef\u53e3\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>http:\/\/192.168.1.100<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>GitLab \u9ed8\u8ba4\u7528\u6237\u540d\u4e3a \u201croot\u201d\uff0c\u5bc6\u7801\u4e3a \u201c5iveL!fe\u201d\u3002<\/p>\n<p>\u603b\u7ed3<\/p>\n<p>\u901a\u8fc7\u672c\u6587\uff0c\u6211\u4eec\u5df2\u7ecf\u4e86\u89e3\u5230\u4e86\u5982\u4f55\u5728 CentOS \u4e0a\u4e00\u952e\u5b89\u88c5 GitLab\uff0c\u5982\u679c\u4f60\u662f\u4e00\u540d\u5f00\u53d1\u8005\uff0c\u5efa\u8bae\u4f60\u4f7f\u7528 GitLab \u6765\u7ba1\u7406\u4ee3\u7801\uff0c\u5b83\u80fd\u591f\u5f88\u597d\u5730\u5e2e\u52a9\u4f60\u534f\u4f5c\u5f00\u53d1\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u8be6\u89e3centos\u4e2d\u4e00\u952e\u5b89\u88c5gitlab\u7684\u65b9\u6cd5\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\u3001web \u754c\u9762\u7684 git \u4ee3\u7801\u6258\u7ba1\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5728\u56e2\u961f\u534f\u4f5c\u5f00\u53d1\u4e2d\u66f4\u597d\u5730\u7ba1\u7406\u4ee3\u7801\u3002\u5982\u679c\u4f60\u662f\u4e00\u540d\u5f00\u53d1\u8005\uff0c\u90a3\u4e48\u5f88\u53ef\u80fd\u4f1a\u9047\u5230\u4ee5\u4e0b\u60c5\u51b5\uff1a \u540c\u4e8b\u4fee\u6539\u4e86\u4f60\u7684\u4ee3\u7801\uff0c\u4f46\u6ca1\u6709\u901a\u77e5\u4f60\uff1b \u591a\u4e2a\u4eba\u5171\u540c\u7f16\u5199\u4e86\u540c\u4e00\u4e2a\u4ee3\u7801\u5e93\uff1b \u6ca1\u6709\u5907\u4efd\u4ee3\u7801\uff0c\u9020\u6210\u4ee3\u7801\u4e22\u5931\u3002 \u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 GitLab \u6765\u7ba1\u7406\u4ee3\u7801\uff0c\u4e0b\u9762\u6211\u4eec\u5c31\u6765\u4ecb\u7ecd\u4e00\u4e0b CentOS GitLab \u4e00\u952e\u5b89\u88c5\u65b9\u6cd5\u3002 \u4e00\u3001\u5b89\u88c5\u6700\u65b0\u7248 Git \u5728\u5b89\u88c5 GitLab \u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u5b89\u88c5 Git\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a sudo yum -y update sudo yum -y install git \u767b\u5f55\u540e\u590d\u5236 \u4e8c\u3001\u5b89\u88c5\u4f9d\u8d56\u9879 GitLab \u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9700\u8981\u4e00\u4e9b\u4f9d\u8d56\u9879\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a sudo yum install -y 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 [&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-19303","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19303","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=19303"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19303\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}