Gitlab搭建

环境

  • CentOS7

步骤

安装依赖包
yum install -y policycoreutils-python openssh-server
systemctl enable sshd
systemctl start sshd
安装邮件服务
yum -y install postfix
systemctl enable postfix
systemctl start postfix
安装扩展源
wget https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh
chmod +x script.rpm.sh
./script.rpm.sh
安装gitlab
yum install -y gitlab-ee
修改配置&启动
vim /etc/gitlab/gitlab.rb
		external_url 'http://192.168.10.130'		#监听的域名/IP
		nginx['listen_port'] = 80						#监听端口
firewall-cmd --add-port=80/tcp
firewall-cmd --add-port=80/tcp --per
gitlab-ctl reconfigure		#重载配置文件,并启动gitlab(运行时间会有点长)

其他配置信息可以看文档

访问

新版gitlab:

  • 用户名:root
  • 密码:位于/etc/gitlab/initial_root_password

老版gitlab:

第一次访问gitlab,会提示设置root用户的密码,这是管理员用户。

需要注意的是,启动gitlab需要很长时间,这段时间若访问gitlab会报错502,请耐心等待几分钟

常用命令

gitlab-ctl tail				#跟踪日志
gitlab-ctl restart			#重启,重启需要等待很长时间
gitlab-ctl start			#启动
gitlab-ctl stop				#停止
gitlab-ctl reconfigure		#重载配置文件,并启动gitlab
posted @   NetRookieX  阅读(15)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· 上周热点回顾(2.17-2.23)
· 如何使用 Uni-app 实现视频聊天(源码,支持安卓、iOS)
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
点击右上角即可分享
微信分享提示