{"id":18831,"date":"2024-11-19T08:49:09","date_gmt":"2024-11-19T00:49:09","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18831\/"},"modified":"2024-11-19T08:49:09","modified_gmt":"2024-11-19T00:49:09","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8centos%e7%b3%bb%e7%bb%9f%e4%b8%8a%e9%80%9a%e8%bf%87yum%e5%ae%89%e8%a3%85gitlab","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18831\/","title":{"rendered":"\u5982\u4f55\u5728CentOS\u7cfb\u7edf\u4e0a\u901a\u8fc7yum\u5b89\u88c5GitLab"},"content":{"rendered":"<p>gitlab\u662f\u4e00\u4e2a\u5f00\u6e90\u7684web git\u4ed3\u5e93\u7ba1\u7406\u5de5\u5177\uff0c\u5b83\u4e0d\u4ec5\u63d0\u4f9b\u4e86\u57fa\u4e8egit\u7684\u7248\u672c\u63a7\u5236\uff0c\u8fd8\u5305\u542b\u4e86\u4ee3\u7801\u8bc4\u5ba1\u3001\u6301\u7eed\u96c6\u6210\u4e0e\u90e8\u7f72\u3001wiki\u3001\u95ee\u9898\u8ddf\u8e2a\u7b49\u4f17\u591a\u529f\u80fd\u3002<\/p>\n<p>\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728CentOS\u7cfb\u7edf\u4e0a\u901a\u8fc7yum\u5b89\u88c5GitLab\uff0c\u5e76\u7b80\u5355\u914d\u7f6e\u3002<\/p>\n<p>\u4e00\u3001\u5b89\u88c5\u4f9d\u8d56<\/p>\n<p>\u5728\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u9700\u8981\u5b89\u88c5\u4ee5\u4e0b\u4f9d\u8d56\u5305\uff1a<\/p>\n<p>sudo yum install -y curl policycoreutils openssh-server openssh-clients<\/p>\n<p>sudo systemctl enable sshd<\/p>\n<p>sudo systemctl start sshd<\/p>\n<p>sudo firewall-cmd &#8211;permanent &#8211;add-service=http<\/p>\n<p>sudo systemctl reload firewalld<\/p>\n<p>\u4e8c\u3001\u5b89\u88c5GitLab<\/p>\n<p>1.\u4e0b\u8f7dGitLab\u6e90<\/p>\n<p>sudo curl https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.rpm.sh | sudo bash<\/p>\n<p>2.\u5b89\u88c5GitLab<\/p>\n<p>sudo yum install -y gitlab-ce<\/p>\n<p>\u4e09\u3001\u914d\u7f6eGitLab<\/p>\n<p>1.\u4fee\u6539GitLab\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>sudo vi \/etc\/gitlab\/gitlab.rb<\/p>\n<p>2.\u4fee\u6539GitLab\u57df\u540d<\/p>\n<p>external_url &#8216;http:\/\/\u4f60\u7684\u57df\u540d\u6216IP&#8217;<\/p>\n<p>3.\u4fdd\u5b58\u4fee\u6539<\/p>\n<p>:wq<\/p>\n<p>4.\u91cd\u65b0\u914d\u7f6eGitLab<\/p>\n<p>sudo gitlab-ctl reconfigure<\/p>\n<p>5.\u8bbf\u95eeGitLab<\/p>\n<p>\u5728\u6d4f\u89c8\u5668\u5730\u5740\u680f\u4e2d\u8f93\u5165GitLab\u7684\u57df\u540d\u6216IP\u5730\u5740\uff0c\u5373\u53ef\u8fdb\u5165GitLab\u9875\u9762\u3002<\/p>\n<p>\u56db\u3001\u4f7f\u7528GitLab<\/p>\n<p>1.\u521b\u5efa\u7528\u6237<\/p>\n<p>\u5728GitLab\u9875\u9762\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201cSign In \/ Register\u201d\u6309\u94ae\uff0c\u8fdb\u5165\u6ce8\u518c\u9875\u9762\uff0c\u8f93\u5165\u7528\u6237\u540d\u3001\u5bc6\u7801\u548c\u90ae\u7bb1\uff0c\u70b9\u51fb\u201cRegister\u201d\u6309\u94ae\u5373\u53ef\u5b8c\u6210\u7528\u6237\u6ce8\u518c\u3002<\/p>\n<p>2.\u521b\u5efa\u4ed3\u5e93<\/p>\n<p>\u767b\u5f55GitLab\u540e\uff0c\u5728\u9875\u9762\u4e0a\u65b9\u5bfc\u822a\u680f\u4e2d\uff0c\u70b9\u51fb\u201cNew Project\u201d\u6309\u94ae\uff0c\u586b\u5199\u4ed3\u5e93\u540d\u79f0\u548c\u63cf\u8ff0\uff0c\u9009\u62e9\u53ef\u89c1\u6027\uff0c\u70b9\u51fb\u201cCreate Project\u201d\u6309\u94ae\u5373\u53ef\u521b\u5efa\u4ed3\u5e93\u3002<\/p>\n<p>3.\u514b\u9686\u4ed3\u5e93<\/p>\n<p>\u5728GitLab\u4ed3\u5e93\u9875\u9762\u4e2d\uff0c\u70b9\u51fb\u4ed3\u5e93\u53f3\u4e0a\u89d2\u7684\u201cClone\u201d\u6309\u94ae\uff0c\u590d\u5236\u4ed3\u5e93\u7684SSH\u6216HTTPS\u5730\u5740\uff0c\u4f7f\u7528git clone\u547d\u4ee4\u5c06\u4ed3\u5e93\u514b\u9686\u5230\u672c\u5730\u3002<\/p>\n<p>\u7efc\u4e0a\u6240\u8ff0\uff0c\u901a\u8fc7yum\u5b89\u88c5GitLab\u662f\u4e00\u4ef6\u76f8\u5bf9\u7b80\u5355\u7684\u4e8b\u60c5\u3002\u5982\u679c\u60a8\u60f3\u6df1\u5165\u4e86\u89e3GitLab\u7684\u66f4\u591a\u529f\u80fd\uff0c\u53ef\u4ee5\u5728\u5b98\u7f51\u67e5\u770b\u66f4\u591a\u6587\u6863\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5728CentOS\u7cfb\u7edf\u4e0a\u901a\u8fc7yum\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\u5f00\u6e90\u7684web git\u4ed3\u5e93\u7ba1\u7406\u5de5\u5177\uff0c\u5b83\u4e0d\u4ec5\u63d0\u4f9b\u4e86\u57fa\u4e8egit\u7684\u7248\u672c\u63a7\u5236\uff0c\u8fd8\u5305\u542b\u4e86\u4ee3\u7801\u8bc4\u5ba1\u3001\u6301\u7eed\u96c6\u6210\u4e0e\u90e8\u7f72\u3001wiki\u3001\u95ee\u9898\u8ddf\u8e2a\u7b49\u4f17\u591a\u529f\u80fd\u3002 \u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728CentOS\u7cfb\u7edf\u4e0a\u901a\u8fc7yum\u5b89\u88c5GitLab\uff0c\u5e76\u7b80\u5355\u914d\u7f6e\u3002 \u4e00\u3001\u5b89\u88c5\u4f9d\u8d56 \u5728\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u9700\u8981\u5b89\u88c5\u4ee5\u4e0b\u4f9d\u8d56\u5305\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 \u4e8c\u3001\u5b89\u88c5GitLab 1.\u4e0b\u8f7dGitLab\u6e90 sudo curl https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.rpm.sh | sudo bash 2.\u5b89\u88c5GitLab sudo yum install -y gitlab-ce \u4e09\u3001\u914d\u7f6eGitLab 1.\u4fee\u6539GitLab\u914d\u7f6e\u6587\u4ef6 sudo vi \/etc\/gitlab\/gitlab.rb 2.\u4fee\u6539GitLab\u57df\u540d external_url &#8216;http:\/\/\u4f60\u7684\u57df\u540d\u6216IP&#8217; 3.\u4fdd\u5b58\u4fee\u6539 :wq 4.\u91cd\u65b0\u914d\u7f6eGitLab 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-18831","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18831","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=18831"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18831\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}