Skip to content

Commit 9833fc5

Browse files
committed
Use unicorn by default. Add info for puma use, implement #87
1 parent d874d1c commit 9833fc5

File tree

2 files changed

+38
-6
lines changed

2 files changed

+38
-6
lines changed

web-server/apache/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## CentOS notes
2+
3+
In CentOS the apache logs are under `/var/log/httpd` so you have to either replace
4+
`apache` with `httpd` in `gitlab.conf` or create the `/var/log/apache2` directory.
5+
6+
## Puma or unicorn
7+
8+
### unicorn
9+
10+
Make sure that `/home/git/gitlab/config/unicorn.rb` exists
11+
The default server is unicorn, so `gitlab.conf` is configured to listen on port `8080`.
12+
13+
### puma
14+
15+
Info taken from [PR #87](https://github.com/gitlabhq/gitlab-recipes/pull/87).
16+
17+
As apache's mod_proxy [doesn't support][sock] sockets, we have to configure the
18+
proxy URL to use tcp instead of unix sockets. First make sure that `/home/git/gitlab/config/puma.rb` exists.
19+
Then you have to make 2 changes:
20+
21+
1. In `gitlab.conf` replace `http://127.0.0.1:8080/ ` with `http://0.0.0.0:9292/`
22+
2. Edit `puma.rb`: comment out `bind 'tcp://0.0.0.0:9292'` and comment `bind "unix://#{application_path}/tmp/sockets/gitlab.socket"`
23+
24+
25+
[sock]: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

web-server/apache/gitlab renamed to web-server/apache/gitlab.conf

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Requires apache modules: mod_proxy and mod_proxy_http
22
# In Debian based distros enable with: sudo a2enmod mod_proxy mod_proxy_http
33
# Change ServerName to your fqdn
4+
#
5+
# You need to run openssl to generate a self-signed ssl certificate:
6+
# cd /etc/apache2 (or /etc/httpd)
7+
# sudo openssl req -new -x509 -nodes -days 3560 -out gitlab.crt -keyout gitlab.key
8+
# sudo chmod o-r gitlab.key
49

510
<VirtualHost *:80>
611
ServerName gitlab.example.com
@@ -14,8 +19,10 @@
1419

1520
ProxyPass /uploads !
1621
ProxyPass /error !
17-
ProxyPass / http://127.0.0.1:3000/
18-
ProxyPassReverse / http://127.0.0.1:3000/
22+
23+
# If you use puma, see https://github.com/gitlabhq/gitlab-recipes/blob/master/web-server/apache/README.md
24+
ProxyPass / http://127.0.0.1:8080/
25+
ProxyPassReverse / http://127.0.0.1:8080/
1926
ProxyPreserveHost On
2027

2128
CustomLog /var/log/apache2/gitlab/access.log combined
@@ -36,13 +43,13 @@
3643
ServerAdmin [email protected]
3744

3845
SSLEngine On
39-
SSLCertificateFile /etc/apache2/ssl/server.crt
40-
SSLCertificateKeyFile /etc/apache2/ssl/server.key
46+
SSLCertificateFile /etc/apache2/gitlab.crt
47+
SSLCertificateKeyFile /etc/apache2/gitlab.key
4148

4249
ProxyPass /uploads !
4350
ProxyPass /error !
44-
ProxyPass / http://127.0.0.1:3000/
45-
ProxyPassReverse / http://127.0.0.1:3000/
51+
ProxyPass / http://127.0.0.1:8080/
52+
ProxyPassReverse / http://127.0.0.1:8080/
4653
ProxyPreserveHost On
4754

4855
CustomLog /var/log/apache2/gitlab/access.log combined

0 commit comments

Comments
 (0)