Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab 7.2.1 with Apache Server instead of Nginx

I have installed GitLab 7.2.1 with the .deb package from GitLab.org for Debian 7 on a virtual server where I have root access. On this virtual server I have already installed Apache, version 2.2.22 and I don't want to use Ngnix for GitLab.

Now I have no idea where the public folders of GitLab are or what I have to do or on what I have to pay attention.

So my question is: How do I have to configure my vhost for apache or what do I have to do also that I can use a subdomain like "gitlab.example.com" on my apache web server?

like image 419
Rinma Avatar asked Sep 11 '14 11:09

Rinma


1 Answers

With two things in mind:

  1. Unicorn is listening on 8080 (you can check this with sudo netstat -pant | grep unicorn)
  2. Your document root is /opt/gitlab/embedded/service/gitlab-rails/public

You can create a new vhost for gitlab in apache with the following configuration:

<VirtualHost *:80>
  ServerName gitlab.example.com
  ServerSignature Off

  ProxyPreserveHost On

  <Location />
    Order deny,allow
    Allow from all

    ProxyPassReverse http://127.0.0.1:8080
    ProxyPassReverse http://gitlab.example.com/
  </Location>

  RewriteEngine on
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]

  # needed for downloading attachments
  DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public

</VirtualHost>
like image 199
Bogdan T Avatar answered Oct 17 '22 17:10

Bogdan T