Content
my install
Added by Craig Lockley almost 11 years ago
After days of trying different instructions / guides / google searches / forums etc., I have finally got a successful install for production site of OpenProject 3.0 on Ubuntu 12.04
For anyone that needs help, refer to this one but none of which could have been possible without the help of the OpenProject team and their input.
INSTRUCTIONS: Based on details instructions by ‘Installation of OpenProject on Ubuntu 12.04’ found under the Installation Guide for OpenProject 3.0
Installation Guide for Ubuntu 12.04
OpenProject running with Apache2 Phusion_Phassenger
Install Ubuntu 12.04 server instance
1.0 Install all necessary updates / upgrades
$ sudo apt-get update && sudo apt-get upgrade
1.1.0 Install Dependencies
$ sudo apt-get install git curl
1.1.1 Install Dependencies: Gems
$ sudo apt-get install build-essential libxslt-dev libxml2-dev libmysql-ruby libmysqlclient-dev libpq-dev libsqlite3-dev libyaml-0-2
1.1.2 Install Dependencies: Images
$ sudo apt-get install libmagickwand-dev libmagickcore-dev libmagickcore4-extra libgraphviz-dev libgvc5
1.1.3 Install Dependencies: MySQL
$ sudo apt-get install mysql-server
1.1.4 Install Dependencies: MemCached
$ sudo apt-get install memcached
1.1.5 Install Apache2
$ sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev libcurl4-openssl-dev
2.0.0 Create User \ Group openproject
$ sudo groupadd openproject
$ sudo useradd —create-home —gid openproject openproject
$ sudo passwd openproject
2.0.1 Switch to openproject user
$ su openproject -c ‘bash -l’
2.0.2 Switch to home directory
$ cd ~
2.1.0 Install RVM
$ \curl -L https://get.rvm.io | bash -s stable
$ source $HOME/.rvm/scripts/rvm
2.1.1 Install Ruby using RVM
$ rvm autolibs disable
$ rvm install 2.0.0
2.1.2 Install bundler using gem
$ gem install bundler
2.1.3 Install Rails | Phusion Passenger (freezes during documentation steps, so include arguments)
$ gem install rails —no-ri —no-rdoc
2.1.4
$ gem install passenger
2.2.0
$ passenger-install-apache2-module
2.2.1 Write everything down
It will now provide information used for loading the passenger module into apache which points to your ruby / rail stuff as well as what is required for your virtual host.
So please write this information down and do not rely on this instruction manual in case you happen to get a later version of passenger or 2.0.0 patch level.
3.0.0 Clone openproject repository
$ git clone https://github.com/opf/openproject.git
$ cd openproject
3.1.0 Run Bundler to install all gems
$ bundle install —without postgres rmagick
3.2.0 Configure yml files
$ cd config
3.2.1
$ cp database.yml.example database.yml
$ cp configuration.yml.example configuration.yml
3.2.2 Configuring the database.yml
3.2.3 Configuring the configuration.yml
edit: remove comment to enable memcached
rails_cache_store: :memcache
3.3.0
Should have the following: /home/openproject/openproject/config -> database.yml and configuration.yml
4.0.0 Configure database | config files
$ mysql -u root -p
CREATE DATABASE openproject CHARACTER SET utf8;
CREATE USER ‘openproject’'localhost' IDENTIFIED BY 'my_password'; GRANT ALL PRIVILEGES ON openproject.* TO 'openproject'
‘localhost’;
CREATE DATABASE openproject_development CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON openproject_development.* TO ‘openproject’@‘localhost’;
CREATE DATABASE openproject_test CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON openproject_test.* TO ‘openproject’@‘localhost’;
5.0.0 Run database migrations (it will tell you it already existed but I do it anyway)
$ bundle exec rake db:create:all
(All steps below are for production environment only)
5.1.0 Render secret token
$ RAILS_ENV=“production” bundle exec rake generate_secret_token
5.2.0 Run migrate and seed and can append db:seed to end of syntax - I prefer to do them separate but you can do them together
$ RAILS_ENV=“production” bundle exec rake db:migrate
5.2.1 Run Seed for production
$ RAILS_ENV=“production” bundle exec rake db:seed
5.3.0 Precompile everything for production site as this will reduce load times between requests to the server
$ RAILS_ENV=“production” bundle exec rake assets:precompile
5.4.0 Test it by running in development mode, access the site via http://ipaddress:3000 before wasting time loading into apache but will have to do previous steps 5.1.0 - 5.3.0 without the [RAILS_ENV=“production”]
$ bundle exec rails server
Load it up to test development site, should work. Ctrl+C to bring it down and begin apache/passenger configurations.
I found that development was wonky for me, production worked great.
6.0.0 Deploy into Apache using Passenger - require info from passenger setup
$ su (back to your default user)
6.0.1 Copy production.rb file when doing any changes
$ cp /home/openproject/openproject/config/environments/production.rb /home/openproject/openproject/config/environments/production.rb.backup
6.0.2 Access file for editing, i prefer VIM and change to directory or write full path if you are at root, other directory, etc.
$ sudo vi production.rb
edit: change from true to false, apache should have done so already
config.server_static_assets = false
6.1.0 Create the Passenger load file from information given from passenger install
$ sudo vi /etc/apache2/mods-available/passenger.load
edit:
LoadModule passenger_module /home/openproject/.rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so
6.1.1 Create the Passenger conf file from information given from install
$ sudo vi /etc/apache2/mods-available/passenger.conf
edit:
PassengerRoot /home/openproject/.rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.37
PassengerDefaultRuby /home/openproject/.rvm/gems/ruby-2.0.0-p353/wrappers/ruby
6.2.0 Enable necessary components on Apache - Mod and Site
$ sudo a2enmod passenger
6.2.1
create virtual host file in /etc/apache2/sites-available
$ sudo vi /etc/apache2/sites-available/openproject
edit:
<VirtualHost *:80>
ServerName www.example.ca:
DocumentRoot /home/openproject/openproject/public
RailsEnv production
<Directory /home/openproject/openproject/public>
AllowOverride all
Options -MultiViews
6.2.2 Enable openproject virtual host file
$ sudo a2ensite openproject
6.2.3 Disable default site
$ sudo a2dissite default
7.0.0 Browse to machine from local or another workstation depending on setup (I prefer another workstation)
http://X.X.X.X
login with default admin credentials:
admin
admin
check to make sure you are in production environment
Replies (4)
Hi Craig,
did you also create init script for openproject? I would like to start openproject on OS startup with apache.
Do you know how to figure out?
Thanks.
Karol
If you configure OpenProject to work with Apache, you will require Phusion Passenger to run the Ruby Web-Application (OpenProject) in Apache.
Once configured properly, Apache should load everything on startup as it will handle all the processes on the backend, including the starting Apache2 and Passenger-Module
If you wish to have an init script, I am no expert with Ubuntu so I can’t really help unless I put my time into trying it out myself.
Hey,
I followed your tutorial step by step but I’ve got an Error after installing Passenger & editing the config files:
apache2: Syntax error on line 227 of /etc/apache2/apache2.conf:
and serveral errors:
could anyone help me please :-/?
EDIT:
BTW: while I’m running the productive system I have a broken template. See attachment for details.
next edit:
I run the non-productive system. But this system got also Problems in the template: I cant use the drop-down menus for login / modules and Projects…. Holy c* what did I wrong :-/?
Hi Darth Vader
You get the mod_passenger.so not found error because you have installed passenger in a different location compared to what is on this tutorial. Update the paths to the passenger in /etc/apache2/mods-available/passenger.conf and /etc/apache2/mods-available/passenger.load to the location where you have installed passenger and try restarting apache2. A quick way to find the location of passenger would be to do:
sudo updatedb
locate mod_passenger.so
That should tell you where you can find mod_passenger.so and hence the location of passenger.
As for the broken UI, it is because you have set config.serve_static_assets = false in <openproject_install_location>/config/environments/production.rb. This setting is necessary if you are running OpenProject in production setting via Apache + Passenger, but breaks the UI if you have precompiled assets and starting the rails server manually. If you want to see the UI work when you start the rails server yourself then set config.serve_static_assets = true in <openproject_install_location>/config/environments/production.rb. But, make sure it is set to false when you get your Apache + Passenger setup going.