{"id":45897,"date":"2025-07-30T01:41:26","date_gmt":"2025-07-29T17:41:26","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/45897.html"},"modified":"2025-07-30T01:41:26","modified_gmt":"2025-07-29T17:41:26","slug":"ubunt20-04%e6%90%ad%e5%bb%bagitlab%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%8c%e5%b9%b6%e5%80%9f%e5%8a%a9cpolar%e5%ae%9e%e7%8e%b0%e5%85%ac%e7%bd%91%e8%ae%bf%e9%97%ae","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/45897.html","title":{"rendered":"Ubunt20.04\u642d\u5efaGitLab\u670d\u52a1\u5668\uff0c\u5e76\u501f\u52a9cpolar\u5b9e\u73b0\u516c\u7f51\u8bbf\u95ee"},"content":{"rendered":"<h6 style=\"text-align:justify\"><span style=\"color:#0d0016\">1.\u5b89\u88c5\u4f9d\u8d56<\/span><\/h6>\n<p> sudo apt update<br \/>\nsudo apt install curl openssh-server ca-certificates postfix <\/p>\n<p><span style=\"color:#0d0016\">\u4e0a\u8ff0\u51e0\u4e2a\u5305\u7684\u4f5c\u7528\u5982\u4e0b&#xff1a;<\/span><\/p>\n<ul>\n<li>\n<p><span style=\"color:#0d0016\">curl&#xff1a;\u547d\u4ee4\u884c\u5de5\u5177&#xff0c;\u7528\u4e8e\u53d1\u9001 HTTP \u8bf7\u6c42\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">openssh-server&#xff1a;\u63d0\u4f9b\u8fdc\u7a0b SSH \u767b\u5f55\u670d\u52a1\u7aef\u529f\u80fd\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">ca-certificates&#xff1a;\u5b58\u50a8\u53d7\u4fe1\u4efb\u7684\u6839\u8bc1\u4e66\u5217\u8868\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">postfix&#xff1a;\u8f7b\u91cf\u7ea7\u90ae\u4ef6\u670d\u52a1\u5668&#xff0c;\u7528\u4e8e\u53d1\u9001\u7cfb\u7edf\u90ae\u4ef6\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<p><span style=\"color:#0d0016\">\u5b89\u88c5\u540e\u4f1a\u51fa\u73b0\u5982\u4e0b\u754c\u9762&#xff1a;<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"405\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174105-688907b131367.png\" width=\"701\" \/>\u200b<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"409\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174105-688907b15a045.png\" width=\"711\" \/>\u200b<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u8fd9\u4e2a\u754c\u9762\u662f\u5728\u5b89\u88c5postfix&#xff08;\u90ae\u4ef6\u670d\u52a1\u5668&#xff09;\u65f6&#xff0c;\u7cfb\u7edf\u5f39\u51fa\u7684\u914d\u7f6e\u754c\u9762&#xff0c;\u8981\u6c42\u9009\u62e9\u4e00\u79cd\u90ae\u4ef6\u7cfb\u7edf\u7c7b\u578b\u3002\u6bcf\u4e2a\u9009\u9879\u4ee3\u8868\u4e00\u79cd\u4e0d\u540c\u7684\u90ae\u4ef6\u53d1\u9001\/\u63a5\u6536\u65b9\u5f0f&#xff0c;\u4e0b\u9762\u662f\u6bcf\u4e2a\u9009\u9879\u7684\u7b80\u5355\u89e3\u91ca&#xff1a;<\/span><\/p>\n<ul>\n<li>\n<p><span style=\"color:#0d0016\">No configuration&#xff1a;\u4e0d\u66f4\u6539\u5f53\u524d\u914d\u7f6e&#xff0c;\u9002\u5408\u5df2\u914d\u7f6e\u597d\u6216\u6682\u4e0d\u4f7f\u7528\u90ae\u4ef6\u529f\u80fd\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">Internet Site&#xff1a;\u670d\u52a1\u5668\u76f4\u63a5\u901a\u8fc7 SMTP \u6536\u53d1\u90ae\u4ef6&#xff0c;\u9700\u516c\u7f51\u548c\u57df\u540d\u652f\u6301\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">Internet with smarthost&#xff1a;\u63a5\u6536\u672c\u5730\u6216\u5916\u90e8\u90ae\u4ef6&#xff0c;\u53d1\u9001\u901a\u8fc7\u5916\u90e8\u90ae\u4ef6\u4e2d\u7ee7&#xff08;\u5982 Gmail&#xff09;\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">Satellite system&#xff1a;\u6240\u6709\u90ae\u4ef6\u7edf\u4e00\u8f6c\u53d1\u5230\u6307\u5b9a\u670d\u52a1\u5668\u53d1\u9001&#xff0c;\u672c\u673a\u4e0d\u63a5\u6536\u90ae\u4ef6\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">Local only&#xff1a;\u90ae\u4ef6\u4ec5\u9650\u672c\u673a\u7528\u6237\u95f4\u6536\u53d1&#xff0c;\u9002\u7528\u4e8e\u7cfb\u7edf\u65e5\u5fd7\u548c\u4efb\u52a1\u901a\u77e5\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<p><span style=\"color:#0d0016\">\u6211\u4eec\u7684\u76ee\u7684\u662f\u642d\u5efaGitLab\u670d\u52a1\u5668&#xff0c;\u9009\u62e9Internet site\u5373\u53ef\u3002ok\u786e\u5b9a\u4e4b\u540e\u53ef\u4ee5\u8bbe\u7f6e\u670d\u52a1\u5668\u7684\u540d\u5b57&#xff0c;\u8f93\u5165\u81ea\u5df1\u60f3\u8981\u7684\u540d\u5b57\u5373\u53ef\u3002<\/span><\/p>\n<h6><span style=\"color:#0d0016\">2.\u5b89\u88c5GitLab<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u6267\u884c\u547d\u4ee4&#xff1a;<\/span><\/p>\n<p> curl -s https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.deb.sh | sudo bash <\/p>\n<p><span style=\"color:#0d0016\">\u8be5\u547d\u4ee4\u4f1a\u9759\u9ed8\u4e0b\u8f7d GitLab \u5b98\u65b9\u63d0\u4f9b\u7684\u5b89\u88c5\u811a\u672c&#xff0c;\u5e76\u6267\u884c\u811a\u672c\u4e3a\u7cfb\u7edf\u6dfb\u52a0 GitLab \u793e\u533a\u7248\u7684 APT \u5b89\u88c5\u6e90\u5e76\u5bfc\u5165\u516c\u94a5\u3002\u7136\u540e\u53bbGitLab \u5b98\u65b9&#xff08;https:\/\/packages.gitlab.com\/gitlab\/gitlab-ce&#xff09;\u627e\u5230\u6700\u65b0\u7248\u672c\u7684gitlab-ce\u5b89\u88c5\u5305&#xff0c;\u6211\u8fd9\u91cc\u4f7f\u7528\u7684\u662fubuntu 20.04&#xff0c;\u6240\u4ee5\u5bf9\u5e94\u7684\u662fubuntu\/focal&#xff08;focal\u662fubuntu 20.04\u7684\u522b\u540d&#xff09;&#xff0c;\u4f7f\u7528\u7684\u662fx86\u7684\u4e3b\u673a&#xff0c;\u6240\u793a\u5bf9\u5e94\u7684\u5305\u662fgitlab-ce_17.11.5-ce.0_amd64.deb\u3002\u590d\u5236\u53f3\u4e0b\u89d2\u7684wget\u547d\u4ee4\u5728ubuntu\u7ec8\u7aef\u4e0b\u8f7d\u5b89\u88c5\u5305\u3002<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"911\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174105-688907b16e8ef.png\" width=\"1920\" \/>\u200b<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u6211\u7684\u5b89\u88c5\u547d\u4ee4\u4e3a&#xff1a;<\/span><\/p>\n<p> wget &#8211;content-disposition https:\/\/packages.gitlab.com\/gitlab\/gitlab-ce\/packages\/ubuntu\/focal\/gitlab-ce_17.11.5-ce.0_amd64.deb\/download.deb <\/p>\n<p><span style=\"color:#0d0016\">\u518d\u7528\u4ee5\u4e0b\u547d\u4ee4\u89e3\u538b&#xff1a;<\/span><\/p>\n<p> sudo dpkg -i gitlab-ce_17.11.5-ce.0_amd64.deb <\/p>\n<p><span style=\"color:#0d0016\">\u89e3\u538b\u8fc7\u7a0b\u6709\u70b9\u8017\u65f6&#xff0c;\u89e3\u538b\u6210\u529f\u540e\u754c\u9762\u5982\u4e0b&#xff1a;<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"769\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174106-688907b296f72.png\" width=\"877\" \/>\u200b<\/span><\/p>\n<h6><span style=\"color:#0d0016\">3.\u914d\u7f6eip\u548c\u7aef\u53e3\u53f7<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u4f7f\u7528ifconfig\u547d\u4ee4\u67e5\u770b\u672c\u673a\u7684ip\u5730\u5740&#xff1a;<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"336\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174107-688907b37a67e.png\" width=\"730\" \/><\/span><\/p>\n<p><span style=\"color:#0d0016\">\u6211\u8fd9\u91cc\u662f192.168.160.130&#xff0c;\u8fd0\u884csudo vim \/etc\/gitlab\/gitlab.rb\u6765\u4fee\u6539GitLab\u7684ip\u548c\u7aef\u53e3\u53f7&#xff0c;ip\u5730\u5740\u5c31\u662f\u672c\u673a\u5730\u5740&#xff0c;\u7aef\u53e3\u53f7\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a\u5408\u9002\u7684\u7a7a\u95f2\u7aef\u53e3\u53f7&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u67e5\u770b\u7aef\u53e3\u53f7\u662f\u5426\u7a7a\u95f2&#xff1a;<\/span><\/p>\n<p> sudo lsof -i :\u7aef\u53e3\u53f7 <\/p>\n<p><span style=\"color:#0d0016\">\u5982\u679c\u6267\u884c\u4e0a\u8ff0\u547d\u4ee4\u540e\u6ca1\u6709\u8f93\u51fa\u5c31\u8bf4\u660e\u5bf9\u5e94\u7684\u7aef\u53e3\u53f7\u662f\u7a7a\u95f2\u7684&#xff0c;\u6211\u8fd9\u91cc\u9009\u62e9\u7684\u7aef\u53e3\u53f7\u662f8077&#xff0c;\u5982\u4e0b\u56fe&#xff1a;<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"331\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174107-688907b3a1787.png\" width=\"981\" \/><\/span><\/p>\n<p><span style=\"color:#0d0016\">\u4fdd\u5b58\u9000\u51fa\u540e\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/span><\/p>\n<p> <span style=\"color:#0d0016\"># \u505c\u6b62gitlab\u670d\u52a1<br \/>\nsudo gitlab-ctl stop \u200b<\/p>\n<p># \u914d\u7f6egitlab\u670d\u52a1<br \/>\nsudo gitlab-ctl reconfigure \u200b<\/p>\n<p># \u91cd\u542f\u6240\u6709gitlab\u7ec4\u4ef6<br \/>\nsudo gitlab-ctl restart \u200b<\/p>\n<p># \u542f\u52a8\u6240\u6709gitlab\u7ec4\u4ef6<br \/>\nsudo gitlab-ctl start<\/p>\n<p># \u542f\u7528\u5f00\u673a\u81ea\u542f\u52a8<br \/>\nsudo systemctl enable gitlab-runsvdir.service<br \/>\n<\/span> <\/p>\n<h6><span style=\"color:#0d0016\">4.\u8bbe\u7f6eGitLab\u7ba1\u7406\u5458\u8d26\u6237<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u7ba1\u7406\u5458\u8d26\u6237\u7684\u7528\u6237\u540d\u9ed8\u8ba4\u4e3aroot&#xff0c;\u8bbe\u7f6e\u7684\u5bc6\u7801\u4e0d\u80fd\u592a\u77ed&#xff0c;\u5426\u5219\u4f1a\u5931\u8d25\u3002\u5728\u7ec8\u7aef\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4&#xff08;\u6253\u5f00\u63a7\u5236\u53f0\u53ef\u80fd\u6709\u4e9b\u8017\u65f6\u6bd4\u8f83\u6162&#xff09;&#xff1a;<\/span><\/p>\n<p> <span style=\"color:#0d0016\">#\u5207\u6362\u5de5\u4f5c\u76ee\u5f55&#xff0c;gitlab-rails\u53ef\u6267\u884c\u7a0b\u5e8f\u5728\u76ee\u5f55\/opt\/gitlab\/bin\/ \u4e0b<br \/>\ncd \/opt\/gitlab\/bin\/ \u200b<\/p>\n<p>#\u6253\u5f00\u63a7\u5236\u53f0<br \/>\nsudo gitlab-rails console -e production \u200b<\/p>\n<p>#\u67e5\u8be2\u7528\u6237\u8d26\u53f7\u4fe1\u606f\u5e76\u8d4b\u503c\u7ed9u<br \/>\nu&#061;User.where(id:1).first\u200b<\/p>\n<p>#\u8bbe\u7f6eroot\u7684\u5bc6\u7801&#xff0c;\u5bc6\u7801\u592a\u77ed\u4f1a\u5931\u8d25<br \/>\nu.password&#061;&#039;myserver123&#039;<\/p>\n<p>#\u786e\u8ba4\u5bc6\u7801<br \/>\nu.password_confirmation&#061;&#039;myserver123&#039;<\/p>\n<p>#\u4fdd\u5b58\u4fe1\u606f(\u6ce8\u610f\u6709\u4e2a\u611f\u53f9\u53f7&#xff09;<br \/>\nu.save!<\/p>\n<p>#\u9000\u51fa<br \/>\nexit<\/span> <\/p>\n<p><span style=\"color:#0d0016\">\u6267\u884c\u7ed3\u679c\u5982\u4e0b\u56fe&#xff1a;<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"309\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174108-688907b420dc6.png\" width=\"734\" \/>\u200b<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u5b8c\u6210\u4e0a\u8ff0\u6b65\u9aa4\u4e4b\u540e&#xff0c;\u5728\u540c\u4e00\u4e2a\u5c40\u57df\u7f51\u5185\u5df2\u7ecf\u53ef\u4ee5\u901a\u8fc7ip\u5730\u5740\u548c\u7aef\u53e3\u53f7\u8bbf\u95eeGitLab\u670d\u52a1\u5668\u4e86&#xff08;\u6211\u8fd9\u91cc\u7684\u5730\u5740\u662fhttp:\/\/192.168.160.130:8077&#xff09;&#xff0c;\u5982\u4e0b\u56fe\u6240\u793a&#xff1a;<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"814\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174108-688907b4496d5.png\" width=\"1816\" \/>\u200b<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u8f93\u5165\u8d26\u6237\u540droot\u548c\u521a\u521a\u8bbe\u7f6e\u7684\u5bc6\u7801\u5373\u53ef\u6210\u529f\u767b\u5f55&#xff1a;<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"815\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174109-688907b5b9e1a.png\" width=\"1826\" \/>\u200b<\/span><\/p>\n<h6><span style=\"color:#0d0016\">5.\u5229\u7528cpolar\u5b9e\u73b0\u5185\u7f51\u7a7f\u900f<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u9996\u5148\u5230cpolar\u5b98\u7f51&#xff08;cpolar &#8211; secure introspectable tunnels to localhost&#xff09;\u6ce8\u518c\u4e00\u4e2a\u8d26\u53f7&#xff0c;\u6ce8\u518c\u754c\u9762\u5982\u4e0b&#xff1a;<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"701\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174111-688907b72b714.png\" width=\"1010\" \/>\u200b<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u6ce8\u518c\u6210\u529f\u4e4b\u540e\u767b\u5f55&#xff0c;\u5728\u9a8c\u8bc1\u680f\u53ef\u4ee5\u770b\u5230\u4e00\u4e2atoken&#xff0c;\u6211\u7684token\u5982\u4e0b\u56fe&#xff1a;<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"652\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174111-688907b77ccee.png\" width=\"1094\" \/>\u200b<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u6253\u5f00\u7ec8\u7aef&#xff0c;\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5cpolar-client&#xff1a;<\/span><\/p>\n<p> curl -L https:\/\/www.cpolar.com\/static\/downloads\/install-release-cpolar.sh | sudo bash <\/p>\n<p><span style=\"color:#0d0016\">\u7136\u540e\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u7248\u672c\u53f7&#xff0c;\u5982\u679c\u6210\u529f\u663e\u793a\u7248\u672c\u53f7\u8bf4\u660ecpolar-client\u5b89\u88c5\u6210\u529f&#xff1a;<\/span><\/p>\n<p> cpolar version <\/p>\n<p><span style=\"color:#0d0016\">\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8ba4\u8bc1token&#xff0c;\u5c06\u521a\u624d\u5728\u5b98\u7f51\u9a8c\u8bc1\u680f\u83b7\u53d6\u7684token\u7c98\u8d34\u5230\u547d\u4ee4\u4e2d\u7684\u5bf9\u5e94\u4f4d\u7f6e\u5373\u53ef&#xff1a;<\/span><\/p>\n<p> cpolar authtoken \u9a8c\u8bc1\u680f\u7684token <\/p>\n<p><span style=\"color:#0d0016\">\u800c\u540e\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/span><\/p>\n<p> <span style=\"color:#0d0016\">#\u5411\u7cfb\u7edf\u6dfb\u52a0\u670d\u52a1<br \/>\nsudo systemctl enable cpolar<\/p>\n<p>#\u542f\u52a8\u670d\u52a1<br \/>\nsudo systemctl start cpolar<\/p>\n<p>#\u67e5\u770b\u670d\u52a1\u72b6\u6001<br \/>\nsudo systemctl status cpolar<\/span> <\/p>\n<p><span style=\"color:#0d0016\">\u7ed3\u679c\u5982\u4e0b\u8bf4\u660e\u670d\u52a1\u5df2\u6210\u529f\u5f00\u542f&#xff1a;<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"231\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174112-688907b849cfa.png\" width=\"810\" \/>\u200b<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u6210\u529f\u542f\u52a8 cpolar \u670d\u52a1\u540e&#xff0c;\u53ef\u4ee5\u5728\u6d4f\u89c8\u5668\u4e0a\u8bbf\u95ee ubuntu\u5c40\u57df\u7f51 ip \u5730\u5740&#043;9200 \u7aef\u53e3&#xff08;\u5728\u6211\u8fd9\u91cc\u5c31\u662fhttp:\/\/192.168.160.130:9200 &#xff09;&#xff0c;\u767b\u5f55 cpolar web UI \u7ba1\u7406\u754c\u9762&#xff0c;\u5e76\u4f9d\u6b21\u70b9\u51fb\u96a7\u9053\u7ba1\u7406-&gt;\u521b\u5efa\u96a7\u9053\u3002\u5982\u4e0b\u56fe&#xff1a;<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"629\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174112-688907b8bedce.png\" width=\"1284\" \/>\u200b<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u7136\u540e\u6839\u636e\u9700\u8981\u8bbe\u7f6e\u96a7\u9053\u540d\u79f0&#xff0c;\u534f\u8bae\u9009\u4e2dhttp&#xff0c;\u672c\u5730\u5730\u5740\u5c31\u662f\u521a\u624d\u5728\/etc\/gitlab\/gitlab.rb\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u7684\u7aef\u53e3\u53f7&#xff08;\u6211\u8fd9\u91cc\u662f8077&#xff09;&#xff0c;\u57df\u540d\u9009\u4e2d\u968f\u673a\u57df\u540d&#xff0c;\u5730\u533a\u9009\u4e2dChina VIP&#xff0c;\u7136\u540e\u521b\u5efa\u5373\u53ef\u3002\u521b\u5efa\u6210\u529f\u540e\u53ef\u4ee5\u5728\u72b6\u6001-&gt;\u5728\u7ebf\u96a7\u9053\u5217\u8868\u4e2d\u770b\u89c1\u76f8\u5e94\u7684\u8868\u9879&#xff1a;<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"469\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174113-688907b969511.png\" width=\"1810\" \/>\u200b<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u518d\u6b21\u8fd0\u884csudo vim \/etc\/gitlab\/gitlab.rb\u547d\u4ee4&#xff0c;\u4fee\u6539GitLab\u670d\u52a1\u5668\u7684ip\u914d\u7f6e&#xff0c;\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9&#xff08;\u6ce8\u610f&#xff1a;\u8fd9\u91cc\u6240\u6dfb\u52a0\u7684\u5177\u4f53\u914d\u7f6e\u4fe1\u606f\u8981\u4e0e\u4e0a\u9762\u5728cpolar\u4e2d\u7684\u72b6\u6001-&gt;\u5728\u7ebf\u96a7\u9053\u5217\u8868\u4e2d\u663e\u793a\u7684\u4e00\u81f4&#xff09;&#xff1a;<\/span><\/p>\n<p> <span style=\"color:#0d0016\"># \u8bbe\u7f6eGitLab\u7684\u5916\u90e8\u8bbf\u95eeURL&#xff08;\u7528\u4e8e\u9875\u9762\u3001HTTP\u514b\u9686&#xff09;<br \/>\nexternal_url &#039;http:\/\/5c5c3a3d.r10.vip.cpolar.cn&#039;<\/p>\n<p># \u8bbe\u7f6eGitLab\u7684SSH\u8bbf\u95ee\u5730\u5740&#xff08;\u7528\u4e8eSSH\u514b\u9686&#xff09;<br \/>\ngitlab_rails[&#039;gitlab_ssh_host&#039;] &#061; &#039;5.tcp.cpolar.top&#039;<br \/>\ngitlab_rails[&#039;gitlab_shell_ssh_port&#039;] &#061; 12919<\/p>\n<p># \u8bbe\u7f6e\u76d1\u542c\u7aef\u53e3\u53f7&#xff0c;\u4e0d\u6dfb\u52a0\u8fd9\u4e24\u53e5\u4f1a\u5bfc\u81f48077\u7aef\u53e3\u672a\u88ab\u76d1\u542c\u800c\u65e0\u6cd5\u8bbf\u95eeGitLab\u670d\u52a1\u5668<br \/>\nnginx[&#039;listen_port&#039;] &#061; 8077<br \/>\nnginx[&#039;listen_https&#039;] &#061; false<br \/>\n<\/span> <\/p>\n<p><span style=\"color:#0d0016\">\u5982\u4e0b\u56fe\u6240\u793a&#xff1a;<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"206\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174114-688907bad09bc.png\" width=\"845\" \/>\u200b<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u4fdd\u5b58\u9000\u51fa\u540e&#xff0c;\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4&#xff0c;\u91cd\u65b0\u914d\u7f6e\u5e76\u91cd\u65b0\u542f\u52a8GitLab\u670d\u52a1\u5668&#xff1a;<\/span><\/p>\n<p> <span style=\"color:#0d0016\"># \u91cd\u65b0\u914d\u7f6eGitLab\u670d\u52a1<br \/>\nsudo gitlab-ctl reconfigure \u200b<\/p>\n<p># \u91cd\u542f\u6240\u6709GitLab\u7ec4\u4ef6<br \/>\nsudo gitlab-ctl restart<\/span> <\/p>\n<p><span style=\"color:#0d0016\">\u6b64\u65f6\u5c31\u53ef\u4ee5\u5728\u516c\u7f51\u901a\u8fc7cpolar\u63d0\u4f9b\u7684\u516c\u7f51\u57df\u540d\u8bbf\u95ee\u6211\u4eec\u7684GitLab\u670d\u52a1\u5668\u4e86&#xff0c;\u4f8b\u5982\u6211\u7684cpolar\u516c\u7f51\u57df\u540d\u5982\u4e0b\u56fe&#xff1a;<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"389\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174115-688907bb4663e.png\" width=\"1600\" \/>\u200b<\/span><\/p>\n<p> <span style=\"color:#0d0016\">\u5728\u6d4f\u89c8\u5668\u4e0a\u8f93\u5165Sign in \u00b7 GitLab&#xff0c;\u5373\u53ef\u8bbf\u95eeGitLab&#xff0c;\u5982\u4e0b\u56fe&#xff1a;<\/span><\/p>\n<p> <span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"835\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174116-688907bc8a970.png\" width=\"1831\" \/><\/span><\/p>\n<p> <span style=\"color:#0d0016\">\u53ef\u4ee5\u5728Preferences\u9009\u9879\u5361\u4e2d\u5c06\u8bed\u8a00\u4fee\u6539\u6210\u4e2d\u6587&#xff1a;<\/span><\/p>\n<p> <span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"912\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174118-688907beb557a.png\" width=\"1920\" \/><\/span><\/p>\n<p> <span style=\"color:#0d0016\">\u4fdd\u5b58\u540e\u91cd\u65b0\u5237\u65b0\u4e0b\u5373\u53ef\u3002\u6b64\u65f6\u521b\u5efa\u9879\u76ee\u540e\u53ef\u4ee5\u770b\u5230&#xff0c;git clone\u7684\u5730\u5740\u4e5f\u76f8\u5e94\u7684\u53d8\u6210\u4e86\u516c\u7f51\u5730\u5740&#xff0c;\u5728\u5176\u4ed6\u7f51\u6bb5\u7684\u4e3b\u673a\u662f\u53ef\u4ee5clone\u6211\u4eecGitLab\u670d\u52a1\u5668\u4e0a\u7684\u4ee3\u7801\u7684\u3002\u4f46\u662fcpolar\u7684\u516c\u7f51\u57df\u540d\u5728\u6ca1\u5f00\u4f1a\u5458\u7684\u60c5\u51b5\u4e0b\u4f1a\u5b9a\u671f\u6539\u53d8&#xff0c;\u8fd9\u70b9\u6bd4\u8f83\u70e6\u4eba\u3002<\/span><\/p>\n<p> <span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"961\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174121-688907c1936bf.png\" width=\"1819\" \/><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e15\u6b21\uff0c\u6536\u85cf27\u6b21\u3002\u5728ubuntu 20.04\u4e0a\u642d\u5efa\u53ef\u4f9b\u516c\u7f51\u8bbf\u95ee\u7684GitLab\u670d\u52a1\u5668\u7684\u6559\u7a0b\u3002<\/p>\n","protected":false},"author":2,"featured_media":45878,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[273,58,43,704],"topic":[],"class_list":["post-45897","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-gitlab","tag-linux","tag-43","tag-704"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Ubunt20.04\u642d\u5efaGitLab\u670d\u52a1\u5668\uff0c\u5e76\u501f\u52a9cpolar\u5b9e\u73b0\u516c\u7f51\u8bbf\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/45897.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ubunt20.04\u642d\u5efaGitLab\u670d\u52a1\u5668\uff0c\u5e76\u501f\u52a9cpolar\u5b9e\u73b0\u516c\u7f51\u8bbf\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e15\u6b21\uff0c\u6536\u85cf27\u6b21\u3002\u5728ubuntu 20.04\u4e0a\u642d\u5efa\u53ef\u4f9b\u516c\u7f51\u8bbf\u95ee\u7684GitLab\u670d\u52a1\u5668\u7684\u6559\u7a0b\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/45897.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-29T17:41:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174105-688907b131367.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/45897.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/45897.html\",\"name\":\"Ubunt20.04\u642d\u5efaGitLab\u670d\u52a1\u5668\uff0c\u5e76\u501f\u52a9cpolar\u5b9e\u73b0\u516c\u7f51\u8bbf\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-07-29T17:41:26+00:00\",\"dateModified\":\"2025-07-29T17:41:26+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/45897.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/45897.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/45897.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ubunt20.04\u642d\u5efaGitLab\u670d\u52a1\u5668\uff0c\u5e76\u501f\u52a9cpolar\u5b9e\u73b0\u516c\u7f51\u8bbf\u95ee\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ubunt20.04\u642d\u5efaGitLab\u670d\u52a1\u5668\uff0c\u5e76\u501f\u52a9cpolar\u5b9e\u73b0\u516c\u7f51\u8bbf\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/45897.html","og_locale":"zh_CN","og_type":"article","og_title":"Ubunt20.04\u642d\u5efaGitLab\u670d\u52a1\u5668\uff0c\u5e76\u501f\u52a9cpolar\u5b9e\u73b0\u516c\u7f51\u8bbf\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e15\u6b21\uff0c\u6536\u85cf27\u6b21\u3002\u5728ubuntu 20.04\u4e0a\u642d\u5efa\u53ef\u4f9b\u516c\u7f51\u8bbf\u95ee\u7684GitLab\u670d\u52a1\u5668\u7684\u6559\u7a0b\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/45897.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-07-29T17:41:26+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729174105-688907b131367.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/45897.html","url":"https:\/\/www.wsisp.com\/helps\/45897.html","name":"Ubunt20.04\u642d\u5efaGitLab\u670d\u52a1\u5668\uff0c\u5e76\u501f\u52a9cpolar\u5b9e\u73b0\u516c\u7f51\u8bbf\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-07-29T17:41:26+00:00","dateModified":"2025-07-29T17:41:26+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/45897.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/45897.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/45897.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Ubunt20.04\u642d\u5efaGitLab\u670d\u52a1\u5668\uff0c\u5e76\u501f\u52a9cpolar\u5b9e\u73b0\u516c\u7f51\u8bbf\u95ee"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/45897","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=45897"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/45897\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/45878"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=45897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=45897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=45897"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=45897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}