CentOS7安装gitlab的过程并使用

  •   
  • 3693
  • Linux
  • 0
  • super_dodo
  • 2019/07/01

温馨提示:安装gitlab需要在至少4G以上的内存的服务器上面安装。

安装过程直接参考官方的安装流程。https://about.gitlab.com/install/#centos-7
gitlab
1.安装并配置必要的依赖项
在CentOS 7(和RedHat / Oracle / Scientific Linux 7)上,以下命令还将在系统防火墙中打开HTTP和SSH访问。

1
2
3
4
5
sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld

接下来,安装Postfix以发送通知电子邮件。如果要使用其他解决方案发送电子邮件,请跳过此步骤并在安装GitLab后配置外部SMTP服务器。

1
2
3
4
5
6
7
8
9
10
11
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
 
#在Postfix安装期间,可能会出现配置屏幕。选择“Internet Site”并按Enter键。
#使用服务器的外部DNS作为“邮件名称”,然后按Enter键。如果出现其他屏幕,请继续按Enter键接受默认值。
 
#如果启动出错
postfix: fatal: parameter inet_interfaces: no local interface found for ::1
#请参考站内文章
<blockquote class="wp-embedded-content" data-secret="hmnpJXzmIP"><a href="http://www.dodobook.net/php/3490/">postfix: fatal: parameter inet_interfaces: no local interface found for ::1</a></blockquote><iframe title="《postfix: fatal: parameter inet_interfaces: no local interface found for ::1》—布客网-PHP学习交流网" class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);" src="http://www.dodobook.net/php/3490/embed/#?secret=hmnpJXzmIP" data-secret="hmnpJXzmIP" width="500" height="282" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>

2.添加GitLab软件包存储库并安装软件包

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#添加GitLab包存储库。
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
 
 
#接下来,安装GitLab包。更改https://gitlab.example.com为您要访问GitLab实例的URL。安装将自动配置并启动该URL的GitLab。
#对于https://URL,GitLab将自动使用Let's Encrypt请求证书,该证书需要入站HTTP访问和有效的主机名。您也可以使用自己的证书或只使用http://。
 
sudo EXTERNAL_URL="http://47.88.88.88:8080" yum install -y gitlab-ce
 
#建议以IP地址+端口的形式安装,因为很多本地已经安装了nginx,所以ip地址+端口监听比较容易。
#后面需要绑定域名的话,使用nginx反向代理到该IP+端口即可。
#Https的话请仔细查阅相关的gitlab的文档。
 
 
#停止GitLab
gitlab-ctl stop
 
#停止GitLab
gitlab-ctl start
 
#停止GitLab
gitlab-ctl status
 
#修改过gitlab的配置文件需要重加载
gitlab-ctl reconfigure

3.浏览到主机名并登录
在您第一次访问时,您将被重定向到密码重置屏幕。提供初始管理员帐户的密码,您将被重定向回登录屏幕。使用默认帐户的用户名root登录。
有关安装和配置的详细说明,请参阅我们的文档。

4.设置通信首选项(可忽略)
访问我们的电子邮件订阅偏好中心,告知我们何时与您沟通。我们有明确的电子邮件选择加入政策,因此您可以完全控制我们向您发送电子邮件的频率和频率。
每月两次,我们会发送您需要了解的GitLab新闻,包括我们开发团队的新功能,集成,文档和幕后故事。有关错误和系统性能的重要安全更新,请注册我们的专用安全通讯。

登录之后可以设置中文版本,但是语言包不完整。
每次添加用于之后,用户首次登录都会需要要求重置密码。
建议每个人都用自己的个人账户。

参考网址如下:

postfix: fatal: parameter inet_interfaces: no local interface found for ::1


https://docs.gitlab.com/omnibus/settings/nginx.html#enable-https
https://docs.gitlab.com/omnibus/README.html#configuring
https://segmentfault.com/q/1010000003695935/a-1020000003704630
https://blog.csdn.net/tanqian351/article/details/82020523