linux安装gitlab

转载链接:https://cloud.tencent.com/info/497b83f3ee97879ae9526ebe65061b9a.html
转载链接:https://blog.csdn.net/xiangshanqishi/article/details/23439397
在安装过程中根据自身情况,把遇到的问题加以说明。
1.安装gitlab的之前需要安装的环境
sudo yum install curl policycoreutils openssh-server openssh-clients git -y
sudo systemctl enable sshd
sudo systemctl start sshd
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
在安装postfix的时候,

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

解决办法为:

配置为:

inet_interfaces = localhost

inet_protocols = all

改成:

inet_interfaces = all

inet_protocols = all

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

curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bashsudo yum install gitlab-ce

安装GitLab遇到。Cannot allocate memory 错误,原因是因为用的1G内存的云服务进行安装的,官方最低要求为2G。
解决办法是:swap多1G给内存。

转载:https://blog.csdn.net/sunrising_hill/article/details/52084517

1、找到你的系统里面剩余空间够大的分区(可以使用其中足够多的空间作为SWAP用

途),

我的机器的目录为“/opt”

[plain] view plain copy
  1. cd /opt  
  2. mkdir swap  
  3. cd swap  
2、使用dd命令新建分区文件:

[plain] view plain copy
  1. dd if=/dev/zero of=swapfile bs=1M count=1024 
这里是增加1G的swap,根据个人需要进行调整。

3、强swapfile增加为swap分区,并开启。

[plain] view plain copy
  1. mkswap swapfile  
  2. swapon swapfile  
4、使用free命令查看你的swap分区是否已经变大。

[plain] view plain copy
  1. [root@serverswap]# free  
  2.              total       used       free     shared    buffers     cached  
  3. Mem:      49413764   48869760     544004          0     141040   44653184  
  4. -/+ buffers/cache:    4075536   45338228  
  5. Swap:     50330960    2090112   48240848  

3. 启动GitLab

sudo gitlab-ctl reconfigure    

   sudo gitlab-ctl start

这个时候已经可以正常访问gitlab了,第一次会要求输入root的密码,然后登录就可以了


修改配置,将项目的域名改为ip地址,因为这台机器只有ip,没有绑定域名

https://www.cnblogs.com/kaneyang/p/7090923.html

vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
复制代码
## GitLab settings
  gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    host: 111.15.XXX.X         >> 这里改为主机的IP即可
    port: 80
    https: false

    # Uncommment this line below if your ssh host is different from HTTP/HTTPS one
    # (you'd obviously need to replace ssh.host_example.com with your own host).
    # Otherwise, ssh host will be set to the `host:` value above
复制代码

 

复制代码

重启GitLab  

gitlab-ctl restart

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值