{"id":19044,"date":"2024-11-19T11:48:56","date_gmt":"2024-11-19T03:48:56","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19044\/"},"modified":"2024-11-19T11:48:56","modified_gmt":"2024-11-19T03:48:56","slug":"%e8%81%8a%e8%81%8acentos7%e4%b8%8agitlab%e7%9a%84%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19044\/","title":{"rendered":"\u804a\u804acentos7\u4e0agitlab\u7684\u5b89\u88c5\u65b9\u6cd5"},"content":{"rendered":"<p>gitlab\u662f\u4e00\u79cd\u7ba1\u7406 git \u5b58\u50a8\u5e93\u7684\u7f51\u7ad9\u7a0b\u5e8f\uff0c\u5b83\u53ef\u4ee5\u7528\u4e8e\u540c\u6b65\u4ee3\u7801\uff0c\u534f\u8c03\u56e2\u961f\u6210\u5458\u4e4b\u95f4\u7684\u5de5\u4f5c\uff0c\u8ddf\u8e2a\u95ee\u9898\u7b49\u7b49\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728centos 7\u4e0a\u5b89\u88c5gitlab\u3002<\/p>\n<p>\u7b2c\u4e00\u6b65\uff1a\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u9879\u548c\u4f7f\u7528\u6e90\u3002<\/p>\n<p>\u5728\u7ee7\u7eed\u5b89\u88c5\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u5fc5\u8981\u7684\u4f9d\u8d56\u9879\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u6240\u9700\u7684\u4f9d\u8d56\u9879\uff1a<\/p>\n<pre>sudo yum install curl policycoreutils-python openssh-server<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u4f7f\u7528\u5b98\u65b9\u6e90\u914d\u7f6eGitLab\u6e90\uff1a<\/p>\n<pre>curl 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>\u7b2c\u4e8c\u6b65\uff1a\u5b89\u88c5GitLab<\/p>\n<p>\u73b0\u5728\uff0c\u60a8\u5df2\u7ecf\u51c6\u5907\u597d\u5b89\u88c5\u4e86\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5GitLab\uff1a<\/p>\n<pre>sudo yum install gitlab-ce<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5b89\u88c5\u5c06\u5f00\u59cb\uff0c\u5e76\u5728\u51e0\u5206\u949f\u5185\u5b8c\u6210\u3002<\/p>\n<p>\u7b2c\u4e09\u6b65\uff1a\u914d\u7f6eGitLab<\/p>\n<p>\u73b0\u5728\uff0c\u60a8\u9700\u8981\u914d\u7f6eGitLab\uff0c\u5e76\u4e3a\u5176\u521b\u5efa\u7ba1\u7406\u5458\u5e10\u6237\u3002\u6253\u5f00\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<pre>sudo nano \/etc\/gitlab\/gitlab.rb<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u627e\u5230\u4ee5\u4e0b\u4ee3\u7801\u884c\uff0c\u5e76\u5c06\u5176\u53d6\u6d88\u6ce8\u91ca\uff1a<\/p>\n<pre>## Uncomment and customize if you can't use the default because of a conflict\n# gitlab_workhorse['listen_network'] = \"tcp\"\n# gitlab_workhorse['listen_addr'] = \"localhost:8181\"<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5728\u201c\u652f\u6301Redis\u201d\u90e8\u5206\u542f\u7528Redis\uff1a<\/p>\n<pre>redis['enable'] = true\nredis['host'] = \"127.0.0.1\"\nredis['port'] = 6379\nredis['password'] = nil\nredis['database'] = 0<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u73b0\u5728\uff0c\u91cd\u65b0\u914d\u7f6eGitLab\uff1a<\/p>\n<pre>sudo gitlab-ctl reconfigure<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u521b\u5efa\u7ba1\u7406\u5458\u5e10\u6237\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>sudo gitlab-rake gitlab:setup<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6309\u7167\u63d0\u793a\u8f93\u5165\u7ba1\u7406\u5458\u5e10\u6237\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u5b8c\u6210\u540e\uff0c\u60a8\u5e94\u8be5\u73b0\u5728\u53ef\u4ee5\u8bbf\u95eeGitLab\u4e86\u3002<\/p>\n<p>\u7b2c\u56db\u6b65\uff1a\u8bbf\u95eeGitLab<\/p>\n<p>\u5982\u679c\u60a8\u7684\u7cfb\u7edf\u4e0a\u6709\u9632\u706b\u5899\uff0c\u8bf7\u5c06\u7aef\u53e3\u53f780\u6253\u5f00\u3002 \u8f93\u5165\u670d\u52a1\u5668\u7684IP\u5730\u5740\u6216\u57df\u540d\uff0c\u7136\u540e\u5728Web\u6d4f\u89c8\u5668\u4e2d\u542f\u52a8GitLab\uff1a<\/p>\n<pre>http:\/\/your_server_IP_or_domain<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5728\u6253\u5f00\u7684\u9875\u9762\u4e0a\uff0c\u8f93\u5165\u60a8\u521a\u521a\u5b89\u88c5\u7684\u7ba1\u7406\u5458\u5e10\u6237\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u7136\u540e\u5355\u51fb\u201c\u767b\u5f55\u201d\u3002\u73b0\u5728\uff0c\u60a8\u53ef\u4ee5\u5f00\u59cb\u5728GitLab\u4e0a\u7ba1\u7406\u60a8\u7684Git\u5b58\u50a8\u5e93\u4e86\u3002<\/p>\n<p>\u603b\u7ed3<\/p>\n<p>\u73b0\u5728\uff0c\u60a8\u5df2\u7ecf\u6210\u529f\u5728CentOS 7\u4e0a\u5b89\u88c5\u5e76\u914d\u7f6e\u4e86GitLab\u3002\u60a8\u5728GitLab\u4e0a\u53ef\u4ee5\u521b\u5efa\u65b0\u7684\u5b58\u50a8\u5e93\uff0c\u540c\u6b65\u4ee3\u7801\uff0c\u534f\u8c03\u56e2\u961f\u6210\u5458\u4e4b\u95f4\u7684\u5de5\u4f5c\uff0c\u8ddf\u8e2a\u95ee\u9898\u7b49\u7b49\u3002\u611f\u8c22\u60a8\u9605\u8bfb\u672c\u6587\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u804a\u804acentos7\u4e0agitlab\u7684\u5b89\u88c5\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\u79cd\u7ba1\u7406 git \u5b58\u50a8\u5e93\u7684\u7f51\u7ad9\u7a0b\u5e8f\uff0c\u5b83\u53ef\u4ee5\u7528\u4e8e\u540c\u6b65\u4ee3\u7801\uff0c\u534f\u8c03\u56e2\u961f\u6210\u5458\u4e4b\u95f4\u7684\u5de5\u4f5c\uff0c\u8ddf\u8e2a\u95ee\u9898\u7b49\u7b49\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728centos 7\u4e0a\u5b89\u88c5gitlab\u3002 \u7b2c\u4e00\u6b65\uff1a\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u9879\u548c\u4f7f\u7528\u6e90\u3002 \u5728\u7ee7\u7eed\u5b89\u88c5\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u5fc5\u8981\u7684\u4f9d\u8d56\u9879\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u6240\u9700\u7684\u4f9d\u8d56\u9879\uff1a sudo yum install curl policycoreutils-python openssh-server \u767b\u5f55\u540e\u590d\u5236 \u63a5\u4e0b\u6765\uff0c\u4f7f\u7528\u5b98\u65b9\u6e90\u914d\u7f6eGitLab\u6e90\uff1a curl https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.rpm.sh | sudo bash \u767b\u5f55\u540e\u590d\u5236 \u7b2c\u4e8c\u6b65\uff1a\u5b89\u88c5GitLab \u73b0\u5728\uff0c\u60a8\u5df2\u7ecf\u51c6\u5907\u597d\u5b89\u88c5\u4e86\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5GitLab\uff1a sudo yum install gitlab-ce \u767b\u5f55\u540e\u590d\u5236 \u5b89\u88c5\u5c06\u5f00\u59cb\uff0c\u5e76\u5728\u51e0\u5206\u949f\u5185\u5b8c\u6210\u3002 \u7b2c\u4e09\u6b65\uff1a\u914d\u7f6eGitLab \u73b0\u5728\uff0c\u60a8\u9700\u8981\u914d\u7f6eGitLab\uff0c\u5e76\u4e3a\u5176\u521b\u5efa\u7ba1\u7406\u5458\u5e10\u6237\u3002\u6253\u5f00\u914d\u7f6e\u6587\u4ef6\uff1a sudo nano \/etc\/gitlab\/gitlab.rb \u767b\u5f55\u540e\u590d\u5236 \u627e\u5230\u4ee5\u4e0b\u4ee3\u7801\u884c\uff0c\u5e76\u5c06\u5176\u53d6\u6d88\u6ce8\u91ca\uff1a ## Uncomment and customize if you can&#8217;t use the default because of a conflict # gitlab_workhorse[&#8216;listen_network&#8217;] = &#8220;tcp&#8221; # gitlab_workhorse[&#8216;listen_addr&#8217;] [&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-19044","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19044","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=19044"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19044\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}