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 @ 2020-09-06 18:40  NetRookieX  阅读(13)  评论(0编辑  收藏  举报