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
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· 上周热点回顾(2.17-2.23)
· 如何使用 Uni-app 实现视频聊天(源码,支持安卓、iOS)
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)