Installing GitLab CE on Ubuntu Server 14.04 with apache2 and MySQL managed by Plesk

Hi,
at the weekend I tried to install GitLab CE on my server. As mentioned in the title my system is based on Ubuntu Server 14.04 with an apache2 Webserver and a MySQL backend managed by Plesk. So, my first problem is: I followed the documentation and installed gitlab/gitlab-ci/workhorse under /home/git/gitlab. But my vhosts configs are generated every time I change something in Plesk. And for Plesk the sub domain for GitLab is placed under the physical DocumentRoot from the main domain. I can temporarily change the vhost config to point to /home/git/gitlab/public and then never edit the config again. That´s one way, but not the best in my opinion. So, please help me out. The system also depends on apache2 and MySQL, because Plesk need it (also my own web projects). I followed also the instructions from the inofficial guide to install GitLab on apache2.
The next problem was, that I could only get Ruby 1.9 from the official server hoster repos. So, I needed to install rbenv and get the needed Ruby 2.1.8 version. This is needed by some gem plugins that uses GitLab. Everything looks fine, GitLab and other daemons are running. But: I do not see the web page itself. I am only able to receive the favicon…
After 10 hours struggling to get a working Ruby version and to search for failure solutions on the internet I have given it up. But I wrote down every single comand, that I typed in. You can see it below.
First here are the errors from the apache2 error_log:
[Sun Apr 24 14:05:39.357935 2016] [proxy:error] [pid 3572] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8181 (*) failed
[Sun Apr 24 14:05:39.357980 2016] [proxy_http:error] [pid 3572] [client 5.10.2.6:50626] AH01114: HTTP: failed to make connection to backend: 127.0.0.1
And here the commands:
# as root:
apt-get install build-essential libicu-dev cmake nodejs

# as user git:
cd /home/git
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
echo 'eval "$(rbenv init -)"' >> ~/.profile
rbenv install 2.1.8
rbenv global 2.1.8
gem update --system
gem install bundler --no-ri --no-rdoc
gem install RedCloth -v '4.2.9'
gem install allocations -v '1.0.4'
gem install charlock_holmes -v '0.7.3'
gem install rugged -v '0.24.0'

# as root:
cd
curl -O --progress https://storage.googleapis.com/golang/go1.5.3.linux-amd64.tar.gz
echo '43afe0c5017e502630b1aea4d44b8a7f059bf60d7f29dfd58db454d4e4e0ae53  go1.5.3.linux-amd64.tar.gz' | shasum -a256 -c - && \
  sudo tar -C /usr/local -xzf go1.5.3.linux-amd64.tar.gz
sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/
rm go1.5.3.linux-amd64.tar.gz
apt-get install redis-server
cp /etc/redis/redis.conf /etc/redis/redis.conf.orig
# Disable Redis listening on TCP by setting 'port' to 0
sed 's/^port .*/port 0/' /etc/redis/redis.conf.orig | sudo tee /etc/redis/redis.conf

# Enable Redis socket for default Debian / Ubuntu path
echo 'unixsocket /var/run/redis/redis.sock' | sudo tee -a /etc/redis/redis.conf

# Grant permission to the socket to all members of the redis group
echo 'unixsocketperm 770' | sudo tee -a /etc/redis/redis.conf

# Create the directory which contains the socket
mkdir /var/run/redis
chown redis:redis /var/run/redis
chmod 755 /var/run/redis

# Persist the directory which contains the socket, if applicable
if [ -d /etc/tmpfiles.d ]; then
  echo 'd  /var/run/redis  0755  redis  redis  10d  -' | sudo tee -a /etc/tmpfiles.d/redis.conf
fi

# Activate the changes to redis.conf
service redis-server restart

# Add git to the redis group
usermod -aG redis git

# as user git:
cd /home/git/gitlab
bundle install -j4 --deployment --without development test postgres aws kerberos
sudo mkdir /gitl-repo
sudo chown -R git:git /gitl-repo/
bundle exec rake gitlab:shell:install REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=production
cd /home/git
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-workhorse.git
cd gitlab-workhorse
sudo -u git -H git checkout v0.7.1
sudo -u git -H make
cd /home/git/gitlab
bundle exec rake gitlab:setup RAILS_ENV=production
sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
sudo update-rc.d gitlab defaults 21
cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
bundle exec rake assets:precompile RAILS_ENV=production

# as root:
gem install passenger
cp -R /home/git/gitlab /var/www/vhosts/anydomain/anysubdomain/gitlab
cp -R /home/git/gitlab-satellites/ /var/www/vhosts/anydomain/anysubdomain/gitlab-satellites
cp -R /home/git/gitlab-workhorse/ /var/www/vhosts/anydomain/anysubdomain/gitlab-workhorse

# copy this into the apache config:
   LoadModule passenger_module /root/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/passenger-5.0.27/buildout/apache2/mod_passenger.so
   <IfModule mod_passenger.c>
     PassengerRoot /root/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/passenger-5.0.27
     PassengerDefaultRuby /root/.rbenv/versions/2.1.8/bin/ruby
   </IfModule>
ufw allow 8181
a2enmod proxy proxy_balancer proxy_http

Any help would be great! :slight_smile:

A simple solution for your vhost problem is, that you can add a custom vhost.conf file containing your documentroot directive.
this information will overwrite the system settings of plesk.
this way you can point a subdomain to the directory of gitlab.

we are doing the same with otrs.

You need just the folder “conf” in your webroot.
there you put a mygitlab.conf file into it.

this wont get lost.