Content
Tutorial: Installation on Centos 65 x64 with Apache and MySQL
Added by I. V. over 10 years ago
Introduction
NOTE: This was tutorial for OpenProject version 3.x !
This installation guide is based on the tutorial written by Karol Skolar with adaptation/changes for MySQL DB:
https://www.openproject.org/topics/576?r=633
https://www.openproject.org/projects/openproject/wiki/Installation_on_Centos_65_x64_with_Apache_and_PostgreSQL_93
I have tried to make this tutorial as much as close to the one for PostgreSQL, so one day we can merge the two tutorials with different sections for MySQL and PostgreSQL.
Dear OP team, please consider including this guide in the list of possible installation guides. Feel free to propose/introduce any changes.
Assumptions
- CentOS install: Installed standard (Desktop) install option (this is not critical, since all dependencies will be installed if necessary)
- SELINUX and iptables are disabled (I am not using SELINUX and iptables on my internal hosts)
- Some of the installed packages might not be necessary, but I have included them so that this tutorial is almost the same as one for PostgreSQL
Different steps from Installation_on_Centos_65_x64_with_Apache_and_PostgreSQL_93
- Installing and configuring MySQL
- PostgreSQL part is removed
- Using yum instead rpm to install ELrepo (see below notes)
- Email settings are different (I am using company’s smtp server)
- Section for “LoadModule passenger_module” is different since it depends of the passenger version that was at the time of install
Installation steps
Update your system
[root@centos]# yum update
Install tools needed for DB and Ruby
[root@centos]# yum install git wget [root@centos]# yum groupinstall "Development tools"
Install some handy tools
[root@centos]# yum install vim mlocate
Create dedicated user for OP3
[root@centos]# groupadd openproject [root@centos]# useradd --create-home --gid openproject openproject [root@centos]# passwd openproject (your_openproject_password)
Install MySQL:
[root@centos]# yum install mysql-server mysql
Start MySQL automatically with system startup
[root@centos]# chkconfig mysqld on
Start it now
[root@centos]# /etc/init.d/mysqld start
If you are starting MySQL for the first time, one of the hints will be to run:
[root@centos]# /usr/bin/mysql_secure_installation
So, let’s secure MySQL:
[root@centos]# mysql_secure_installation Enter current password for root (enter for none): Set root password? [Y/n] y New password: (new DB root password) Re-enter new password: (new DB root password) Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y
Setup DB for openproject
[root@centos]# mysql -u root -p Enter password: mysql> CREATE DATABASE openproject CHARACTER SET utf8; mysql> CREATE USER 'openproject'@'localhost' IDENTIFIED BY 'your_op_db_password'; mysql> GRANT ALL PRIVILEGES ON openproject.* TO 'openproject'@'localhost'; mysql> GRANT ALL PRIVILEGES ON openproject_development.* TO 'openproject'@'localhost'; mysql> GRANT ALL PRIVILEGES ON openproject_test.* TO 'openproject'@'localhost'; mysql> FLUSH PRIVILEGES; mysql> exit
Install Ruby
Enable ELrepo
[root@centos]# mkdir install [root@centos]# cd install [root@centos]# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm [root@centos]# yum install epel-release-6-8.noarch.rpm [root@centos]# yum update
NOTE: Use yum instead of rpm, otherwise you can get warnings later: Warning: RPMDB altered outside of yum.
For more info, check for example: http://www.cyberciti.biz/faq/centos-fedora-redhat-linux-warning-rpmdb-altered-outside/
Install necessary packages for Ruby
[root@centos]# yum install libyaml libxml2 libxml2-devel libxslt-devel libxml2-devel ruby-mysql mysql-devel ImageMagick-c++ ImageMagick-devel graphviz graphviz-ruby graphviz-devel memcached sqlite-devel
Switch to user under which will OP run (user “openproject” in my case):
[root@centos]# su openproject -c "bash -l"
In my environment, bash complained for something, but this is not important:
bash: cannot set terminal process group (–1): Inappropriate ioctl for device
bash: no job control in this shell
Switch to users home dir or whatever directory you want to install openproject
[openproject@centos]# cd ~
Add following line into profile file of the desired user:
source ~/.profile
[openproject@centos]# vim /home/openproject/.bash_profile
Install RVM (Ruby Version Manager)
[openproject@centos]# \curl -L https://get.rvm.io | bash -s stable [openproject@centos]# source $HOME/.rvm/scripts/rvm
Install Ruby via RVM
[openproject@centos]# rvm autolibs disable [openproject@centos]# rvm install 2.1.0 [openproject@centos]# gem install bundler
Make sure that
bundle —version
is 1.5.1 or higher. If not, update the bundler gem.
Install OpenProject
[openproject@centos]# git clone https://github.com/opf/openproject.git [openproject@centos]# cd openproject [openproject@centos]# git checkout stable [openproject@centos]# bundle install
You might get an error here due to lack of postgresql libs! You can solve this issue either by specifying —without-pg or similar (for bundle install) or simply to install postgresql libs.
We will install postgresql libs to satisfy bundle install requirements
[openproject@centos openproject]$ exit [root@centos]# yum install postgresql-devel
Now, let’s go back to openproject user and its folder
[root@centos ~]# su openproject -c "bash -l" [openproject@centos root]$ cd ~ [openproject@centos ~]$ cd openproject/ [openproject@centos]# bundle install
Configure OpenProject
Create and configure database.yml file by reusing example config
[openproject@centos]# cd /home/openproject/openproject/config [openproject@centos]# cp database.yml.example database.yml [openproject@centos]# vim database.yml
Following info should be defined
production: adapter: mysql2 database: openproject host: localhost username: openproject password: your_op_db_password encoding: utf8 development: adapter: mysql2 database: openproject_development host: localhost username: openproject password: your_op_db_password encoding: utf8 test: adapter: mysql2 database: openproject_test host: localhost username: openproject password: your_op_db_password encoding: utf8
Configure email notifications by creating configuration.yml in openproject/config directory by reusing example config
[openproject@centos]# cd /home/openproject/openproject/config [openproject@centos]# cp configuration.yml.example configuration.yml [openproject@centos]# vim configuration.yml
(configure your settings according to your environment, or use gmail example)
default: email_delivery_method: :smtp smtp_address: smtp.mycompany.net smtp_port: 25 session_store: :cookie_store development: email_delivery_method: :letter_opener test: email_delivery_method: :test production: session_store: :cache_store
Install plugins (Optional)
Create Gemfile.plugins file in openproject directory (/home/openproject/openproject) and paste the lines below:
gem 'openproject-plugins', :git => 'https://github.com/opf/openproject-plugins.git', :branch => 'stable' gem "openproject-backlogs", :git => "https://github.com/finnlabs/openproject-backlogs.git", :branch => 'stable' gem 'openproject-costs', :git => 'https://github.com/finnlabs/openproject-costs.git', :branch => 'stable' gem 'openproject-global_roles', :git => 'https://github.com/finnlabs/openproject-global_roles.git', :branch => 'stable' gem "openproject-meeting", :git => "https://github.com/finnlabs/openproject-meeting.git", :branch => "stable" gem 'openproject-my_project_page', :git => 'https://github.com/finnlabs/openproject-my_project_page.git', :branch => 'stable' gem 'openproject-pdf_export', :git => 'https://github.com/finnlabs/openproject-pdf_export.git', :branch => 'stable' gem 'openproject-documents', :git => 'https://github.com/opf/openproject-documents.git', :branch => 'stable' gem 'reporting_engine', :git => 'https://github.com/finnlabs/reporting_engine.git', :branch => 'stable'
We must run bundle install again:
[openproject@centos]# cd /home/openproject/openproject [openproject@centos]# bundle install
Finish installation of OpenProject
[openproject@centos]# cd /home/openproject/openproject [openproject@centos]# bundle exec rake db:create:all [openproject@centos]# bundle exec rake db:migrate [openproject@centos]# bundle exec rake generate_secret_token [openproject@centos]# RAILS_ENV="production" bundle exec rake db:migrate [openproject@centos]# RAILS_ENV="production" bundle exec rake db:seed
(I have not executed db:seed for developer environment since I don’t need it)
Precompile OpenProjects assets
[openproject@centos]# RAILS_ENV="production" bundle exec rake assets:precompile
Install Apache with Passenger to autostart OpenProject with OS and loadbalance traffic
Install necessary packages
(change back to root user)
[root@centos]# yum install httpd curl-devel httpd-devel apr-devel apr-util-devel
Grant permission for passenger
[root@centos]# chmod o+x "/home/openproject" [root@centos]# su - openproject -c "bash -l"
Install Passenger gem
[openproject@centos]# cd ~/openproject [openproject@centos]# gem install passenger
Compile Passenger for Apache and follow instructions for pasting settings to httpd and virtualhost.
Install it with default values. This is done in the same folder (/home/openproject/openproject)
[openproject@centos]# passenger-install-apache2-module
Once this is done, you will get message like following (don’t copy/paste from here, but from your output!):
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /home/openproject/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.42/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /home/openproject/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.42 PassengerDefaultRuby /home/openproject/.rvm/gems/ruby-2.1.0/wrappers/ruby </IfModule>
So, add the above lines to /etc/httpd/conf/httpd.conf (i.e. text that appeared when you compiled on your system)
Create VirtualHost file for Apache
[root@centos]# vim /etc/httpd/conf.d/openproject.conf
Paste these lines into it (adapt your server name):
<VirtualHost *:80> ServerName www.myopenprojectsite.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 </Directory> </VirtualHost>
Start (or Restart) Apache
[root@centos]# service httpd start
Start Apache automatically with system startup
[root@centos]# chkconfig httpd on
Your OP should be accessible on IP address and port 80 (http) of the PC where you have successfully installed openproject.
Enjoy!
Igor
Replies (3)
Please note that this tutorial was for OpenProject version 3.x !
This worked well for OP 4.0 as well.
Thank a lot for the tutorial. One observation, you would also need to install nodejs before for smooth installation
Also, post installation is it safe to remove postgress and sqlite, if I am using only mysql?
PS: I am using all the plugins.
Hi, I have followed the guide, but I have problem with jquery when i tried to do the step: RAILS_ENV=“production” bundle exec rake assets:precompile
I received this error:
Application.initialize!… [deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
1.720s
rake aborted!
Sprockets::FileNotFound: couldn’t find file ‘jquery’
The openprojet is working, but without css and style.
Could you give me a suggestion?
Thanks,