openproject in a jail

Status
Not open for further replies.

lopr

Explorer
Joined
Mar 19, 2015
Messages
71
these are my notes I took while trying to get openproject running in a jail.
I dont have the time right now to make a tested howto but maybe it still helps others:

preparing some basic stuff

portmaster devel/rubygem-rake devel/ruby-gems www/node security/sudo

add user openproject with bash as shell

adduser

install openproject
su - openproject # if not already
cd ~
git clone https://github.com/opf/openproject-ce.git --branch stable/7 --depth 1
cd openproject-ce
sudo gem install bundler
sudo portmaster databases/rubygem-mysql2
graphics/py-wand
databases/memcached
www/npm
lang/phantomjs
# www/rubygem-webpack-rails deprecated, instead:
devel/rubygem-webpacker-rails5
www/rubygem-railties5 # this might not be needed

bundle exec rails webpacker:install

bundle install --deployment --without postgres sqlite development test therubyracer docker
npm install


take care, the database you use, has to be utf8 encoded
set the database in the yml file (take care of whitespaces)
cp config/database.yml.example config/database.yml

set email and memchached

cp config/configuration.yml.example config/configuration.yml
#add to the end of file
nano config/configuration.yml
rails_cache_store: :memcache


run those commands to create the database.

RAILS_ENV="production" ./bin/rake db:create
RAILS_ENV="production" ./bin/rake db:migrate
RAILS_ENV="production" ./bin/rake db:seed
RAILS_ENV="production" ./bin/rake assets:precompile


copy key to profile

[openproject@host] echo "export SECRET_KEY_BASE=$(./bin/rake secret)" >> ~/.profile
[openproject@host] source ~/.profile


install apache as root
portmaster www/apache24
ftp/curl
www/passenger
chmod o+x "/home/openproject"



nano /usr/local/etc/apache24/httpd.conf

passenger module
LoadModule passenger_module /usr/local/lib/ruby/gems/2.4/gems/passenger-5.1.12/buildout/apache2/mod$
<IfModule mod_passenger.c>
PassengerRoot /usr/local/lib/ruby/gems/2.4/gems/passenger-5.1.12
PassengerRuby /usr/local/bin/ruby24
</IfModule>
ServerAdmin email@domain.tld
ServerName 192.168.1.199:80 # here should be your jail ip
SetEnv EXECJS_RUNTIME Disabled
DocumentRoot "/home/openproject/openproject-ce/public"
<Directory "/home/openproject/openproject-ce/public">
Options +Indexes +FollowSymLinks -Multiviews
AllowOverride all
Require all granted
</Directory>


Activate background jobs
OpenProject sends (some) mails asynchronously by using background jobs. All such jobs are collected in a queue, so that a separate process can work on them. This means that we have to start the background worker. To automate this, we put the background worker into a cronjob.

[root@all] su - openproject -c "bash -l"
[openproject@all] crontab -e


Now, the crontab file opens in the standard editor. Add the following entry to the file:

*/1 * * * * cd /home/openproject/openproject-ce; /home/openproject/.rvm/gems/ruby-2.1.5/wrappers/rake jobs:workoff
This will start the worker job every minute.

this is the command that works for worker

bundle exec rake jobs:workoff RAILS_ENV=production

this is where my notes end :)
so try and open it in you browser.
maybe we can get this to a state where it is fit to be pushed to the ressource section
 
Status
Not open for further replies.
Top