当前位置 : 李杰的流水账 > 技术 > linux

gitlab centos6下安装

第一种方法,centos直接yum安装

yum install gitlab-ce 到配置管理 vi /etc/gitlab/gitlab.rb 配置邮箱,腾讯企业邮箱为例 gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = "smtp.exmail.qq.com" gitlab_rails['smtp_port'] = 465 gitlab_rails['smtp_user_name'] = "tech@xxx.com" gitlab_rails['smtp_password'] = "xxx" gitlab_rails['smtp_domain'] = "xxx.com" gitlab_rails['smtp_authentication'] = "login" gitlab_rails['smtp_enable_starttls_auto'] = true gitlab_rails['smtp_tls'] = true gitlab_rails['gitlab_email_from'] = "tech@xxx.com" 配置域名 external_url 'http://git.xxx.com' 配置备份 gitlab_rails['manage_backup_path'] = true gitlab_rails['backup_path'] = "/service/backup" ###! Docs: https://docs.gitlab.com/ce/raketasks/backup_restore.html#backup-archive-permissions gitlab_rails['backup_archive_permissions'] = 0644 # gitlab_rails['backup_pg_schema'] = 'public' ###! The duration in seconds to keep backups before they are allowed to be deleted gitlab_rails['backup_keep_time'] = 7776000 运行 sudo gitlab-ctl reconfigure

第二种方法

gitlab.cc说明,测试可用

1. 安装配置依赖项

如想使用Postfix来发送邮件,在安装期间请选择'Internet Site'. 您也可以用sendmai或者 配置SMTP服务使用SMTP发送邮件. 在 Centos 6 和 7 系统上, 下面的命令将在系统防火墙里面开放HTTP和SSH端口.
sudo yum install curl openssh-server openssh-clients postfix cronie
sudo service postfix start
sudo chkconfig postfix on
sudo lokkit -s http -s ssh

2. 添加GitLab仓库,并安装到服务器上

curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce
如果你不习惯使用命令管道的安装方式, 你可以在这里下载 安装脚本 或者 手动下载您使用的系统相应的安装包(RPM/Deb) 然后安装
curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-XXX.rpm
rpm -i gitlab-ce-XXX.rpm

3. 启动GitLab

sudo gitlab-ctl reconfigure

4. 使用浏览器访问GitLab

首次访问GitLab,系统会让你重新设置管理员的密码,设置成功后会返回登录界面. 默认的管理员账号是root,如果你想更改默认管理员账号,请输入上面设置的新密码登录系统后修改帐号名.
    gitlab官网说明,偶尔能用,因为被qiang   https://about.gitlab.com/downloads/#centos6    

1. Install and configure the necessary dependencies

If you install Postfix to send email please select 'Internet Site' during setup. Instead of using Postfix you can also use Sendmail or configure a custom SMTP server and configure it as an SMTP server. On Centos 6 and 7, the commands below will also open HTTP and SSH access in the system firewall.
sudo yum install curl openssh-server openssh-clients postfix cronie
sudo service postfix start
sudo chkconfig postfix on
sudo lokkit -s http -s ssh

2. Add the GitLab package server and install the package

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce
If you are not comfortable installing the repository through a piped script, you can find the entire script here and select and download the package manually and install using
curl -LJO https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/6/gitlab-ce-XXX.rpm/download
rpm -i gitlab-ce-XXX.rpm

3. Configure and start GitLab

sudo gitlab-ctl reconfigure

4. Browse to the hostname and login

On your first visit, you'll be redirected to a password reset screen to provide the password for the initial administrator account. Enter your desired password and you'll be redirected back to the login screen. The default account's username is root. Provide the password you created earlier and login. After login you can change the username if you wish.

内容列表