{"id":18751,"date":"2024-11-19T09:06:24","date_gmt":"2024-11-19T01:06:24","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18751\/"},"modified":"2024-11-19T09:06:24","modified_gmt":"2024-11-19T01:06:24","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8centos-7%e4%b8%8a%e5%ae%89%e8%a3%85gitlab","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18751\/","title":{"rendered":"\u5982\u4f55\u5728CentOS 7\u4e0a\u5b89\u88c5GitLab"},"content":{"rendered":"<p>gitlab \u662f\u4e00\u4e2a\u57fa\u4e8e git \u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf\u7684\u5f00\u6e90\u4ee3\u7801\u4ed3\u5e93\u7ba1\u7406\u5de5\u5177\uff0c\u5b83\u7684\u8bbe\u8ba1\u7075\u611f\u6765\u81ea\u4e8e github\uff0c\u4f46\u5b83\u7684\u5b89\u88c5\u90e8\u7f72\u5219\u66f4\u52a0\u7b80\u5355\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u5411\u60a8\u4ecb\u7ecd\u5982\u4f55\u5728 centos 7 \u4e0a\u5b89\u88c5 gitlab\u3002<\/p>\n<ol>\n<li>\u5b89\u88c5\u5fc5\u9700\u7684\u4f9d\u8d56<\/li>\n<\/ol>\n<p>GitLab \u5728\u5b89\u88c5\u65f6\u9700\u8981\u4e00\u4e9b\u5148\u51b3\u6761\u4ef6\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\u8fd9\u4e9b\u5fc5\u8981\u8f6f\u4ef6\u5305\uff1a<\/p>\n<pre>sudo yum update\nsudo 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<ol>\n<li>\u5b89\u88c5 Postfix<\/li>\n<\/ol>\n<p>GitLab \u9700\u8981\u90ae\u4ef6\u670d\u52a1\u5668\u6765\u53d1\u9001\u901a\u77e5\u90ae\u4ef6\uff0c\u56e0\u6b64\u60a8\u9700\u8981\u5b89\u88c5 Postfix \u5e76\u5c06\u5176\u8bbe\u7f6e\u4e3a\u5f00\u673a\u81ea\u542f\u52a8\u3002\u5728 CentOS \u4e0a\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5 Postfix \uff1a<\/p>\n<pre>sudo yum install postfix\nsudo systemctl enable postfix\nsudo systemctl start postfix<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u5b89\u88c5 GitLab<\/li>\n<\/ol>\n<p>\u5728\u5b89\u88c5 GitLab \u4e4b\u524d\uff0c\u60a8\u9700\u8981\u6dfb\u52a0 GitLab \u7684 RPM \u4ed3\u5e93\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u5c06\u6dfb\u52a0 GitLab \u793e\u533a\u7248\u7684 RPM \u4ed3\u5e93\u3002<\/p>\n<p>\u9996\u5148\uff0c\u5bfc\u5165 GitLab \u7684 GPG \u5bc6\u94a5\uff1a<\/p>\n<pre>curl https:\/\/packages.gitlab.com\/gpg.key | sudo apt-key add -<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u7136\u540e\uff0c\u6dfb\u52a0 GitLab \u7684 RPM \u4ed3\u5e93\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>\u73b0\u5728\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5728\u60a8\u7684\u7cfb\u7edf\u4e0a\u5b89\u88c5 GitLab\uff1a<\/p>\n<pre>sudo yum install -y gitlab-ce<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u4e2a\u8fc7\u7a0b\u9700\u8981\u4e00\u6bb5\u65f6\u95f4\u6765\u5b89\u88c5\u548c\u914d\u7f6e GitLab\u3002\u5728\u8be5\u8fc7\u7a0b\u4e2d\uff0c\u60a8\u9700\u8981\u63d0\u4f9b\u4e00\u4e9b\u5fc5\u8981\u7684\u914d\u7f6e\u4fe1\u606f\uff0c\u4f8b\u5982\u60a8\u7684\u7ad9\u70b9\u540d\u79f0\u548c\u7ba1\u7406\u5458\u8d26\u6237\u4fe1\u606f\u3002<\/p>\n<ol>\n<li>\u8bbf\u95ee GitLab<\/li>\n<\/ol>\n<p>GitLab \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u8bbf\u95ee\u9ed8\u8ba4\u7684 GitLab URL\uff08\u53ef\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u67e5\u8be2\uff09\uff1a<\/p>\n<pre>sudo gitlab-ctl status<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8f93\u51fa\u5e94\u8be5\u7c7b\u4f3c\u4e8e\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre>run: gitlab-workhorse: ... pid ...; ...\nrun: logrotate: ... pid ...; ...\nrun: nginx: ... pid ...; ...\nrun: postgresql: ... pid ...; ...\nrun: redis: ... pid ...; ...\nrun: sidekiq: ... pid ...; ...\nrun: unicorn: ... pid ...; ...<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cGitLab \u4f7f\u7528 HTTP \u534f\u8bae\u901a\u8fc7\u7aef\u53e3 80 \u63d0\u4f9b\u670d\u52a1\u3002 \u5982\u679c\u60a8\u5df2\u7ecf\u5728 CentOS \u9632\u706b\u5899\u4e2d\u5141\u8bb8\u4e86 HTTP\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u670d\u52a1\u5668\u7684 IP \u5730\u5740\u6216\u57df\u540d\u6765\u8bbf\u95ee GitLab\u3002<\/p>\n<p>\u5728\u60a8\u8bbf\u95ee GitLab \u7684 URL \u65f6\uff0c\u60a8\u5c06\u88ab\u5f15\u5bfc\u5230 GitLab \u7684\u767b\u5f55\u754c\u9762\u3002\u8f93\u5165\u60a8\u5728\u5b89\u88c5 GitLab \u65f6\u521b\u5efa\u7684\u7ba1\u7406\u5458\u8d26\u6237\u3002 \u8fd9\u6837\uff0c\u60a8\u5c31\u5b8c\u6210\u4e86\u5bf9 GitLab \u7684\u5b89\u88c5\u548c\u90e8\u7f72\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5728CentOS 7\u4e0a\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\u4e8e git \u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf\u7684\u5f00\u6e90\u4ee3\u7801\u4ed3\u5e93\u7ba1\u7406\u5de5\u5177\uff0c\u5b83\u7684\u8bbe\u8ba1\u7075\u611f\u6765\u81ea\u4e8e github\uff0c\u4f46\u5b83\u7684\u5b89\u88c5\u90e8\u7f72\u5219\u66f4\u52a0\u7b80\u5355\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u5411\u60a8\u4ecb\u7ecd\u5982\u4f55\u5728 centos 7 \u4e0a\u5b89\u88c5 gitlab\u3002 \u5b89\u88c5\u5fc5\u9700\u7684\u4f9d\u8d56 GitLab \u5728\u5b89\u88c5\u65f6\u9700\u8981\u4e00\u4e9b\u5148\u51b3\u6761\u4ef6\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\u8fd9\u4e9b\u5fc5\u8981\u8f6f\u4ef6\u5305\uff1a sudo yum update 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 \u5b89\u88c5 Postfix GitLab \u9700\u8981\u90ae\u4ef6\u670d\u52a1\u5668\u6765\u53d1\u9001\u901a\u77e5\u90ae\u4ef6\uff0c\u56e0\u6b64\u60a8\u9700\u8981\u5b89\u88c5 Postfix \u5e76\u5c06\u5176\u8bbe\u7f6e\u4e3a\u5f00\u673a\u81ea\u542f\u52a8\u3002\u5728 CentOS \u4e0a\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5 Postfix \uff1a sudo yum install postfix sudo [&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-18751","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18751","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=18751"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18751\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18751"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18751"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18751"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}