How to Change Port Gitlab on Centos 6

Changing the default Gitlab port

Issue here: https://gitlab.com/gitlab-org/gitlab-ce/issues/20131
Workaround:
add this line to /etc/gitlab/gitlab.rb:

nginx['proxy_set_headers'] = { "X-Forward-Port" => "8080", "Host" => "<hostname>:8080" }

replace port and hostname with your values, then as root or with sudo:

gitlab-ctl reconfigure
gitlab-ctl restart

It helps me on Debian 8.5, gitlab-ce from gitlab repo.

Gitlab on port 8080

Most likely you have another service listening on 8080, I think the omnibus install have some service hooking 8080 - just use 8081 instead.

Edit: I just did a quick search and found that it's the unicorn server that is listening to 8080 with the original omnibus installer.

Note: You will only need to change the external_url in gitlab.rb, no other config file should have to be edited for this.

Edit#2: As @emeraldjava stated there is an option in the configuration file for using another unicorn port: #unicorn['port'] = '8080'

Gitlab with non-standard SSH port (on VM with Iptable forwarding)

if you configure the ssh_port correctly in config/gitlab.yml, the webpages will show the correct repo url.

## GitLab Shell settings
gitlab_shell:
...
# If you use non-standard ssh port you need to specify it
ssh_port: 766

ps.
the correct url is:
ssh://git@git.domain.com:766/group/project.git

edit: after the change you need to clear caches, etc:

bundle exec rake cache:clear assets:clean assets:precompile RAILS_ENV=production

How do we change the URL of a working GitLab install?

You did everything correctly!

You might also change the email configuration, depending on if the email server is also the same server. The email configuration is in gitlab.yml for the mails sent by GitLab and also the admin-email.

How to install GitLab on CentOS 6 running WHM?

What I eventually did was skip the installation of postfix. I skipped it like so:

sudo yum install --skip-broken curl openssh-server openssh-clients postfix cronie

Then I edited the gitlab.rb config file using something like nano:

nano /etc/gitlab/gitlab.rb

and changed the external_url' and added to it a random unused port number:

external_url 'http://example.com:8443/'

then run

sudo gitlab-ctl reconfigure

for the change to take effect.

Voila it works.

Git on custom SSH port

git clone ssh://git@mydomain.example:[port]/gitolite-admin

Note that the port number should be there without the square brackets: []



Related Topics



Leave a reply



Submit