更改gitlab默认端口

更改gitlab默认端口

安装环境:centos 7.2
安装版本:gitlab-ce-9.2.5-ce.0.el7.x86_64
安装方式如下(具体百请百度)

yum install gitlab-ce 

等待安装完成之后,默认已经启动,gitlab监听的是80端口,所以可以直接ip访问,或者可以修改如下配置文件添加域名:

/etc/gitlab/gitlab.rb

但是我的80端口其他服务要用,所以要更改gitlab监听端口,如下的site configuration已经默认添加在nginx中:

cd /var/opt/gitlab/nginx/conf
vim gitlab-http.conf

---- site configuration(截取一部分) ----
upstream gitlab-workhorse {
  server unix:/var/opt/gitlab/gitlab-workhorse/socket;
}


server {
  listen *:80; --修改端口


  server_name localhost;
  server_tokens off; ## Don't show the nginx version number, a security best practice

将其中的80改为其它端口即可,如我的是8099,如下,重启gitlab等待网关恢复,重新访问:http://ip:8099

gitlab-ctl restart

最后,具体的配置最好阅读配置文件注释,参考官网:
gitlab相关配置

猜你喜欢

转载自blog.csdn.net/wizard_rp/article/details/73147129
今日推荐