Follow those steps to install OpenProject on a fresh uberspace.
First we set-up all dependencies. We use ruby 2.2.5
and install gems in a user directory:
echo "gem: --user-install --no-rdoc --no-ri" > ~/.gemrc
cat <<'__EOF__' >> ~/.bash_profile
export PATH=/package/host/localhost/ruby-2.2.5/bin:$PATH
export PATH=$HOME/.gem/ruby/2.2.5/bin:$PATH
export PATH=/package/host/localhost/nodejs-6.9.1/bin:$PATH
export PATH=$HOME/bin:$PATH
export LANG=en_US.UTF-8
__EOF__
cat > ~/.npmrc <<__EOF__
prefix = $HOME
umask = 077
__EOF__
cat > ~/.bowerrc <<__EOF__
{
"interactive": false
}
__EOF__
source ~/.bash_profile
npm install -g [email protected]
Verify that ruby --version
gives you 2.2.5
.
Now it's time to install OpenProject:
mkdir apps; cd apps
git clone https://github.com/opf/openproject.git
cd openproject
git checkout -b stable origin/stable/6
cat > config/configuration.yml <<__EOF__
production:
email_delivery:
delivery_method: :sendmail
sendmail_settings:
location: /usr/sbin/sendmail
arguments: -i
rails_cache_store: :memcache
__EOF__
cp config/database.yml.example config/database.yml
Edit the config/database.yml
file to use your uberspace MySQL credentials. Copy the username and passwort from the ~/.my.cnf
file.
Name your databases beginning with your uberspace username followed by an underscore and any name you like. For example: tessi_openproject
if your uberspace account is "tessi".
Here is an example database.yml
file:
# please make sure to replace "tessi" with your uberspace account name
# and change your password - you find it on your uberspace in ~/.my.cnf
production:
adapter: mysql2
database: <your uberspace name>_openproject
host: localhost
username: <your uberspace name>
password: <secret>
encoding: utf8
development:
adapter: mysql2
database: <your uberspace name>_openproject
host: localhost
username: <your uberspace name>
password: <secret>
encoding: utf8
We continue with setting up ruby gems.
cat > Gemfile.local <<__EOF__
gem 'rails_12factor'
__EOF__
gem install bundler
bundle install --path ~/.gem --without postgres:sqlite:test
We generate a secret token, and create/prepare the database:
cat <<'__EOF__' >> ~/.bash_profile
export SECRET_KEY_BASE=$(RAILS_ENV=production rake secret)
__EOF__
source ~/.bash_profile
RAILS_ENV=production bundle exec rake generate_secret_token db:create db:migrate db:seed
.. and prepare and bundle the assets
npm install -g bower
npm install
RAILS_ENV=production bundle exec rake assets:precompile
Find a free port for your OpenProject installation. I use the port 61621 - you need to replace that number with your port in the following files. This is the port your OpenProject server will listen to. The uberspace-apache will redirect all requests to that port.
We set-up daemontools services for a web- and a worker-process. They will (re)start automatically in case the uberspace server needs to restart.
Initialize svc on your uberspace:
test -d ~/service || uberspace-setup-svscan
Create the start script for the web-process:
cat <<__EOF__ > ~/bin/openproject-web #!/bin/sh # This is needed to find gems installed with --user-install export HOME=$HOME # Include our profile to get Ruby 2.2.5 included in our PATH . \$HOME/.bash_profile # Get into the project directory and start the Rails server cd \$HOME/apps/openproject exec bundle exec unicorn --port 61621 --env production __EOF__ chmod +x ~/bin/openproject-web uberspace-setup-service openproject-web ~/bin/openproject-web
Create the start script for the worker-process:
cat <<__EOF__ > ~/bin/openproject-worker
#!/bin/sh
# This is needed to find gems installed with --user-install
export HOME=$HOME
# we're faster and use the right database in production
export RAILS_ENV=production
# Include our profile to get Ruby 2.2.5 included in our PATH
. \$HOME/.bash_profile
# Get into the project directory and start the Rails server
cd \$HOME/apps/openproject
exec bundle exec rake jobs:work
__EOF__
chmod +x ~/bin/openproject-worker
uberspace-setup-service openproject-worker ~/bin/openproject-worker
We will make your OpenProject installation public with a RewriteRule using a Proxy
cat > ~/html/.htaccess <<__EOF__ RewriteEngine On RewriteCond %{HTTPS} !=on RewriteCond %{ENV:HTTPS} !=on RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] RewriteRule (.*) http://localhost:61621/$1 [P] __EOF__
You're done. Open the URL of your uberspace and you should see an OpenProject page waiting for you. You can log in with username admin
and password admin
.
If something goes wrong, you find logs at the following places:
~/service/openproject-web/log/main/current
~/service/openproject-worker/log/main/current
You can restart your web-/worker-processes with:
svc -du ~/service/openproject-web
svc -du ~/service/openproject-worker
The -d
stands for "down". -u
for "up".
Consider reading https://www.openproject.org/download/manual-installation/.
Hello.
The installation with your receipt was unsuspicious. But when opening the URL of the uberspace i get nothing. Just errors in the log.