Complete Guide to Install GitLab, Redmine (w. Backlogs), on a Plesk managed Debian server

Getting Started with the Server: Installation and SLL

The whole guide was tested for the fresh installation of Debian 7.8 Weezy managed by Plesk 12.

Grab your server, for example @ 1blu.de and get the OS installed:

Install Debian 7 with plesk 12For the szenario i have chosen for the installation, the GitLab will be installed on the main domain and you will need the ssl certificate to ensure clean so and i will call it „www.your.domain“. You could also make „gitlab.your.domain“, however you would need a wildcard certificate, which is a bit more expensive.

Grab the inclusive SSL certificate from 1blu and install it on your server. Dont forget to change the ip-adresses configuration and specify the freshly installed certificate on it.

Now you are ready to go.

GitLab

Credits go to this guide: http://blog.florentlim.com/how-to-install-gitlab-on-debian-7-wheezy-on-apache2-http-server/.

The only part which differs is, that we are going to configure MySQL and Apache via Plesk. So copy paste it and check the original guide if you have got more questions:

# do this before you have everything already installed 🙂
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install sudo -y

# install dependencies: here - for both gitlab and redmine
sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate python-docutils pkg-config cmake git-core libmysqlclient-dev
 
#get ruby
mkdir /tmp/ruby/
cd /tmp/ruby
wget --no-check-certificate https://ftp.ruby-lang.org/pub/ruby/ruby-2.1.2.tar.gz
tar -zxvf ruby-2.1.2.tar.gz
cd ruby-2.1.2/
./configure --disable-install-rdoc
make
sudo make install

#create user "git"
sudo adduser --disabled-login --gecos 'GitLab' git

# redis config
sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.orig
sed 's/^port .*/port 0/' /etc/redis/redis.conf.orig | sudo tee /etc/redis/redis.conf
echo 'unixsocket /var/run/redis/redis.sock' | sudo tee -a /etc/redis/redis.conf
sudo service redis-server restart
sudo usermod -aG redis git

# GitLab 
cd /home/git
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 7-3-stable gitlab
cd /home/git/gitlab
sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml
# Congigure it to your domain and to use ssl and https.
sudo -u git -H editor config/gitlab.yml
# Continue
sudo chown -R git log/
sudo chown -R git tmp/
sudo chmod -R u+rwX log/
sudo chmod -R u+rwX tmp/
 
# Create directory for satellites
sudo -u git -H mkdir /home/git/gitlab-satellites
sudo chmod u+rwx,g=rx,o-rwx /home/git/gitlab-satellites
 
# Make sure GitLab can write to the tmp/pids/ and tmp/sockets/ directories
sudo chmod -R u+rwX tmp/pids/
sudo chmod -R u+rwX tmp/sockets/
 
# Make sure GitLab can write to the public/uploads/ directory
sudo chmod -R u+rwX  public/uploads
 
# Copy the example Unicorn config
sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb
 
# Find number of cores
nproc
 
# Enable cluster mode if you expect to have a high load instance
# Ex. change amount of workers to 3 for 2GB RAM server
# Set the number of workers to at least the number of cores
sudo -u git -H editor config/unicorn.rb
 
# Copy the example Rack attack config
sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
 
# Configure Git global settings for git user, useful when editing via web
# Edit user.email according to what is set in gitlab.yml
sudo -u git -H git config --global user.name "GitLab"
sudo -u git -H git config --global user.email "example@example.com"
sudo -u git -H git config --global core.autocrlf input
 
# Configure Redis connection settings
sudo -u git -H cp config/resque.yml.example config/resque.yml
 
# Change the Redis socket path if you are not using the default Debian / Ubuntu configuration
sudo -u git -H editor config/resque.yml



 

apt-get install libmysqlclient-dev

wget --no-check-certificate https://ftp.ruby-lang.org/pub/ruby/ruby-2.1.2.tar.gz
tar -zxvf ruby-2.1.2.tar.gz

Some troubleshooting

Internal error on redmine e.g. on „My Account“ page

If you are getting internal errors on redmine like

Internal error

An error occurred on the page you were trying to access.
If you continue to experience problems please contact your Redmine administrator for assistance.

If you are the Redmine administrator, check your log files for details about the error.

Check that „www-data“ is being default user for installing and running redmine through passenger!

PassengerDefaultUser www-data

For further debuggind you will find the logs in /var/logs/apache2/

Another error: „repository in Redmine git 404“

http://askubuntu.com/questions/244406/how-do-i-give-www-data-user-to-a-folder-in-my-home-folder

http://www.redmine.org/boards/2/topics/40508?r=40582

chmod -R o=rx /home/git/repositories

chgrp www-data /home/myuser/folderA
chmod g+rwxs /home/myuser/folderA

If you are facing the following error after having done the step above:

(<unknown>): did not find expected key while parsing a block mapping at line 95 column 9
/usr/local/lib/ruby/2.1.0/psych.rb:370:in `parse'
/usr/local/lib/ruby/2.1.0/psych.rb:370:in `parse_stream'
/usr/local/lib/ruby/2.1.0/psych.rb:318:in `parse'
/usr/local/lib/ruby/2.1.0/psych.rb:245:in `load'
.......

Get the new gitlab yaml and doublecheck that you have removed only 1 (ONE) symbol (dash) in the redmine setting. Yaml parser is extremely sensible

Installing Backlogs

So ok, now we have got gitlab and redmine: the last thing we require now to go is: backlogs!

Here is the official installation guide for backlogs
http://www.redminebacklogs.net/en/installation.html

# let's go into redmine's plugin directory
cd /opt/redmine/current/plugins

# clone the repostitory:
git clone git://github.com/backlogs/redmine_backlogs.git

cd redmine_backlogs

git tag

git checkout v1.0.6

#dont forget to set rails env to production, otherwise it will take the development
RAILS_ENV=production
export RAILS_ENV

#now update some gems:
cd /opt/redmine/current/

#we should update nokogri to 1.6.5.:
# "bundl install" will be executed automatically so no more need to
bundle update nokogiri
# 
bundle exec rake db:migrate
 
# 
bundle exec rake tmp:cache:clear
bundle exec rake tmp:sessions:clear


Now preapre the trackers in the redmine: create a „Stories“ and a „Sasks“ tracker.  If you want you can modify the default one. And here we go:

# while being in the redmine directory:
bundle exec rake redmine:backlogs:install

# chose trackers in the installer and you are done!
#Installation complete. Please restart Redmine.
# Thank you for trying out Redmine Backlogs!

# make it safe: restart the whole server 
reboot

Congratulations – we are done!

 

https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/upgrader.md#5-upgrade-gitlab-shell

VN:F [1.9.22_1171]
Rating: 5.5/10 (2 votes cast)
VN:F [1.9.22_1171]
Rating: -1 (from 1 vote)
Complete Guide to Install GitLab, Redmine (w. Backlogs), on a Plesk managed Debian server, 5.5 out of 10 based on 2 ratings

Comments are closed.