·下载gitlab镜像文件、并安装(国内镜像地址)
sudo yum localinstall –nogpgcheck https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.6.5-ce.0.el7.x86_64.rpm
find / -name gitlab-ce-10.6.5-ce.0.el7.x86_64.rpm #查找下载地址
rpm -ivh /var/tmp/yum-root-P_hwJD/gitlab-ce-10.6.5-ce.0.el7.x86_64.rpm #手动安装rpm
配置gitlab
#mkdir -p /etc/gitlab #这一步没用到
#touch /etc/gitlab/gitlab.rb #这一步没用到
chmod -x /etc/gitlab/gitlab.rb
修改端口:
vi /etc/gitlab/gitlab.rb
#unicorn['port'] = 8080 修改 8070 默认是注释的去掉前面的
unicorn['port'] = 8070
#nginx['listen_port'] = nil 修改 8090 默认是注释的去掉前面的
nginx['listen_port'] = 8090
配置监听
vi /var/opt/gitlab/gitlab-rails/etc/unicorn.rb
#listen "127.0.0.1:8080", :tcp_nopush => true
listen "127.0.0.1:8070", :tcp_nopush => true
监听端口
修改默认的gitlab nginx的web服务80端 /var/opt/gitlab/nginx/conf/gitlab-http.conf
vi /var/opt/gitlab/nginx/conf/gitlab-http.conf
#listen *:80;
listen *:8090;
---------------------
执行新配置
gitlab-ctl reconfigure
执行重启gitlab
gitlab-ctl status
----------------------------------------------------------------------------------------------------------------------------------------
续篇:
尝试访问gitlab,发现一直报504错误,尝试了一些办法,包括:
1)是否端口冲突
例如:查看端口是否被占用:netstat -anp|grep 80 --发现8070、8090没有被占用,但问题没有解决
2)查看是否安装了依赖包,也没有任何问题,问题还是未解决
# sudo yum install -y curl policycoreutils-python openssh-server
# sudo systemctl enable sshd # sudo systemctl start sshd --启动sshd
3)尝试关闭防火墙(永久关闭),待补
# sudo firewall-cmd --permanent --add-service=http
# sudo systemctl reload firewalld
4)
vi /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
2.将gitlab节点下的host改成对应的ip/域名 ????
重启服务,就可以了.