Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

http://frank19900731.github.io/ebook/openproject/download/manual-installation/index.html

https://docs.openproject.org/installation-and-operations/installation/manual/

https://community.openproject.com/topics/1308

Pre-Reqs:

apt-get install -y git curl zlib1g-dev build-essential libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libpq-dev libxml2-dev libxslt1-dev  software-properties-common memcached libgdbm-dev libncurses5-dev automake libtool bison libffi-dev libffi6 mysql-server mysql-client python python-pip libssl1.0-dev libgmp-dev npm apache2  apache2-dev libapr1-dev libaprutil1-dev nodeenv
apt-get install -y libcurl4-gnutls-dev 
apt-get install -y libcurl4-openssl-dev 
apt-get install -y libmysqlclient-dev 

Add OpenProject dedicated user:

groupadd openproject
useradd --create-home --gid openproject openproject
passwd openproject

Configure MySQL:

mysql_secure_installation
mysql -u root -p
CREATE DATABASE openproject CHARACTER SET utf8;
CREATE USER 'openproject'@'localhost' IDENTIFIED BY 'openproject';
GRANT ALL PRIVILEGES ON openproject.* TO 'openproject'@'localhost';
GRANT ALL PRIVILEGES ON openproject_development.* TO 'openproject'@'localhost';
GRANT ALL PRIVILEGES ON openproject_test.* TO 'openproject'@'localhost';
\q

Ruby Installation:

https://linuxize.com/post/how-to-install-ruby-on-ubuntu-18-04/

#Don't install via APT

#I sometimes had to add OpenProject to sudoers without PWD Prompt (openproject ALL=(ALL) NOPASSWD:ALL), then remove after setup.

su openproject -c "bash -l"
cd ~
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
#gpg --keyserver keys.gnupg.net --keyserver-options http-proxy="http://url:port" --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
#\curl -sSL https://get.rvm.io | bash -s stable
\curl -sSL https://get.rvm.io | bash -s stable --ruby
source $HOME/.rvm/scripts/rvm
rvm install 2.5  --autolibs=disable
rvm use --default 2.5
gem install bundler -v 1.17.3
gem install nokogiri #-v '1.8.5'
gem install mysql2 #-v '0.5.1'

Node.JS Installation:

su openproject -c "bash -l"
cd ~
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 8.12.0
nodenv rehash
nodenv global 8.12.0
#nodeenv nodeenv
#source ./nodeenv/bin/activate
#npm -g install bower

Install OpenProject:

su openproject -c "bash -l"
cd ~
#https://github.com/opf/openproject/releases
git clone https://github.com/opf/openproject.git
cd openproject/
git checkout 9e59f75
bundle install
#Make Sure you have "source ~/.profile"
#npm config set cafile /etc/ssl/certs/ca-certificates.crt
#git config --global url."https://github.com/".insteadOf git@github.com:
#git config --global url."https://".insteadOf git://
npm install
cat << 'EOL' >~/openproject/config/database.yml
production:
  adapter: mysql2
  database: openproject
  host: 127.0.0.1
  username: openproject
  password: openproject
  encoding: utf8mb4

development:
  adapter: mysql2
  database: openproject
  host: 127.0.0.1
  username: openproject
  password: openproject
  encoding: utf8mb4
EOL
cd ~/openproject/
bundle exec rake db:create:all
bundle exec rake generate_secret_token
echo "export SECRET_KEY_BASE=$(./bin/rake secret)" >> ~/.profile
RAILS_ENV="production" bundle exec rake db:migrate
RAILS_ENV="production" bundle exec rake db:seed
RAILS_ENV="production" bundle exec rake assets:precompile

Exit back to Root Shell!

apt-get install -y apache2 libcurl4-gnutls-dev apache2-dev libapr1-dev libaprutil1-dev
apt-get install -y libcurl4-openssl-dev 
apt-get install -y libcurl4-gnutls-dev
apt-get install -y libcurl4-gnutls-dev libmysqlclient-dev apache2  apache2-dev libapr1-dev libaprutil1-dev
chmod o+x "/home/openproject"
su openproject -c "bash -l"
cd ~/openproject
gem install passenger
passenger-install-apache2-module

Note: Follow the instructions passenger provides. The passenger installer will ask you the question in “Which languages are you interested in?”. We are interested only in ruby.

Exit back to Root Shell!

Note: .rbenv or .rvm

cat << 'EOL' >/etc/apache2/mods-available/passenger.load
#LoadModule passenger_module /home/openproject/.rbenv/versions/*/lib/ruby/gems/*/gems/passenger-*/buildout/apache2/mod_passenger.so
LoadModule passenger_module /home/openproject/.rvm/gems/ruby-*/gems/passenger-*/buildout/apache2/mod_passenger.so
EOL
cat << 'EOL' >/etc/apache2/mods-available/passenger.conf 
 <IfModule mod_passenger.c>
     PassengerRoot /home/openproject/.rbenv/versions/*/lib/ruby/gems/*/gems/passenger-*
     PassengerDefaultRuby /home/openproject/.rbenv/versions/*/bin/ruby
 </IfModule>
EOL
####OR#####
cat << 'EOL' >/etc/apache2/mods-available/passenger.conf 
   <IfModule mod_passenger.c>
     PassengerRoot /home/openproject/.rvm/gems/ruby-2.5.5/gems/passenger-6.0.4
     PassengerDefaultRuby /home/openproject/.rvm/gems/ruby-2.5.5/wrappers/ruby
 </IfModule>
EOL
a2enmod passenger
cat << 'EOL' >/etc/apache2/sites-available/openproject.conf
SetEnv EXECJS_RUNTIME Disabled
<VirtualHost *:80>
   ServerName yourdomain.com
   # !!! Be sure to point DocumentRoot to 'public'!
   DocumentRoot /home/openproject/openproject/public
   <Directory /home/openproject/openproject/public>
      # This relaxes Apache security settings.
      AllowOverride all
      # MultiViews must be turned off.
      Options -MultiViews
      # Uncomment this if you're on Apache >= 2.4:
      Require all granted
   </Directory>
</VirtualHost>
EOL
a2dissite 000-default
a2ensite openproject
service apache2 stop
service apache2 start
systemctl status apache2
systemctl restart apache2 ; systemctl status apache2


Note: Login is admin/admin

  • No labels