{"id":19534,"date":"2024-11-19T08:40:46","date_gmt":"2024-11-19T00:40:46","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19534\/"},"modified":"2024-11-19T08:40:46","modified_gmt":"2024-11-19T00:40:46","slug":"%e5%ae%9d%e5%a1%94%e4%b8%8a%e6%80%8e%e4%b9%88%e5%bc%ba%e5%88%b6%e5%ae%89%e8%a3%85gitlab","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19534\/","title":{"rendered":"\u5b9d\u5854\u4e0a\u600e\u4e48\u5f3a\u5236\u5b89\u88c5gitlab"},"content":{"rendered":"<p>\u5b9d\u5854\u662f\u4e00\u6b3e\u56fd\u5185\u6d41\u884c\u7684\u670d\u52a1\u5668\u7ba1\u7406\u9762\u677f\u5de5\u5177\uff0c\u5177\u6709\u7b80\u5355\u6613\u7528\u3001\u529f\u80fd\u5f3a\u5927\u7b49\u7279\u70b9\u3002gitlab\u662f\u4e00\u6b3e\u65e8\u5728\u5e2e\u52a9\u5f00\u53d1\u8005\u7ba1\u7406\u4ee3\u7801\u3001\u6784\u5efa\u3001\u6d4b\u8bd5\u548c\u90e8\u7f72\u7684\u5f00\u6e90\u9879\u76ee\u7ba1\u7406\u5de5\u5177\u3002\u5b83\u80fd\u591f\u8ba9\u56e2\u961f\u534f\u4f5c\u66f4\u9ad8\u6548\uff0c\u540c\u65f6\u63d0\u4f9b\u8d28\u91cf\u4fdd\u8bc1\u548c\u6027\u80fd\u4f18\u5316\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<p>\u4f46\u662f\uff0c\u5f88\u591a\u5b9d\u5854\u7528\u6237\u53ef\u80fd\u4f1a\u9047\u5230\u5b89\u88c5GitLab\u65f6\u9047\u5230\u7684\u95ee\u9898\uff0c\u4f8b\u5982\u4f9d\u8d56\u5e93\u4e0d\u517c\u5bb9\u3001\u5b89\u88c5\u4e2d\u65ad\u7b49\u7b49\u3002\u8fd9\u65f6\u5c31\u9700\u8981\u91c7\u53d6\u4e00\u4e9b\u5f3a\u5236\u5b89\u88c5\u7684\u65b9\u6cd5\uff0c\u624d\u80fd\u8ba9GitLab\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n<p>\u4e0b\u9762\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728\u5b9d\u5854\u9762\u677f\u4e0a\u5f3a\u5236\u5b89\u88c5GitLab\u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u4e00\u3001\u68c0\u67e5\u5b9d\u5854\u73af\u5883<\/p>\n<p>\u5728\u5f00\u59cb\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u9700\u8981\u68c0\u67e5\u4f60\u7684\u5b9d\u5854\u9762\u677f\u662f\u5426\u5177\u5907\u5b89\u88c5\u6761\u4ef6\uff0c\u5305\u62ec\uff1a<\/p>\n<ol>\n<li>\u7cfb\u7edf\u73af\u5883\uff1aCentOS 7\u6216\u66f4\u9ad8\u7248\u672c<\/li>\n<li>\u8f6f\u4ef6\u73af\u5883\uff1aApache\u6216Nginx\uff0cMySQL\u6216MariaDB<\/li>\n<\/ol>\n<p>\u5207\u6362\u81f3\u57fa\u672c\u914d\u7f6e\u9875\u9762\uff0c\u68c0\u67e5\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c\u548c\u57fa\u672c\u8f6f\u4ef6\u73af\u5883\u662f\u5426\u6ee1\u8db3\u8981\u6c42\u3002<\/p>\n<p>\u4e8c\u3001\u5b89\u88c5\u4f9d\u8d56\u5e93<\/p>\n<p>\u5b89\u88c5GitLab\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u4f9d\u8d56\u5e93\uff0c\u5982libicu-devel\u3001curl-devel\u3001openssl-devel\u7b49\uff0c\u5177\u4f53\u5217\u8868\u5982\u4e0b\uff1a<\/p>\n<p>yum install -y curl policycoreutils openssh-server openssh-clients perl<\/p>\n<p>yum install -y postfix<\/p>\n<p>curl -sS https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.rpm.sh | sudo bash<\/p>\n<p>sudo yum install -y gitlab-ce<\/p>\n<p>\u4e09\u3001\u89e3\u51b3\u4f9d\u8d56\u5e93\u4e0d\u517c\u5bb9\u95ee\u9898<\/p>\n<p>\u6709\u65f6\uff0c\u5728\u5b9d\u5854\u9762\u677f\u4e0a\u5b89\u88c5GitLab\u65f6\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u4f9d\u8d56\u5e93\u4e0d\u517c\u5bb9\u7684\u95ee\u9898\uff0c\u5982libicu56\u4e0elibicu57\u4e0d\u517c\u5bb9\u3002\u8fd9\u65f6\uff0c\u9700\u8981\u91c7\u53d6\u5982\u4e0b\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<ol>\n<li>\u4e0b\u8f7dlibicu56.rpm<\/li>\n<\/ol>\n<p>wget https:\/\/archive.fedoraproject.org\/pub\/fedora\/linux\/releases\/25\/Everything\/x86_64\/os\/Packages\/l\/libicu-56.1-8.fc25.x86_64.rpm<\/p>\n<ol>\n<li>\u5b89\u88c5libicu56.rpm<\/li>\n<\/ol>\n<p>rpm -ivh libicu-56.1-8.fc25.x86_64.rpm<\/p>\n<p>\u56db\u3001\u4fee\u6539\u9ed8\u8ba4\u7aef\u53e3\u53f7<\/p>\n<p>GitLab\u9ed8\u8ba4\u7aef\u53e3\u53f7\u662f80\uff0c\u9700\u8981\u4fee\u6539\u4e3a\u5176\u4ed6\u7aef\u53e3\u53f7\uff0c\u5426\u5219\u5b9d\u5854\u9762\u677f\u548cGitLab\u4f1a\u53d1\u751f\u7aef\u53e3\u51b2\u7a81\u3002\u53ef\u4ee5\u91c7\u53d6\u5982\u4e0b\u6b65\u9aa4\u4fee\u6539\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff1a<\/p>\n<ol>\n<li>\u4fee\u6539GitLab\u914d\u7f6e\u6587\u4ef6<\/li>\n<\/ol>\n<p>vi \/etc\/gitlab\/gitlab.rb<\/p>\n<ol>\n<li>\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/li>\n<\/ol>\n<p>external_url &#8216;http:\/\/gitlab.example.com:8888&#8217;<br \/>gitlab_rails[&#8216;gitlab_shell_ssh_port&#8217;] = 2224<\/p>\n<ol>\n<li>\u91cd\u542fGitLab<\/li>\n<\/ol>\n<p>gitlab-ctl reconfigure<\/p>\n<p>\u56db\u3001\u542f\u52a8GitLab<\/p>\n<p>\u5728\u5b8c\u6210\u4e0a\u8ff0\u6b65\u9aa4\u540e\uff0c\u53ef\u4ee5\u542f\u52a8GitLab\u5e76\u8bbf\u95ee\u5b83\u3002<\/p>\n<ol>\n<li>\u542f\u52a8GitLab<\/li>\n<\/ol>\n<p>gitlab-ctl start<\/p>\n<ol>\n<li>\u8bbf\u95eeGitLab<\/li>\n<\/ol>\n<p>\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165http:\/\/\u670d\u52a1\u5668IP:\u7aef\u53e3\u53f7\uff0c\u5373\u53ef\u8bbf\u95eeGitLab\u3002<\/p>\n<p>\u603b\u7ed3<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5728\u5b9d\u5854\u9762\u677f\u4e0a\u5f3a\u5236\u5b89\u88c5GitLab\u7684\u65b9\u6cd5\uff0c\u867d\u7136\u5b89\u88c5\u8fc7\u7a0b\u4f1a\u9047\u5230\u4e00\u4e9b\u95ee\u9898\uff0c\u4f46\u901a\u8fc7\u5bf9\u95ee\u9898\u7684\u7ec6\u5fc3\u5206\u6790\u548c\u89e3\u51b3\uff0c\u6700\u7ec8\u90fd\u53ef\u4ee5\u6210\u529f\u5b89\u88c5\u3002\u540c\u65f6\uff0c\u4e5f\u5efa\u8bae\u5927\u5bb6\u5728\u4f7f\u7528GitLab\u65f6\uff0c\u4e86\u89e3\u66f4\u591a\u7684GitLab\u914d\u7f6e\u3001\u4f18\u5316\u548c\u7ba1\u7406\u6280\u5de7\uff0c\u4e3a\u56e2\u961f\u534f\u4f5c\u5f00\u53d1\u63d0\u4f9b\u66f4\u52a0\u9ad8\u6548\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5b9d\u5854\u4e0a\u600e\u4e48\u5f3a\u5236\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>\u5b9d\u5854\u662f\u4e00\u6b3e\u56fd\u5185\u6d41\u884c\u7684\u670d\u52a1\u5668\u7ba1\u7406\u9762\u677f\u5de5\u5177\uff0c\u5177\u6709\u7b80\u5355\u6613\u7528\u3001\u529f\u80fd\u5f3a\u5927\u7b49\u7279\u70b9\u3002gitlab\u662f\u4e00\u6b3e\u65e8\u5728\u5e2e\u52a9\u5f00\u53d1\u8005\u7ba1\u7406\u4ee3\u7801\u3001\u6784\u5efa\u3001\u6d4b\u8bd5\u548c\u90e8\u7f72\u7684\u5f00\u6e90\u9879\u76ee\u7ba1\u7406\u5de5\u5177\u3002\u5b83\u80fd\u591f\u8ba9\u56e2\u961f\u534f\u4f5c\u66f4\u9ad8\u6548\uff0c\u540c\u65f6\u63d0\u4f9b\u8d28\u91cf\u4fdd\u8bc1\u548c\u6027\u80fd\u4f18\u5316\u7684\u89e3\u51b3\u65b9\u6848\u3002 \u4f46\u662f\uff0c\u5f88\u591a\u5b9d\u5854\u7528\u6237\u53ef\u80fd\u4f1a\u9047\u5230\u5b89\u88c5GitLab\u65f6\u9047\u5230\u7684\u95ee\u9898\uff0c\u4f8b\u5982\u4f9d\u8d56\u5e93\u4e0d\u517c\u5bb9\u3001\u5b89\u88c5\u4e2d\u65ad\u7b49\u7b49\u3002\u8fd9\u65f6\u5c31\u9700\u8981\u91c7\u53d6\u4e00\u4e9b\u5f3a\u5236\u5b89\u88c5\u7684\u65b9\u6cd5\uff0c\u624d\u80fd\u8ba9GitLab\u6b63\u5e38\u8fd0\u884c\u3002 \u4e0b\u9762\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728\u5b9d\u5854\u9762\u677f\u4e0a\u5f3a\u5236\u5b89\u88c5GitLab\u7684\u65b9\u6cd5\u3002 \u4e00\u3001\u68c0\u67e5\u5b9d\u5854\u73af\u5883 \u5728\u5f00\u59cb\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u9700\u8981\u68c0\u67e5\u4f60\u7684\u5b9d\u5854\u9762\u677f\u662f\u5426\u5177\u5907\u5b89\u88c5\u6761\u4ef6\uff0c\u5305\u62ec\uff1a \u7cfb\u7edf\u73af\u5883\uff1aCentOS 7\u6216\u66f4\u9ad8\u7248\u672c \u8f6f\u4ef6\u73af\u5883\uff1aApache\u6216Nginx\uff0cMySQL\u6216MariaDB \u5207\u6362\u81f3\u57fa\u672c\u914d\u7f6e\u9875\u9762\uff0c\u68c0\u67e5\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c\u548c\u57fa\u672c\u8f6f\u4ef6\u73af\u5883\u662f\u5426\u6ee1\u8db3\u8981\u6c42\u3002 \u4e8c\u3001\u5b89\u88c5\u4f9d\u8d56\u5e93 \u5b89\u88c5GitLab\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u4f9d\u8d56\u5e93\uff0c\u5982libicu-devel\u3001curl-devel\u3001openssl-devel\u7b49\uff0c\u5177\u4f53\u5217\u8868\u5982\u4e0b\uff1a yum install -y curl policycoreutils openssh-server openssh-clients perl yum install -y postfix curl -sS https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.rpm.sh | sudo bash sudo yum install -y gitlab-ce \u4e09\u3001\u89e3\u51b3\u4f9d\u8d56\u5e93\u4e0d\u517c\u5bb9\u95ee\u9898 \u6709\u65f6\uff0c\u5728\u5b9d\u5854\u9762\u677f\u4e0a\u5b89\u88c5GitLab\u65f6\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u4f9d\u8d56\u5e93\u4e0d\u517c\u5bb9\u7684\u95ee\u9898\uff0c\u5982libicu56\u4e0elibicu57\u4e0d\u517c\u5bb9\u3002\u8fd9\u65f6\uff0c\u9700\u8981\u91c7\u53d6\u5982\u4e0b\u89e3\u51b3\u65b9\u6cd5\uff1a \u4e0b\u8f7dlibicu56.rpm wget https:\/\/archive.fedoraproject.org\/pub\/fedora\/linux\/releases\/25\/Everything\/x86_64\/os\/Packages\/l\/libicu-56.1-8.fc25.x86_64.rpm \u5b89\u88c5libicu56.rpm rpm -ivh libicu-56.1-8.fc25.x86_64.rpm \u56db\u3001\u4fee\u6539\u9ed8\u8ba4\u7aef\u53e3\u53f7 GitLab\u9ed8\u8ba4\u7aef\u53e3\u53f7\u662f80\uff0c\u9700\u8981\u4fee\u6539\u4e3a\u5176\u4ed6\u7aef\u53e3\u53f7\uff0c\u5426\u5219\u5b9d\u5854\u9762\u677f\u548cGitLab\u4f1a\u53d1\u751f\u7aef\u53e3\u51b2\u7a81\u3002\u53ef\u4ee5\u91c7\u53d6\u5982\u4e0b\u6b65\u9aa4\u4fee\u6539\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff1a \u4fee\u6539GitLab\u914d\u7f6e\u6587\u4ef6 vi \/etc\/gitlab\/gitlab.rb \u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a external_url &#8216;http:\/\/gitlab.example.com:8888&#8217;gitlab_rails[&#8216;gitlab_shell_ssh_port&#8217;] = 2224 \u91cd\u542fGitLab gitlab-ctl [&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-19534","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19534","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=19534"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19534\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}