Skip to content

Instantly share code, notes, and snippets.

@hoangthienan
Last active August 29, 2015 14:05
Show Gist options
  • Save hoangthienan/69aa58eb59699eff6511 to your computer and use it in GitHub Desktop.
Save hoangthienan/69aa58eb59699eff6511 to your computer and use it in GitHub Desktop.
redmine
# Install Redmine on CentOS 6.5
# I don't install redmine via command : yum install redmine.
# Redmine supports Ruby 1.x so do not install ruby 2.0.
Install gem and passenger dependencies
yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel libyaml-devel
Get Ruby
# Create the directory where you will store the Downloads
mkdir ~/Downloads # This can be any directory.
# Change to directory where you will store the download
cd ~/Downloads # This can be any directory.
# FTP to where you will download ruby from.
# When asked to login use user/password of anonymous/anonymous
ftp ftp.ruby-lang.org
Name (ftp.ruby-lang.org:root): anonymous
Password: anonymous
ftp> cd /pub/ruby
ftp> get ruby-1.9.3-p547.tar.gz
ftp> quit
# You have now downloaded ruby and need to untar it
tar zxvf ruby-1.9.3-p547.tar.gz
# Compile ruby
cd ruby-1.9.3-p547
./configure
make
make install
# Verify ruby installation
ruby -v
which ruby
# Change back into your downloads directory
cd ..
# Get Gems
wget http://production.cf.rubygems.org/rubygems/rubygems-2.4.1.tgz
tar zxvf rubygems-2.4.1.tgz
cd rubygems-2.4.1
ruby setup.rb
gem -v
which gem
cd ..
# Install Passenger (requires gcc)
gem install passenger
passenger-install-apache2-module
# RHEL/CentOS 6
rpm --import http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc
yum install http://passenger.stealthymonkeys.com/rhel/6/passenger-release.noarch.rpm
yum install mod_passenger
# Restart Apache
service httpd restart
# Download Redmine
wget http://www.redmine.org/releases/redmine-2.5.2.tar.gz
tar zxvf redmine-2.5.2.tar.gz
# Copy the folder to its HTTP document root folder
mkdir /var/www/redmine
cp -av redmine-2.5.2/* /var/www/redmine
# Install Bundler
gem install bundler
# Create the Gemfile and register these gems in it
vi /var/www/redmine/Gemfile
cd /var/www/redmine/Gemfile/
bundle install --without postgresql sqlite test development rmagick
# Create the Redmine MySQL database
CREATE DATABASE redmine CHARACTER SET utf8 COLLATE utf8_general_ci;
#grants
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost' IDENTIFIED BY 'my_password';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'%' IDENTIFIED BY 'my_password';
# Configure /var/www/redmine/config/database.yml (rename database.yml.example)
# Session store secret generation
rake generate_secret_token
# Database schema objects creation
# Create the database structure, by running the following command under the application root directory:
RAILS_ENV=production rake db:migrate
# Database default data set
#Insert default configuration data in database, by running the following command:
RAILS_ENV=production rake redmine:load_default_data
cd /etc/httpd/conf.d
nano passenger.conf
LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-4.0.48/ext/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-4.0.48
PassengerDefaultRuby /usr/bin/ruby
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment