Ubuntu14.04搭建gitlab代码管理平台

本文详细介绍了如何在Ubuntu14.04上搭建GitLab代码管理平台,包括安装依赖、添加GitLab源、安装gitlab-ce、配置GitLab IP、启动服务、解决GLIBCXX_3.4.21错误,以及设置管理员密码和SSH Key。过程中遇到的问题及解决方案均作了详细说明。
摘要由CSDN通过智能技术生成

Ubuntu14.04搭建gitlab版本管理平台

1.安装依赖包

sudo apt-get install curl openssh-server ca-certificates postfix

注:执行完成后,出现邮件配置,选择Internet那一项(不带Smarthost的)
然后需要填写邮箱配置。

2.添加GitLab安装包镜像源

利用清华大学的镜像(https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/)来进行主程序的安装

2.1 首先信任 GitLab 的 GPG 公钥

curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null

2.2 使用root用户修改配置文件

sudo gedit /etc/apt/sources.list.d/gitlab-ce.list

添加下一行内容:
deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial main

3 安装gitlab-ce

每次添加完软件源后要必须要update一下。

sudo apt-get update
sudo apt-get install gitlab-ce

/**注意:安装需要2GB存储空间
0 upgraded, 1 newly installed, 0 to remove and 448 not upgraded.
Need to get 799 MB of archives.
After this operation, 2,090 MB of additional disk space will be used.
********************************************************************************/

安装完成耗时半小时,出现以下界面:
It looks like GitLab has not been configured yet; skipping the upgrade script.

Thank you for installing GitLab!
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

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

3.1 查看安装的gitlab版本

cat /opt/gitlab/embedded/service/gitlab-rails/VERSION

版本为:
12.10.3

4 配置GitLab IP地址

4.1 修改 externval_url 之后的域名

方法1:(使用GNU nano 2.2.6工具编辑gitlab.rb)
sudo -e /etc/gitlab/gitlab.rb
nano编辑器保存步骤:CTRL+X --> 按Y保存 --> 然后按回车
方法2:使用 vim gedit都可以。

域名值可以是本机 IP 或指向本机 IP的域名
默认未修改的值:
external_url ‘http://gitlab.example.com’
默认是端口80
修改后的值:
external_url ‘http://192.168.19.128’

其他参考配置(8080是自定义端口必须要要和 unicorn[‘port’]一致)
external_url ‘http://192.168.19.128:8080’
(这个端口同上的那个external_url 后的端口)
unicorn[‘port’] = 8080

5.启动sshd和postfix服务

5.1 安装sshd

已经安装成功了可以忽略该步骤。
sudo apt-get install openssh-server

5.2 启动sshd和postfix

sudo service sshd start 

如果无效者执行

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值