{"id":19295,"date":"2024-11-19T13:15:51","date_gmt":"2024-11-19T05:15:51","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19295\/"},"modified":"2024-11-19T13:15:51","modified_gmt":"2024-11-19T05:15:51","slug":"centos%e4%b8%8a%e6%80%8e%e4%b9%88%e5%ae%89%e8%a3%85%e9%85%8d%e7%bd%aegitlab%ef%bc%88%e6%96%b9%e6%b3%95%e8%af%a6%e8%a7%a3%ef%bc%89","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19295\/","title":{"rendered":"centos\u4e0a\u600e\u4e48\u5b89\u88c5\u914d\u7f6egitlab\uff08\u65b9\u6cd5\u8be6\u89e3\uff09"},"content":{"rendered":"<p>\u5728\u8fdb\u884c\u8f6f\u4ef6\u5f00\u53d1\u65f6\uff0c\u7248\u672c\u63a7\u5236\u662f\u4e00\u9879\u5fc5\u4e0d\u53ef\u5c11\u7684\u4efb\u52a1\uff0c\u6709\u52a9\u4e8e\u56e2\u961f\u534f\u4f5c\u548c\u4ee3\u7801\u7ba1\u7406\u3002gitlab\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5f00\u6e90\u8f6f\u4ef6\uff0c\u7531\u4e8e\u5176\u4eba\u6027\u5316\u7684\u754c\u9762\u548c\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u5e7f\u53d7\u6b22\u8fce\u3002\u672c\u6587\u5c06\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u5982\u4f55\u5728centos\u4e0a\u5b89\u88c5gitlab\u5e76\u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n<p>\u4e00\u3001\u5b89\u88c5GitLab\u6240\u9700\u7684\u73af\u5883<br \/>\u5728\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u5fc5\u8981\u7684\u8f6f\u4ef6\u5305\uff1a<\/p>\n<ol>\n<li>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u66f4\u65b0yum\u8f6f\u4ef6\u4ed3\u5e93\uff1a<\/li>\n<\/ol>\n<pre>sudo yum -y update<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236    \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u5b89\u88c5Postfix\u90ae\u4ef6\u670d\u52a1\u5668\uff1a<\/li>\n<\/ol>\n<pre>sudo yum -y install postfix\nsudo systemctl enable postfix\nsudo systemctl start postfix<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u5b89\u88c5OpenSSL\uff1a<\/li>\n<\/ol>\n<pre>sudo yum -y install openssl-devel<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u5b89\u88c5wget\uff1a<\/li>\n<\/ol>\n<pre>sudo yum -y install wget<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4e8c\u3001\u5b89\u88c5\u5e76\u8bbe\u7f6eGitLab<\/p>\n<ol>\n<li>\u9996\u5148\uff0c\u66f4\u65b0\u670d\u52a1\u5668\u4ee5\u83b7\u53d6\u6700\u65b0\u7248\u672c\u7684\u6240\u6709\u8f6f\u4ef6\u5305\uff1a<\/li>\n<\/ol>\n<pre>sudo yum -y update<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236    \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u6dfb\u52a0GitLab\u8f6f\u4ef6\u4ed3\u5e93\uff1a<\/li>\n<\/ol>\n<pre>sudo wget https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ee\/script.rpm.sh\nsudo chmod +x script.rpm.sh\nsudo .\/script.rpm.sh<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u5b89\u88c5GitLab\uff1a<\/li>\n<\/ol>\n<pre>sudo EXTERNAL_URL=\"https:\/\/gitlab.example.com\" yum install -y gitlab-ee<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\uff08\u6ce8\u610f\uff1a\u5c06\u201chttps:\/\/gitlab.example.com\u201d\u66f4\u6539\u4e3a\u60a8\u81ea\u5df1\u7684\u57df\u540d\uff09<\/p>\n<ol>\n<li>\u5728\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8GitLab\u670d\u52a1\uff1a<\/li>\n<\/ol>\n<pre>sudo systemctl start gitlab-runsvdir.service<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u8bbe\u7f6eGitLab\u7ba1\u7406\u5458\u5bc6\u7801\uff1a<\/li>\n<\/ol>\n<pre>sudo gitlab-ctl reconfigure\nsudo gitlab-rake gitlab:setup<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u8bbf\u95eehttps:\/\/gitlab.example.com \u7ba1\u7406GitLab\u3002\u5728\u7b2c\u4e00\u6b21\u767b\u5f55\u65f6\uff0c\u60a8\u9700\u8981\u4f7f\u7528\u7ba1\u7406\u5458\u5bc6\u7801\u8fdb\u884c\u767b\u5f55\u3002<\/li>\n<\/ol>\n<p>\u4e09\u3001\u914d\u7f6eGitLab<\/p>\n<ol>\n<li>\u4fee\u6539GitLab\u9ed8\u8ba4\u7684SSH\u7aef\u53e3\u53f7\u4e3a\u65b0\u7aef\u53e3<\/li>\n<\/ol>\n<pre>sudo vim \/etc\/gitlab\/gitlab.rb<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5728\u7f16\u8f91\u5668\u4e2d\uff0c\u627e\u5230\u4ee5\u4e0b\u884c\u5e76\u4fee\u6539\u4e3a\u6240\u9700\u7684\u7aef\u53e3\u53f7\uff1a<\/p>\n<pre>#gitlab_rails['gitlab_shell_ssh_port'] = 22\ngitlab_rails['gitlab_shell_ssh_port'] = 1234<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\uff08\u6ce8\u610f\uff1a\u5c061234\u66f4\u6539\u4e3a\u60a8\u8981\u4f7f\u7528\u7684\u65b0\u7aef\u53e3\u53f7\uff09<\/p>\n<ol>\n<li>\u4f7f\u66f4\u6539\u751f\u6548<\/li>\n<\/ol>\n<pre>sudo gitlab-ctl reconfigure<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u5728\u9632\u706b\u5899\u4e2d\u6253\u5f00\u65b0\u7aef\u53e3\uff08\u5982\u679c\u9700\u8981\uff09<\/li>\n<\/ol>\n<pre>sudo firewall-cmd --permanent --zone=public --add-port=1234\/tcp\nsudo firewall-cmd --reload<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u56db\u3001\u603b\u7ed3<\/p>\n<p>\u5728\u5b89\u88c5\u548c\u914d\u7f6eGitLab\u65f6\uff0c\u8bf7\u59cb\u7ec8\u8bb0\u4f4f\u786e\u4fdd\u60a8\u5b89\u88c5\u4e86\u6700\u65b0\u7248\u672c\u5e76\u6b63\u786e\u914d\u7f6e\u6240\u6709\u8bbe\u7f6e\u3002\u901a\u8fc7\u6b63\u786e\u4f7f\u7528GitLab\uff0c\u60a8\u53ef\u4ee5\u63d0\u9ad8\u56e2\u961f\u7684\u751f\u4ea7\u529b\uff0c\u5e76\u66f4\u8f7b\u677e\u5730\u7ba1\u7406\u548c\u8ddf\u8e2a\u4ee3\u7801\u7684\u7248\u672c\u63a7\u5236\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fcentos\u4e0a\u600e\u4e48\u5b89\u88c5\u914d\u7f6egitlab\uff08\u65b9\u6cd5\u8be6\u89e3\uff09\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>\u5728\u8fdb\u884c\u8f6f\u4ef6\u5f00\u53d1\u65f6\uff0c\u7248\u672c\u63a7\u5236\u662f\u4e00\u9879\u5fc5\u4e0d\u53ef\u5c11\u7684\u4efb\u52a1\uff0c\u6709\u52a9\u4e8e\u56e2\u961f\u534f\u4f5c\u548c\u4ee3\u7801\u7ba1\u7406\u3002gitlab\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5f00\u6e90\u8f6f\u4ef6\uff0c\u7531\u4e8e\u5176\u4eba\u6027\u5316\u7684\u754c\u9762\u548c\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u5e7f\u53d7\u6b22\u8fce\u3002\u672c\u6587\u5c06\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u5982\u4f55\u5728centos\u4e0a\u5b89\u88c5gitlab\u5e76\u8fdb\u884c\u914d\u7f6e\u3002 \u4e00\u3001\u5b89\u88c5GitLab\u6240\u9700\u7684\u73af\u5883\u5728\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u5fc5\u8981\u7684\u8f6f\u4ef6\u5305\uff1a \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u66f4\u65b0yum\u8f6f\u4ef6\u4ed3\u5e93\uff1a sudo yum -y update \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u5b89\u88c5Postfix\u90ae\u4ef6\u670d\u52a1\u5668\uff1a sudo yum -y install postfix sudo systemctl enable postfix sudo systemctl start postfix \u767b\u5f55\u540e\u590d\u5236 \u5b89\u88c5OpenSSL\uff1a sudo yum -y install openssl-devel \u767b\u5f55\u540e\u590d\u5236 \u5b89\u88c5wget\uff1a sudo yum -y install wget \u767b\u5f55\u540e\u590d\u5236 \u4e8c\u3001\u5b89\u88c5\u5e76\u8bbe\u7f6eGitLab \u9996\u5148\uff0c\u66f4\u65b0\u670d\u52a1\u5668\u4ee5\u83b7\u53d6\u6700\u65b0\u7248\u672c\u7684\u6240\u6709\u8f6f\u4ef6\u5305\uff1a sudo yum -y update \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u6dfb\u52a0GitLab\u8f6f\u4ef6\u4ed3\u5e93\uff1a sudo wget https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ee\/script.rpm.sh sudo chmod +x script.rpm.sh 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-19295","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19295","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=19295"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19295\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}