Gitlab Linux environment installation

  • The environment checks whether gitlab has been installed, and needs to be uninstalled if it is installed

# 检查当前环境是否已经安装了gitlab,并且查看版本
gitlab-rails console
# 删除命令
yum remove git

# 查找命令
rpm -qa | grep gitlab 
# 删除命令
rpm -e gitlab-ce-12.10.1-ce.0.el8.x86_64
# 查找命令
 find / -name git
# 删除命令 (find / -name git 检查出来的路径要逐一删除a b c d e各代表一个路径)
rm -rf a b c d e

  • mirror preparation

  • Install qu environment dependencies

# 资源库查看
yum search policycoreutils-python
# 安装依赖
yum install policycoreutils-python
  • install gitlab

rpm -i gitlab-ce-12.10.1-ce.0.el7.x86_64.rpm
  • Update configuration (where external_url must be configured, others are optional)

  • external_url: Access detailed address, for example: external_url ' http://127.0.0.1:18080 ', the IP needs to be replaced with an IP that can be accessed externally in actual use

  • gitlab_rails['backup_path']: Backup file address, for example: gitlab_rails['backup_path'] = "/home/data/backups", the default /var/opt /gitlab/backups is in this location, if you need to restore the backup, the backup file points to The path must be the backup file address

  • git_data_dirs: data storage location, for example: git_data_dirs({"default" => {"path" => "/home/data/gitlab-data"}})

, only configure one can use (git_data_dir)

vi /etc/gitlab/gitlab.rb
  • refresh configuration

gitlab-ctl reconfigure
  • start gitlab

# 启动
gitlab-ctl start
# 停止 
gitlab-ctl stop
# 重启
gitlab-ctl restart

To access gitlab, the premise is that the firewall and other policy configurations are allowed. In the address bar of the browser, enter the server's IP + set port number to enter the GitLab login interface. For the first login, use the user name root and the password when accessing GitLab for the first time. Set a new password, pay attention to update the password, the password is time-sensitive.

  • View real-time logs

gitlab-ctl tail

Guess you like

Origin blog.csdn.net/scdncby/article/details/129200166