gitlab安装
安装环境,dell 420服务器,raid1 软件centos6.9
以下最好安装:
yum install -y curl policycoreutils-python openssh-server cronie gcc
lokkit -s http -s ssh
yum install postfix
service postfix start
chkconfig postfix on
1 新建 /etc/yum.repos.d/gitlab-ce.repo,内容为
[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key
2 再执行
yum makecache
yum install gitlab-ce
3 编辑/etc/gitlab/gitlab.rb
external_url 字段改成 http://192.168.200.48:8000 //公司的内网,可以更改成所需的
gitlab_rails['gitlab_shell_ssh_port'] = 50022 //ssh端口,默认为22,可以自己更改
git_data_dir "/data/gitlab" //自定义数据存储目录
### Email Settings
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = 'gitlab@ABC.com'
gitlab_rails['gitlab_email_display_name'] = 'Gitlab-notify'
# gitlab_rails['gitlab_email_reply_to'] = 'noreply@example.com'
# gitlab_rails['gitlab_email_subject_suffix'] = ''
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "mail.ABC.com" //填入需要接收的邮箱
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "gitlab@ABC.com" //smtp的用户名,根据自己的情况填写
gitlab_rails['smtp_password'] = "123456" //邮箱的登录密码
gitlab_rails['smtp_domain'] = "ABC.com" //邮箱域名
gitlab_rails['smtp_authentication'] = "login"
# gitlab_rails['smtp_enable_starttls_auto'] = true
# gitlab_rails['smtp_tls'] = false
4 vi /opt/gitlab/embedded/conf/nginx.conf
server默认port改为8000
5 防火墙开启8000端口
6 gitlab-ctl stop, 执行 gitlab-ctl reconfigure
7 gitlab-ctl restart
##############################################################################
另外,在yum install gitlab-ce过程中提升 我的glibc过低需要升级,升级过程如下:
[root@buhejiu common]#wget http://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz
[root@buhejiu common]# tar -xf glibc-2.17.tar.gz
[root@buhejiu common]# cd glibc-2.17
[root@buhejiu glibc -2.17]# mkdir build; cd build
[root@buhejiu build]# ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
[root@buhejiu build]# make -j 8
[root@buhejiu build]# make install
[root@buhejiu common]# strings /lib64/libc.so.6 | grep GLIBC
会看到下面的结果 GLIBC_2.2.5 GLIBC_2.2.6 GLIBC_2.3 GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 GLIBC_2.4 GLIBC_2.5 GLIBC_2.6 GLIBC_2.7 GLIBC_2.8 GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 GLIBC_2.12 GLIBC_2.13 GLIBC_2.14 GLIBC_2.15 GLIBC_2.16 GLIBC_2.17 GLIBC_PRIVATE