Install GitLab on Subdomain

2019-03-29 11:08发布

问题:

I am trying to install GitLab on a subdomain. I am not very familiar with web servers and stuff, only very little knowledge. I am currently connected to the subdomain via ssh admin@mysite.com on the Mac's Terminal. Then I ls to the subdomain's folder. Question is if I execute:

curl -O https://downloads-packages.s3.amazonaws.com/centos-6.5/gitlab-7.4.3_omnibus.5.1.0.ci-1.el6.x86_64.rpm
sudo yum install openssh-server
sudo yum install postfix
sudo yum install cronie
sudo service postfix start
sudo chkconfig postfix on
sudo rpm -i gitlab-7.4.3_omnibus.5.1.0.ci-1.el6.x86_64.rpm

on the current folder. Will GitLab be installed or downloaded only in the current folder or will other subdomains and folders of the site be affected?

Is there a way to test yum install first on the current directory?

回答1:

The Omnibus/RPM version of Gitlab will install gitlab to the /opt/gitlab directory. If you want to check the files that will be installed by an RPM package you can do so with:

rpm -qlp gitlab-7.4.3_omnibus.5.1.0.ci-1.el6.x86_64.rpm

After you install the RPM with "rpm -ivh gitlab*.rpm" you configure the URL/subdomain using the:

/etc/gitlab/gitlab.rb 

file. After amending the gitlab.rb file you can start gitlab with:

gitlab-ctl start

Or restart it with:

gitlab-ctl restart

You can configure the web address & port that gitlab/nginx listens on using the external_url parameter in the gitlab.rb file:

external_url "https://gitlab.mydomain.com"

If you already have a webserver (such as Apache) using port 80 or port 443 then you might want to ask gitlab/nginx to listen on a port other than 80 or 443 with:

external_url "https://gitlab.mydomain.com:8443"

You can check if anything is listening on particular ports using:

netstat -luntap | grep LISTEN