AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 585528
Accepted
Jason Sturges
Jason Sturges
Asked: 2014-03-31 16:36:51 +0800 CST2014-03-31 16:36:51 +0800 CST 2014-03-31 16:36:51 +0800 CST

设置gitlab外部web端口号

  • 772

如何将gitlab的默认端口80更改为自定义端口号?

我尝试过两种方法:

在 /etc/gitlab/gitlab.rb 中设置端口

external_port "8888"

然后运行重新配置:

gitlab-ctl reconfigure

在 /var/opt/gitlab/gitlab-rails/etc/gitlab.yml 中设置端口

production: &base
  #
  # 1. GitLab app settings
  # ==========================

  ## GitLab settings
  gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    host: gitlab.blitting.com
    port: 8888
    https: false

然后重启gitlab

gitlab-ctl stop
gitlab-ctl start

有了这两个,gitlab 继续在默认的 80 端口号上运行。

gitlab
  • 8 8 个回答
  • 161404 Views

8 个回答

  • Voted
  1. Best Answer
    Pritesh Patel
    2014-06-27T03:34:22+08:002014-06-27T03:34:22+08:00

    Chad Carbert 的回答仍然适用,但只想为 7.0.0 版添加额外内容。

    在您的文本编辑器中打开“/etc/gitlab/gitlab.rb”,目前我有external_url http://127.0.0.1/或类似的。我可能需要使用包含端口号的 dns 更改 external_url(例如' http://gitlab.com.local:81/ ')然后使用命令“sudo gitlab-ctl reconfigure”重新配置 Gitlab 现在正在端口 81 上工作。

    一步步:

    1. sudo -e /etc/gitlab/gitlab.rb
    2. 将external_url从更改yourdomain.com为yourdomain.com:9999
      9999-> 您希望它运行的端口
    3. sudo gitlab-ctl reconfigure
    • 82
  2. Rahul Jain
    2016-04-23T22:17:47+08:002016-04-23T22:17:47+08:00

    更改默认端口号的非常简单的方法

    gitlab-ctl stop
    

    在centos或linux中编辑文件:/var/opt/gitlab/nginx/conf/gitlab-http.conf
    更改listen *:80;为您想要的Ex:-90

    然后

    不要运行命令:gitlab-ctl reconfigure
    如果gitlab-ctl reconfigure它默认配置了 gitlab 并删除更改。

    所以只运行:gitlab-ctl start

    • 7
  3. Chad Carbert
    2014-04-10T07:21:25+08:002014-04-10T07:21:25+08:00

    我也有同样的问题。我gitlab.rb的位置与您不同,但确实通过 dpkg 在/opt您提到的路径上安装了它。

    如果您已经通过软件包安装了它,所有这些都是在该/opt目录中自包含的,那么您可能会发现在以下位置更改了端口:

    • /opt/gitlab/embedded/conf/nginx.conf
    • /opt/gitlab/embedded/cookbooks/gitlab/templates/default/nginx-gitlab-http.conf.erb

    问题 #6581:在 Ubuntu 12.04 上安装 .deb 包 - gitlab.yml 文件中的端口号被忽略

    • 6
  4. HexboY
    2017-06-06T06:40:41+08:002017-06-06T06:40:41+08:00

    在本地网络上使用 Ubuntu 17.04 和 gitlab-ce 9.2.2

    这些步骤对我有用:

    1. 编辑gitlab.rb文件。

    sudo nano /etc/gitlab/gitlab.rb

    1. 将您的可选监听端口添加到文件末尾。

    nginx['listen_port'] = 8181

    1. 如果需要,停止 apache,并重新配置 gitlab

    sudo service apache2 stop sudo gitlab-ctl reconfigure

    1. 如果停止,请启动 apache。

    sudo service apache2 start

    1. 完成,现在 gitlab 可以在您的 IP 地址上使用选定的端口。

    ' http://localhost:8181 '

    • 5
  5. icedwater
    2015-02-03T23:14:19+08:002015-02-03T23:14:19+08:00

    我的主要问题是新用户没有在系统发送的电子邮件中获得自定义端口号。否则,在地址栏中手动写入自定义端口会将用户引导至 Gitlab 安装。

    我在Ubuntu 14.04而不是 Omnibus上进行了此安装。所以不知何故我没有。(它存在于 中,但符号链接的目标没有以某种方式安装。如果我真的需要,我会单独修复它。)gitlab-ctl/usr/bin

    无论如何,我使用了第二种方法的变体,将正确的端口写入 /home/git/gitlab/config/gitlab.yml:

    production: &base
      #
      # 1. GitLab app settings
      # ==========================
    
      ## GitLab settings
      gitlab:
        ## Web server settings (note: host is the FQDN, do not include http://)
        host: my.gitlab.host.com
        port: 3722
    

    由于我没有gitlab-ctl,我使用service:

    sudo service gitlab restart
    

    这对我有用。我发送电子邮件的新用户收到了包含正确 URL 的链接。

    • 4
  6. Paco Zarate
    2014-11-11T10:31:49+08:002014-11-11T10:31:49+08:00

    在使用 Centos 6 包的 Amazon Linux 中,我必须配置文件:

    /opt/gitlab/embedded/cookbooks/gitlab/attributes/default.rb
    

    然后做

    gitlab-ctl reconfigure 
    

    命令最终获得端口更改。

    • 2
  7. lszrh
    2014-12-24T08:18:09+08:002014-12-24T08:18:09+08:00

    我在 Debian Squeeze 上使用 Gitlab 7.5.3 综合 5.2.1 ci。要更改 nginx 的默认端口,请将 _gitlab_port_ 添加到/etc/gitlab/gitlab.rb:

    我的/etc/gitlab/gitlab.rb:

    external_url = 'gitlab.example.org'
    gitlab_rails['gitlab_port'] = 12345
    

    更改端口后,您必须在命令行中调用gitlab-ctl reconfigure和gitlab-ctl restart。

    • 2
  8. Amintabar
    2019-08-08T06:00:53+08:002019-08-08T06:00:53+08:00

    您必须更改 Gitlab 配置文件中的external_url值。

    按着这些次序:

    1. 通过运行此命令编辑配置文件
    sudo nano /etc/gitlab/gitlab.rb
    
    1. 找到external_url并更改为您的 URL 和端口

    更改 external_url

    1. 退出并保存更改(ctrl + X)
    2. 运行此命令重新配置 Gitlab 本地服务器
    sudo gitlab-ctl reconfigure
    

    ? 如果你使用像 Nginx 这样的网络服务器,你必须在 Nginx 的配置中更改反向代理的外部端口。

    • 0

相关问题

  • 使用 GitLab,API 列表中缺少项目

  • 在现有 gitlab 中创建备份并在新的 gitlab 服务器中恢复相同备份的最佳方法是什么?[关闭]

  • 在 Debian 6.0.5 上安装 gitlab

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve