1、使用RPM包部署
下载软件包
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8/gitlab-ce-13.7.0-ce.0.el8.x86_64.rpm
安装
rpm -ivh gitlab-ce-13.7.0-ce.0.el8.x86_64.rpm
日志输出
2、修改配置
安装完后可以发现以下信息,需要修改gitlab.rb配置文件
GitLab was unable to detect a valid hostname for your instance. Please configure a URL for your GitLab instance by setting
external_url
configuration in /etc/gitlab/gitlab.rb file. Then, you can start your GitLab instance by running the following command: sudo gitlab-ctl reconfigure
编辑 /etc/gitlab/gitlab.rb 文件,将默认的域名配置修改成需要使用的域名。
# vim /etc/gitlab/gitlab.rb
external_url 'http://gitlab.devops.com'
重新配置命令,不管是不是修改了配置文件,都要执行
gitlab-ctl reconfigure
3、服务运行命令
启动服务
gitlab-ctl start
重启服务
gitlab-ctl restart
查看状态
gitlab-ctl status
停止服务
gitlab-ctl stop
4、web访问
如果使用的是gitlab.devops.com,需要在dns或者本地hosts中添加解析记录
vi /etc/hosts
192.168.1.200 gitlab.devops.com
服务器开放80端口,就可以页面访问了。
第一次进入,需要设置用户密码,默认用户root,能够正常进入登录即可,安装完成。
5、语言改成中文
点右上角头像,进入Settings设置页面
进入Preference,翻到最后,找到Language,设置简体中文并保存。