Ok, so I was looking for a self-hosted project management tool. Something that would fill the gap that the late (and discontinued?) DotProject left in my heart. After lots of Googlin’, I came across OpenProject. Though they offer hosting plans, you can host the tool for free on your own server. Installation looked like it had a bit too many steps for my own taste, but I went with it. Needless to say, if I’m writing this note-to-self, sh*t went south. Considering my overall stupidity regarding all-things-web, I found the installation process fairly convoluted (and apparently I’m not alone). The steps I took to get it working are sumarized below (which were compiled from quite a few different sources).
Rolling up the sleeves
A little context here – I’m installing OpenProject version 6 (latest stable release at the time of writing) on a VM running Ubuntu 14.04. Unfortunately, for other distros, YMMV. For many distros (Ubuntu included), there’s the possibility of going through with the packaged installation (e.g. via apt-get), but I ended up following the manual process. I’ll be referring to these instructions during this post. If the link breaks or changes in the future, get the PDF version (but these instructions will probably be worthless anyway):
Let’s start with the Prepare Your Environment part. I’ve totally skipped the groupadd
stuff, and installed everything under my regular user – do as you please. I installed all essentials and Memcached
as listed. I already had a working install of MySQL, so I skiped the Installation of MySQL part, including the database creation (which will happen automatically later on). I then followed the Installation of Ruby (via rbenv
)…
1 2 3 4 5 |
$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv $ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile $ echo 'eval "$(rbenv init -)"' >> ~/.profile && source ~/.profile $ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build $ rbenv install 2.3.0 && rbenv rehash && rbenv global 2.3.0 |
…and Installation of Node (via nodenv
, but using the 6.0.0 LTS version) as listed on the manual :
1 2 3 4 5 |
$ git clone https://github.com/OiNutter/nodenv.git ~/.nodenv $ echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.profile $ echo 'eval "$(nodenv init -)"' >> ~/.profile && source ~/.profile $ git clone git://github.com/OiNutter/node-build.git ~/.nodenv/plugins/node-build $ nodenv install 6.0.0 && nodenv rehash $$ nodenv global 6.0.0 |
Adding some swap and getting to it
I had trouble getting the rbenv install
to complete. It would get killed halfway through, in which seemed an insuficcient memory issue. Anticipating a future instruction from the manual, I’ve decided to try adding some swap space to my VM. As usual, DigitalOcean has a great documentation page on how to do this. Spoilers:
1 2 3 4 5 |
$ sudo fallocate 1G /swapfile # change swap size as necessary $ sudo chmod 600 /swapfile $ sudo mkswap /swapfile $ sudo swapon /swapfile $ echo "/swapfile none swap sw 0 0" | sudo tee --append /etc/fstab > /dev/null |
Ok, now fetch the relevant version of OpenProject – I’m going with the regular openproject
(not the Comunity Edition), version 6, and install it:
1 2 3 4 5 |
$ cd ~ $ git clone https://github.com/opf/openproject.git --branch stable/6 --depth 1 $ cd openproject && gem install bundler $ bundle install --deployment --without postgres sqlite development test therubyracer docker $ npm install |
Now run the Configure OpenProject and Finish the Installation of OpenProject as described in the instructions. After getting them done, you’ll have an openproject/public
folder that looks like this:
1 2 |
$ l openproject/public 404.html 422.html 500.html assets/ favicon.ico fonts/ info.php javascripts/ |
The lack of an index file looked super weird to me, but it’s supposed to be that way. Don’t panic.
Getting it to play nice with Apache
I started having some trouble in the Serve OpenProject with Apache section of the instructions. The compilation and installation of the passenger module worked nicely, and I could a2enmod passenger
with no trouble. However, the supplied VirtualHost configuration file didn’t cut it for me.
I wanted to have OpenProject accessible from martinvb.com/op
, and since my VM already serves my WordPress and Pydio, I couldn’t just move my DocumentRoot around. So I edited my configuration in /etc/apache2/sites-enabled/
as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
<VirtualHost *:80> # Current configurations ServerName www.martinvb.com DocumentRoot /var/www/html # ... # Configuration for OpenProject PassengerResolveSymlinksInDocumentRoot on Alias /op /home/myuser/openproject/public <Location /op> PassengerBaseURI /op PassengerAppRoot /home/myuser/openproject </Location> <Directory /home/myuser/openproject/public> AllowOverride all Require all granted Options +FollowSymLinks -MultiViews -Indexes Order allow,deny Allow from all </Directory> </VirtualHost> |
I kept my DocumentRoot where it was, and served OpenProject through an Alias. Setting the PassengerResolveSymliksInDocumentRoot is necessary here since Passenger won’t solve symlinks automatically for versions above 2.2.0 (which happens to be the case). Also, we have to point the PassengerAppRoot to where the app’s config.ru
is stored — in this case, the root of OpenProject’s cloned git repo.
Also, I’ve added rails_relative_url_root = "/op"
to the config/configuration.yml
created during the Configure OpenProject step, to match the folder alias I’ve created.
Reload Apache with a sudo service apache2 restart
and give it a go. Works on my machine.
’til next time.