gitlab服务器搭建
1.安装依赖包
sudo apt-get install curl openssh-server ca-certificates postfix
执行完成后,出现邮件配置,选择Internet那一项(不带Smarthost的)
2.下载最新的包
安装gitlab-ce软件包
在https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu/pool/xenial/main/g/gitlab-ce/链接中下载最新版gitlab-ce(这里下载gitlab-ce_11.1.4-ce.0_amd64.deb)
3.安装
sudo dpkg -i gitlab-ce_11.1.4-ce.0_amd64.deb
4.修改gitlab配置
sudo vim /etc/gitlab/gitlab.rb
修改external_url为
external_url ‘http://192.168.1.128‘
该ip地址为ubuntu的ip地址(具体采用ifconfig查看)
5.gitlab配置重新生成
sudo gitlab-ctl reconfigure
会执行很长时间。
6.检查状态
sudo gitlab-ctl status
run: alertmanager: (pid 32042) 126s; run: log: (pid 32048) 126s
run: gitaly: (pid 31950) 134s; run: log: (pid 31960) 133s
run: gitlab-monitor: (pid 31971) 133s; run: log: (pid 31992) 129s
run: gitlab-workhorse: (pid 31929) 135s; run: log: (pid 31940) 135s
run: logrotate: (pid 30838) 311s; run: log: (pid 31946) 134s
run: nginx: (pid 336) 1s; run: log: (pid 31942) 134s
run: node-exporter: (pid 31170) 259s; run: log: (pid 31963) 133s
run: postgres-exporter: (pid 32063) 125s; run: log: (pid 32071) 125s
run: postgresql: (pid 30295) 454s; run: log: (pid 31918) 136s
run: prometheus: (pid 32016) 127s; run: log: (pid 32062) 125s
run: redis: (pid 30223) 460s; run: log: (pid 31917) 136s
run: redis-exporter: (pid 31305) 237s; run: log: (pid 31976) 131s
run: sidekiq: (pid 30770) 326s; run: log: (pid 31920) 136s
run: unicorn: (pid 30726) 332s; run: log: (pid 31919) 136s
表示正常。
7.在浏览器中输入ip访问。
通常情况下,80端口会被占用。
修改/etc/gitlab/gitlab.rb
增加nginx[‘listen_port‘] = 8081
重新执行,
sudo gitlab-ctl reconfigure
原文地址:https://www.cnblogs.com/jiqing9006/p/9431436.html
时间: 2024-10-11 11:16:47