How to set GitLab URL on Ubuntu?

I am new to GitLab. I installed dependencies, GitLab, and fixed firewall rules.
My gitlab.rb

http://gitlab.example.com
 letsencrypt['enable'] = nil
 letsencrypt['contact_emails'] = ['mymail@yahoo.co.uk']

But
Screenshot%20from%202019-11-22%2011-04-05
How should external_url look like?

Hi,

what’s your FQDN / DNS entry for the GitLab server? That needs to be configured as

external_url 'http://gitlab.yourdomain.com'

With then restarting GitLab.

Cheers,
Michael

Hi,

hostname --fqdn

mm-HP-EliteBook-8560p

Should I change it to
http://gitlab.mm-HP-EliteBook-8560p.com’ ?

Hi,

oh, so you are using a local install on your notebook. If mm-HP-EliteBook-8560p resolves to an IP address, set external_url to http://mm-HP-EliteBook-8560p - just like you would access it in your browser.

$ dig mm-HP-EliteBook-8560p

Is GitLab running on port 80 on your host?

Cheers,
Michael

Michael,

I tried what you suggested. But nginx show bad gateway.

My dig output

dig mm-HP-EliteBook-8560p

; <<>> DiG 9.11.3-1ubuntu1.11-Ubuntu <<>> mm-HP-EliteBook-8560p
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38788
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;mm-HP-EliteBook-8560p. IN A

;; ANSWER SECTION:
mm-HP-EliteBook-8560p. 0 IN A 127.0.1.1

;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Sat Nov 23 08:51:32 CET 2019
;; MSG SIZE rcvd: 66

Port
unicorn[‘port’] = 8081

In terms of 5XX errors, always check the web server log for further insights. Bad gateway would likely mean that some vhost config is targeting the wrong listeners in the backend.

gitlab-ctl check-config should also provides hints whether the config is correct.

Also, please share your full config e.g. with

grep "^[^#;]" /etc/gitlab/gitlab.rb

On a related note - I’d suggest installing GitLab in a dedicated VM or Docker container, and not directly on localhost. There you can take snapshots of working versions and don’t pollute your desktop environment. Also, it allows to assign DNS/FQDN better.

Cheers,
Michael

1 Like

Can you send me link on GitLab with Docker? Thanks.

Quick Google points to the docs :kissing_heart: There’s also an example how to bind a specific local IP address for accessing it.

Cheers,
Michael