Skip to content

Instantly share code, notes, and snippets.

@serweb-labs
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save serweb-labs/d865c592a39527163f32 to your computer and use it in GitHub Desktop.

Select an option

Save serweb-labs/d865c592a39527163f32 to your computer and use it in GitHub Desktop.
Gitlab and Apache working in Ubuntu 14.04

#Gitlab and Apache working in Ubuntu 14.04

-uncomment or add in /var/opt/gitlab/nginx/etc/gitlab-http.conf

server {
  listen *:81;
  server_name serweb-revolution;
  server_tokens off; ## Don't show the nginx version number, a security best practice
  root /opt/gitlab/embedded/service/gitlab-rails/public;

  ## Increase this if you want to upload large attachments
  ## Or if you want to accept large git objects over http
  client_max_body_size 250m;
    

  ## Individual nginx logs for this GitLab vhost
  access_log  /var/log/gitlab/nginx/gitlab_access.log;
  error_log   /var/log/gitlab/nginx/gitlab_error.log;

  location / {
    ## Serve static files from defined root folder.
    ## @gitlab is a named location for the upstream fallback, see below.
    try_files $uri $uri/index.html $uri.html @gitlab;
  }

#RESTART PC

#WORK IN APACHE

  • a2enmod proxy proxy_http proxy_connect
  • sudo nano /etc/apache2/sites-available/git.dev.conf
  • paste content of git.dev.conf
  • sudo a2ensite git.dev

#ACCESS IN BROWSER

  • Now create DNS records or to access local hosts file to add registration

sudo nano /etc/hosts

  • 127.0.0.1 misitio.dev

#RESTAR APACHE

  • sudo service apache2 restart

  • now access in git.dev un your browser

<VirtualHost *:80>
ServerName git.dev
# Custom log file locations
ErrorLog /var/log/apache2/gitlab_error.log
CustomLog /var/log/apache2/gitlab_access.log combined
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:81/
<Location />
ProxyPassReverse /
Order deny,allow
Allow from all
</Location>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment