|
|
@@ -1,10 +1,24 @@
|
1
|
1
|
---
|
2
|
2
|
layout: post
|
3
|
3
|
title: "Gitlab with apache2 and multiple websites"
|
|
4
|
+date: 2015-09-12 02:25:10
|
|
5
|
+last_modified_at: 2015-12-10 03:05:00
|
|
6
|
+excerpt: "How to configure Gitlab to use the Apache server instead of nginx"
|
|
7
|
+categories: Guides
|
|
8
|
+tags: Linux, Git
|
|
9
|
+image:
|
|
10
|
+ feature: apache-gitlab.jpg
|
|
11
|
+ topPosition: 0px
|
|
12
|
+bgContrast: dark
|
|
13
|
+bgGradientOpacity: darker
|
|
14
|
+syntaxHighlighter: yes
|
|
15
|
+published: true
|
4
|
16
|
---
|
5
|
17
|
|
6
|
18
|
|
7
|
|
-This tutorial assumes you have a Ubuntu 14.04 droplet on Digital Ocean. The idea is to first install the Gitlab Omnibus package, install apache and configure gitlab to use the installed apache server instead of its default nginx server.
|
|
19
|
+This tutorial assumes you have a Ubuntu 14.04 droplet on Digital Ocean with 2GB of RAM. If you use a smaller droplet with 1Gb of RAM, GitLab will run out of memory some times and crash. With a smaller droplet, it will simply not work.
|
|
20
|
+
|
|
21
|
+The idea is to first install the Gitlab Omnibus package, install apache and configure gitlab to use the installed apache server instead of its default nginx server.
|
8
|
22
|
|
9
|
23
|
## Gitlab Omnibus Install
|
10
|
24
|
|
|
|
@@ -58,7 +72,28 @@ Another cause for this problem may be two directives in the apache configuration
|
58
|
72
|
This command will show all lines that have the word "listen", including the port numbers. If there is more than one port 80 declaration in this file, remove one of them.
|
59
|
73
|
|
60
|
74
|
|
61
|
|
-## Configuring a website
|
|
75
|
+## Configuring apache virtual hosts for a new a website
|
|
76
|
+
|
|
77
|
+To configure a website domain with apache virtual hosts, duplicate the file ```/etc/apache2/sites-available/000-default.conf``` and rename it to something like ```example-website.com.conf```. Than change the files configurations:
|
|
78
|
+
|
|
79
|
+```
|
|
80
|
+<VirtualHost *:80>
|
|
81
|
+ ServerName example-website.com
|
|
82
|
+ ServerAdmin johndoe@gmail.com
|
|
83
|
+ DocumentRoot /var/www/example-website.com/public_html
|
|
84
|
+ ErrorLog ${APACHE_LOG_DIR}/error.log
|
|
85
|
+ CustomLog ${APACHE_LOG_DIR}/access.log combined
|
|
86
|
+</VirtualHost>
|
|
87
|
+```
|
|
88
|
+
|
|
89
|
+After creating the virtual host, add it to the enabled-sites and restart apache:
|
|
90
|
+
|
|
91
|
+```bash
|
|
92
|
+a2ensite example-website.com.conf
|
|
93
|
+apache2 restart
|
|
94
|
+```
|
|
95
|
+
|
|
96
|
+Don't forget to create a virtual host for your gitlab domain.
|
62
|
97
|
|
63
|
98
|
## Configuring gitlab to use apache2
|
64
|
99
|
|