ubuntu搭建自己gitlab服务器
作者:互联网
本来是想用另一种方法安装,但是没有成功将下载链接记录一下。
---------------------------------------------------------------------------------------------------------------------------
启用root账号
arjun@Ubuntu16:~$ sudo passwd root
[sudo] password for arjun:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
arjun@Ubuntu16:~$
查看hostname
arjun@Ubuntu16:~$ cat /etc/hostname
Ubuntu16
查看ip地址
arjun@Ubuntu16:~$ ifconfig
enp4s0 Link encap:Ethernet HWaddr 28:d2:44:80:ec:82
inet addr:192.168.8.66 Bcast:192.168.8.255 Mask:255.255.255.0
inet6 addr: fe80::7884:8de2:7333:58b3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11096 errors:0 dropped:0 overruns:0 frame:0
TX packets:10154 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10279912 (10.2 MB) TX bytes:2246672 (2.2 MB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:28223 errors:0 dropped:0 overruns:0 frame:0
TX packets:28223 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:64152854 (64.1 MB) TX bytes:64152854 (64.1 MB)
arjun@Ubuntu16:~$
安装依赖包
sudo apt-get install curl openssh-server ca-certificates postfix
postfix安装配置
Internet Site ->System mail name
安装gitlab
arjun@Ubuntu16:~$ curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null
arjun@Ubuntu16:~$
源列表中添加清华下载地址
deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial main
打开文件gitlab-ce.list
arjun@Ubuntu16:~$ sudo vim /etc/apt/sources.list.d/gitlab_gitlab-ce.list
文件内容
1 # this file was generated by packages.gitlab.com for
2 # the repository at https://packages.gitlab.com/gitlab/gitlab-ce
3
4 #deb https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ xenial main
5 #deb-src https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ xenial main
6 deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial main
安装 gitlab-ce
sudo apt-get update
sudo apt-get install gitlab-ce
配置gitlab ip地址
arjun@Ubuntu16:~$ sudo vim /etc/gitlab/gitlab.rb
external_url 填写ip地址
重新配置gitlab 使修改的ip生效
sudo gitlab-ctl recounfigure
打开sshd服务和postfix服务
ssd用于远程链接 postfix用于gitlab接受邮件
arjun@Ubuntu16:~$ sudo /etc/init.d/ssh start
[ ok ] Starting ssh (via systemctl): ssh.service.
arjun@Ubuntu16:~$ sudo /etc/init.d/postfix start
[ ok ] Starting postfix (via systemctl): postfix.service.
arjun@Ubuntu16:~$
配置iptables
11 sudo iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
检查gitlab是否安装好运行正常
sudo gitlab-ctl status
通过浏览器设置管理员密码
创建group
window下输入192.168.8.66 用另一个账号进入
添加sshkey
参考网址
Ubuntu 16.04下安装配置和使用Gitlab过程_jinking01的专栏-CSDN博客
标签:sudo,gitlab,ce,arjun,https,ubuntu,Ubuntu16,服务器 来源: https://blog.csdn.net/goldbr/article/details/121091026