如何将gitlab的默认端口80更改为自定义端口号?
有两种方法我尝试过:
在/etc/gitlab/gitlab.rb中设置端口
external_port "8888"
然后运行重新configuration:
gitlab-ctl reconfigure
在/var/opt/gitlab/gitlab-rails/etc/gitlab.yml中设置端口
production: &base # # 1. GitLab app settings # ========================== ## GitLab settings gitlab: ## Web server settings (note: host is the FQDN, do not include http://) host: gitlab.blitting.com port: 8888 https: false
然后重新启动gitlab
gitlab-ctl stop gitlab-ctl start
有了这两个,gitlab继续在默认的80端口号上运行。
乍得卡尔伯特答案仍然适用,但只是想添加额外的版本7.0.0。
在你的文本编辑器中打开“/etc/gitlab/gitlab.rb”,目前我有external_url http://127.0.0.1/
或类似的东西。 我可能需要用包括端口号的dns(例如' http://gitlab.com.local:81 / ')来更改external_url,然后使用命令“sudo gitlab-ctl reconfigure”重新configurationGitlab现在在端口81上工作。
一步步:
sudo -e /etc/gitlab/gitlab.rb
yourdomain.com:9999
external_url更改为yourdomain.com:9999
9999
– >你想让它运行的端口 sudo gitlab-ctl reconfigure
我也有这个相同的问题。 我没有我的gitlab.rb
与你在同一个位置,但是确实已经通过dpkg在你提到的/opt
path上安装了。
如果您已经通过软件包安装了它,所有自包含在/opt
目录中,那么您可能会发现在以下位置更改端口:
/opt/gitlab/embedded/conf/nginx.conf
/opt/gitlab/embedded/cookbooks/gitlab/templates/default/nginx-gitlab-http.conf.erb
问题#6581: 在Ubuntu 12.04上安装.deb软件包 – 忽略gitlab.yml文件中的端口号
我的主要问题是,新用户没有得到系统发送的电子邮件中的自定义端口号。 否则,手动在地址栏中写入自定义端口将导致用户进行Gitlab安装。
我在Ubuntu 14.04上完成了这个安装 ,而不是Omnibus。 所以不知何故,我没有gitlab-ctl
。 (它存在于/usr/bin
,但是符号链接的目标没有被安装,如果我真的需要的话,我将单独修复)。
无论如何,我使用了第二种方法的变体,将正确的端口写入/home/git/gitlab/config/gitlab.yml
:
production: &base # # 1. GitLab app settings # ========================== ## GitLab settings gitlab: ## Web server settings (note: host is the FQDN, do not include http://) host: my.gitlab.host.com port: 3722
由于我没有gitlab-ctl
,所以我使用了service
:
sudo service gitlab restart
这对我有效。 我发送电子邮件的新用户收到了包含正确URL的链接。
非常简单的方法来更改默认端口号
gitlab-ctl stop
在centos或linux中编辑文件: – /var/opt/gitlab/nginx/conf/gitlab-http.conf
改listen *:80;
到你想要的例如: – 90
然后
不要运行命令 – gitlab-ctl reconfigure
如果gitlab-ctl reconfigure
configuration默认configurationgitlab并删除更改。
所以只能运行gitlab-ctl start
在使用Centos 6软件包的Amazon Linux中,我必须configuration文件:
/opt/gitlab/embedded/cookbooks/gitlab/attributes/default.rb
然后做
gitlab-ctl reconfigure
命令最终得到端口的变化。
我在Debian Squeeze上使用Gitlab 7.5.3 omnibus 5.2.1 ci。 要更改nginx的默认端口,请将_gitlab_port_添加到/etc/gitlab/gitlab.rb :
我的/etc/gitlab/gitlab.rb :
external_url = 'gitlab.example.org' gitlab_rails['gitlab_port'] = 12345
更改端口后,您必须在命令行中调用gitlab-ctl reconfigure
和gitlab-ctl restart
。
使用Ubuntu 17.04和gitlab-ce 9.2.2,在本地networking上
这些步骤为我工作:
gitlab.rb
文件。 sudo nano /etc/gitlab/gitlab.rb
nginx['listen_port'] = 8181
sudo service apache2 stop sudo gitlab-ctl reconfigure
sudo service apache2 start
' http:// localhost:8181 '