Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mod_passenger apache configuration for gitlab and sidekiq upstart script #106

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions apache/gitlab_passenger
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This site only works with mod_passenger 4.0x (use RVM or similar)
#
# In order for gitlab (5.2) to run with mod_passenger you only need to
# make sure that, sidekiq is running (see upstart script in init folder).
# mod_passenger will start gitlab more or less automatically.
#
# Documentation of mod_passenger:
# See: http://www.modrails.com/documentation/Users%20guide%20Apache.html

# Remove if you don't want to use SSL
<IfModule mod_ssl.c>

# Change to 80 if you want to access the site over HTTP
<VirtualHost *:443>
ServerAdmin root@localhost

ServerName git.example.com
# Mod_passenger needs to access the path
DocumentRoot /home/git/gitlab/public
<Directory /home/git/gitlab/public >
Allow from all
Options -MultiViews
</Directory>

# SSL, remove if you don't use SSL
SSLEngine on
SSLCertificateFile /etc/ssl/private/private.pem
SSLCertificateKeyFile /etc/ssl/private/private.pem
SSLCertificateChainFile /etc/ssl/private/private.pem

# Logging
ErrorLog /var/log/apache2/git.example.com_error.log
LogLevel warn
CustomLog /var/log/apache2/git.example.com_access.log combined

# Custom environment setup with RVM
SetEnv PATH /usr/local/rvm/gems/ruby-1.9.3-p429@gitlab/bin:/usr/local/rvm/gems/ruby-1.9.3-p429/bin:/usr/local/rvm/gems/ruby-1.9.3-p429@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p429/bin:/usr/local/rvm/bin:/usr/bin:/bin
SetEnv GEM_PATH /usr/local/rvm/gems/ruby-1.9.3-p429@gitlab:/usr/local/rvm/gems/ruby-1.9.3-p429@global
</VirtualHost>
</IfModule>
31 changes: 31 additions & 0 deletions init/gitlab-sidekiq.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# /etc/init/gitlab-sidekiq.conf - Sidekiq config for gitlab

# use the service command:
# sudo service gitlab-sidekiq {start,stop,restart,status}

description "Sidekiq Background Worker for Gitlab"

start on runlevel [2345]
stop on runlevel [!2345]

# change to match your deployment user
setuid git
setgid git

env HOME=/home/git
env PATH="/usr/local/rvm/gems/ruby-1.9.3-p429@gitlab/bin:/usr/local/rvm/gems/ruby-1.9.3-p429/bin:/usr/local/rvm/gems/ruby-1.9.3-p429@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p429/bin:/usr/local/rvm/bin:/usr/bin:/bin"
env GEM_PATH="/usr/local/rvm/gems/ruby-1.9.3-p429@gitlab:/usr/local/rvm/gems/ruby-1.9.3-p429@global"
env RAILS_ENV="production"
respawn
respawn limit 3 30

post-start script
cd /home/git/gitlab
exec bundle exec rake sidekiq:start
end script


post-stop script
cd /home/git/gitlab
exec bundle exec rake sidekiq:stop
end script