bash 在子域上安装 GitLab
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27012226/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Install GitLab on Subdomain
提问by SleepNot
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 [email protected]
on the Mac's Terminal. Then I ls
to the subdomain's folder. Question is if I execute:
我正在尝试在子域上安装 GitLab。我对网络服务器和东西不是很熟悉,只有很少的知识。我目前通过ssh [email protected]
Mac 的终端连接到子域。然后我ls
到子域的文件夹。问题是我是否执行:
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?
在当前文件夹上。GitLab 会只在当前文件夹中安装或下载,还是会影响站点的其他子域和文件夹?
Is there a way to test yum install
first on the current directory?
有没有办法yum install
先在当前目录上测试?
回答by jonny
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:
Omnibus/RPM 版本的 Gitlab 会将 gitlab 安装到 /opt/gitlab 目录。如果您想检查将由 RPM 包安装的文件,您可以这样做:
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:
使用“rpm -ivh gitlab*.rpm”安装 RPM 后,您可以使用以下命令配置 URL/子域:
/etc/gitlab/gitlab.rb
file. After amending the gitlab.rb file you can start gitlab with:
文件。修改 gitlab.rb 文件后,您可以使用以下命令启动 gitlab:
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:
您可以使用 gitlab.rb 文件中的 external_url 参数配置 gitlab/nginx 侦听的网址和端口:
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:
如果您已经有一个使用端口 80 或端口 443 的网络服务器(例如 Apache),那么您可能需要使用以下命令让 gitlab/nginx 侦听 80 或 443 以外的端口:
external_url "https://gitlab.mydomain.com:8443"
You can check if anything is listening on particular ports using:
您可以使用以下方法检查是否有任何内容正在侦听特定端口:
netstat -luntap | grep LISTEN