GitLab on ISPConfig

Discussion in 'General' started by teves, Feb 9, 2015.

  1. teves

    teves Member

    Hello,

    I have been trying to install GitLab on an ISPConfig server (version 3.0.5.4p5 on Debian Wheezy), but I don't get it to work.

    The main problem seems to be that GitLab needs nginx, while the server uses Apache. I wish to keep Apache and it seems there is a way to tell GitLab to use it instead, but any tip I found on the web does not seem to help.
    The standard configuration will stop apache from working, so I have to reconfigure, but I don't know how.

    my /etc/gitlab/gitlab.rb looks like that:
    Code:
    nginx['enable'] = false
    web_server['external_users'] = ['www-data']
    external_port "8888"
    but it does not seem to change anything.

    As I could not find any howto for this anywhere, could someone please explain how to
    - properly install GitLab on ans ISPConfig environment (ideally without breaking anything)
    - configure GitLab to work with Apache instead of nginx
    - configure a web or alias to point on the gitlab installation

    Thank you very much!
    Regards, Tom
     
  2. [FFW] Patric

    [FFW] Patric New Member

    Hi teves,
    you need to use this options for GitLab in /etc/gitlab/gitlab.rb
    Code:
    external_url "http://gitlab.example.com"
    gitlab_rails['gitlab_host'] = "gitlab.example.com"
    gitlab_rails['gitlab_email_from'] = "[email protected]"
    web_server['external_users'] = ['www-data']
    nginx['enable'] = false
    Then you can use this vhost config: https://gitlab.com/gitlab-org/gitlab-recipes/blob/master/web-server/apache/gitlab.conf
    If you wan't to use ssl you can use this: https://gitlab.com/gitlab-org/gitlab-recipes/blob/master/web-server/apache/gitlab-ssl.conf
    and set/change this in your gitlab.rb
    Code:
    external_url "https://gitlab.example.com"
    gitlab_rails['gitlab_https'] = true
    The vhost config is need to be placed on /etc/apache2/sites-available and must be activated with a2ensite.

    After a change of your gitlab.rb you need to use the command sudo gitlab-ctl reconfigure to apply the changes with GitLabs Cookbook.
     
    teves likes this.
  3. teves

    teves Member

    Hi Patric,

    thank you very much for your help.
    I think I am getting close... I chose the SSL flavor and followed your howto.
    Still, it is not working, because I cannot make gitlab listen on a different port. The standard 8080 is used by the ISPConfig GUI.
    I tried:
    Code:
    external_url "http://gitlab.example.com:8888"
    external_port 8888
    
    Whe I execute gitlab-ctl reconfigure, the configuration above seems to take effect, for the output contains the following lines:
    Code:
               gitlab:
                 ## Web server settings (note: host is the FQDN, do not include http://)
                 host: gitlab.example.com
            -    port: 443
            +    port: 8888
                 https: true
    
    I also changed the two occurrences of 8080 to 8888 in the vhost configuration.

    The apache error.log tells me:
    Code:
    [error] (111)Connection refused: proxy: HTTP: attempt to connect to 127.0.0.1:8181 (*) failed
    whenever I try to access the github page.

    Do you have any idea what I might be missing?

    Thank you!
     
  4. [FFW] Patric

    [FFW] Patric New Member

    Don't change the external addresses. This address is port 80 over the apache.

    Change the port of the unicorn server with unicorn['port'] = "3001" and make the api listen on the same with gitlab_url = "http://127.0.0.1:3001" and gitlab_rails['internal_api_url'] = "http://localhost:3001"
    Use Port 3001 in your apache config too (or an other port ;) )

    example:
    Code:
    gitlab_url = "http://127.0.0.1:3001"
    external_url "https://gitlab.example.com"
    
    gitlab_rails['gitlab_host'] = "gitlab.example.com"
    gitlab_rails['gitlab_https'] = true
    gitlab_rails['gitlab_email_from'] = "[email protected]"
    gitlab_rails['internal_api_url'] = "http://localhost:3001"
    
    web_server['external_users'] = ['www-data']
    
    unicorn['port'] = "3001"
    nginx['enable'] = false
     
    Last edited: Feb 11, 2015
    teves likes this.
  5. teves

    teves Member

    Hi Patric,

    great! Thank you very much, it is working now.

    Regards, Tom
     
  6. teves

    teves Member

    Hello,

    well... perhaps I have been too optimistic.
    Alas, not everything is working as expected; the worst issue is that I cannot commit into repositories.

    Basically, everything seems to work. The gitlab gui is working perfectly; I can create users and projects and everything.
    When I do a commit to a project, everything seem normal on the client side (Windows 7 and TortoiseGit). But there is no effect on the server; the repository is not updated and the gui keeps showing 0MB for the project. I can not commit again, for no change are detected. But when I try to checkout into another directory, there are no files in it.

    I also noticed there is a problem with creating avatar images. The gui does not show uploaded images; the file is uploaded correctly though; I found it in /var/opt/gitlab/gitlab-rails/uploads/user/avatar/1/ and the image file is healthy.
    I only mention that because it might be an effect of the same problem. Could this be a problem concerning the privileges?
    Which logfile could possibly show what is going wrong here?

    Thank you very much,
    regards, Tom
     
  7. [FFW] Patric

    [FFW] Patric New Member

    Hi,
    the avatar problem is a file permission problem. It's important to set the user of your web server in web_server['external_users'].
    Verify the access with this user to /var/opt/gitlab/gitlab-rails/uploads/user/avatar after the reconfigure with cookbook.

    Please make a commit via the bash/gitbash. Is the commit successfully on the client? Note: You must crate an branch like master etc. (first commit -> push to a new branch). A normal commit will not work when no branch exists.
     
    teves likes this.
  8. teves

    teves Member

    Hi Patric,

    thank you very much! You were right; I had not created a master branch. :rolleyes:

    The missing avatar though is not a file permission problem, as I found out now; the solution is to change the property
    Code:
    config.serve_static_assets = false
    to
    Code:
    config.serve_static_assets = true
    in the file
    /opt/gitlab/embedded/service/gitlab-rails/config/environments/production.rb

    and restart gitlab with
    Code:
     gitlab-ctl restart
    After that all avatars are shown.

    Anyway, thank you very much for your kind help!
    Regards, Tom
     
  9. [FFW] Patric

    [FFW] Patric New Member

    You're welcome :)

    PS: In my production.rb is this variable false and all things are working fine... o_O GitLab is a mystic software :D
     
  10. Ark74

    Ark74 New Member

    Could you share your steps/guide to install GitLab, does your installation is done under a clientX:webX form that default ISPConfig work?
    I see that you used www-data, which tells me you might not.
    Would that be the "ISP Config" way or on the other hand your just using the same host/machine that ISPConfig is using for GItLab?
     
    Miscni likes this.
  11. Miscni

    Miscni New Member

    I am also very interested to know, how that is accomplish
     

Share This Page