Gitlab in a subdirectory with apache and passenger

后端 未结 5 1643
北荒
北荒 2021-02-02 17:39

I\'m attempting to set up gitlab so that it is accessible through a subdirectory of an existing apache server, example.com/gitlab, for example. I am trying to use p

5条回答
  •  再見小時候
    2021-02-02 18:22

    I did the following to get gitlab 6.2.2 available in a sub-directory with Apache and a LAMP environment:

    enable the following apache modules:

    sudo a2enmod proxy
    sudo a2enmod proxy_balancer
    sudo a2enmod proxy_http
    sudo a2enmod rewrite
    

    right from the documentation, do the following:

    # 1) In your application.rb file: config.relative_url_root = "/gitlab"
    # 2) In your gitlab.yml file: relative_url_root: /gitlab
    # 3) In your unicorn.rb: ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab"
    

    in /etc/apache2/mod-available/proxy.conf:

    ProxyRequests On
    ProxyPreserveHost on
    
      AddDefaultCharset off
      Order deny,allow
      Allow from all 
      AllowOverride All
    
    

    in /etc/apache2/apache2.conf:

    ProxyPass         /gitlab/ http://127.0.0.1:8080/gitlab/
    ProxyPassReverse  /gitlab/ http://127.0.0.1:8080/gitlab/
    ProxyPass         /gitlab http://127.0.0.1:8080/gitlab
    ProxyPassReverse  /gitlab http://127.0.0.1:8080/gitlab
    ProxyPass         /assets http://127.0.0.1:8080/gitlab/assets
    ProxyPassReverse  /assets http://127.0.0.1:8080/gitlab/assets
    

提交回复
热议问题