skip to Main Content

I am pretty new in those server / cloud dev things.
So I rented a vServer and started playing around. First with nginx. I made my own config and all went well, getting the right html files on the right sub-/domains:

    server {
            listen 80;
            server_name beispiel.de;

            location / {
                    root /var/www/beispiel;
                    index index.html;
            }
    }
    server{
            listen 80;
            server_name gitlab.beispiel.de;

            location / {
                    root /var/www/beispiel/gitlab;
                    index index.html;
            }
    }

Then I wanted to run my own git repo via gitlab, and I installed it like shown this tutorial:
https://www.howtoforge.com/tutorial/how-to-install-gitlab-on-debian-8/#install-the-prerequisites

Gitlab is running smooth. But my problem is now, that it overlays all subdomains as well as the domain itself. My config I wrote earlier seems skipped by some kind of second nginx, installed with gitlab.

I tried to stop it by service nginx stop but as I tried to service nginx start again this was the response:

Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.

So I htop-ed and saw that nginx processes where still runnung. I killed them, but they always autostarted again.

systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: failed (Result: exit-code) since Tue 2019-12-17 14:58:43 CET; 3min 48s ago
Process: 13257 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile 
/run/nginx.pid (code=exited, status=0/SUCCESS)
Process: 1539 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, 
status=1/FAILURE)
Process: 1537 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, 
status=0/SUCCESS)
Main PID: 13321 (code=exited, status=0/SUCCESS)

Dec 17 14:58:40 v2201912109976104637.goodsrv.de nginx[1539]: nginx: [emerg] bind() to 0.0.0.0:80 
failed (98: Address already...use)
Dec 17 14:58:41 v2201912109976104637.goodsrv.de nginx[1539]: nginx: [emerg] bind() to 0.0.0.0:80 
failed (98: Address already...use)
Dec 17 14:58:41 v2201912109976104637.goodsrv.de nginx[1539]: nginx: [emerg] bind() to 0.0.0.0:80 
failed (98: Address already...use)
Dec 17 14:58:42 v2201912109976104637.goodsrv.de nginx[1539]: nginx: [emerg] bind() to 0.0.0.0:80 
failed (98: Address already...use)
Dec 17 14:58:42 v2201912109976104637.goodsrv.de nginx[1539]: nginx: [emerg] bind() to 0.0.0.0:80 
failed (98: Address already...use)
Dec 17 14:58:43 v2201912109976104637.goodsrv.de nginx[1539]: nginx: [emerg] still could not bind()
Dec 17 14:58:43 v2201912109976104637.goodsrv.de systemd[1]: nginx.service: control process exited, 
code=exited status=1
Dec 17 14:58:43 v2201912109976104637.goodsrv.de systemd[1]: Failed to start A high performance web 
server and a reverse pro...rver.
Dec 17 14:58:43 v2201912109976104637.goodsrv.de systemd[1]: Unit nginx.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

I don’t know what to do.
Can anyone help?

Kindly,
a noob 🙂

2

Answers


  1. Chosen as BEST ANSWER

    After hours of googling and trying I stumbled about this link in gitlab.rb file: https://docs.gitlab.com/omnibus/settings/nginx.html#using-a-non-bundled-web-server

    It explains how to use the by your own installed nginx web server instead. This solved my problem.


  2. From the error logs, it looks that Old Nginx process is already using the 80 port.

    Try /etc/init.d/nginx stop or systemctl stop nginx or /usr/sbin/nginx -s stop to stop old process.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search