[HOW-TO] Installing Redmine 1.4.x (Project Management Suite + Issue Tracker + ...) with git integration and incoming emails support, on a hosting server with cPanel version 11.x
First of all, ask your hosting provider to do the following 3 steps for you:
1. Install Ruby on Rails on the server using cPanel's install scripts
2. Install the following gems as root:
gem install bundler mysql rmagick i18n coderay fastercsv tzinfo net-ldap ruby-openid
3. Provide you SSH shell access.
Next, login to your cPanel user account, and
1. Click on the 'Ruby On Rails' icon under 'Software/Services'.
In the page that loads up, under 'Create Ruby on Rails Application',
enter the following details:
App name: red01
Load on Boot? YES (enable checkbox)
Application path: rails_apps/red01
Environment: Production
and click the Create button.
Coming back to the same page, it should now be listed under 'Available Ruby on Rails Applications'.
Click the STOP button/icon if the 'App Status' says 'Running'.
2. Next, Create a Rewrite for the URL if you want, else note down the app URL as such.
The original app URL would look something like
From the 'Ruby on Rails' page in cPanel, under 'Create a Rewrite',
click on the Create Rewrite button against the app.
In the form that loads up, select a Rewrite Domain&URL.
(In our case, we selected red.antolabs.com - an unused subdomain that I had added in cPanel before).
Click the Save button.
3. Now, from the main cPanel page, click on the icon 'MySQL Databases', and create a new database for your redmine app.
Also, create and assign a user to the DB, with all permissions.
Note down the following values:
DB Name: antolabs_red01
DB User - username: antolabs_red01
DB User - password: redmine_db_password
4. Now, login to the server via SSH, and
use the following commands to check for the correct versions of pre-requisites:
ruby --version
rails -v
gem list --local
Compare with the requirements mentioned here:
http://www.redmine.org/projects/redmine/wiki/RedmineInstall
If there are mismatches, work it out with your hosting provider.
5. Now, from http://www.redmine.org/projects/redmine/wiki/Download,
download the correct redmine 1.4.x version and extract it under ~/rails_apps:
cd ~/rails_apps
wget http://rubyforge.org/frs/download.php/76255/redmine-1.4.4.tar.gz
tar -zxvf redmine-1.4.4.tar.gz
Next delete the rails app template that cPanel created and rename the extracted redmine folder to that name, to replace it:
cd ~/rails_apps
rm -rf red01
mv redmine-1.4.4 red01
Next cd into the app folder
cd ~/rails_apps/red01
Then add the database settings as follows:
cd config
cp database.yml.example database.yml
Next edit the database.yml file using vim or any other text editor of your choice:
vim database.yml
and change the "production" settings section that looks like this:
production:
adapter: mysql
database: redmine
host: localhost
username: root
password:
encoding: utf8
with the correct DB settings that we noted down before, to look like this:
production:
adapter: mysql
database: antolabs_red01
host: localhost
username: antolabs_red01
password: redmine_db_password
encoding: utf8
Save and exit.
Next, run the gem dependency handler - bundler:
cd rails_apps/red01
bundle install --without development test postgresql sqlite
If it shows some error like
Gem::Exception: Cannot load gem at [/usr/lib/ruby/gems/1.8/cache/i18n-0.4.2.gem]...
ls into that mentioned folder and see whether there is another version of the same gem present there, as shown below:
ls /usr/lib/ruby/gems/1.8/cache/i18n*
This gave the following output in my case:
/usr/lib/ruby/gems/1.8/cache/i18n-0.6.1.gem
So the version of i18n that exists there is 0.6.1.
Checking with the requirements mentioned in the bundle input config file - 'Gemfile' - lying at the root of the Redmine app:
cd ~/rails_apps/red01
vim Gemfile
If the version is acceptable, change the corresponding gem line to use that specific version:
In this case, the bundle Gemfile gem line for i18n was as follows:
gem "i18n", "~> 0.4.2"
The version part says "~> 0.4.2", which implies "greater than 0.4.2".
The version we have is 0.6.1, which is acceptable in this case.
So we can specify that exact version in the gem line such that the line now looks like:
gem "i18n", "0.6.1"
Save and exit.
Re-run the bundle command:
bundle install --without development test postgresql sqlite
Handle version errors as illustrated in the above case.
Repeat this process till you see something like this:
Your bundle is complete!
Next, create the session store secret as follows:
rake generate_session_store
You may safely ignore the following message:
Please install RDoc 2.4.2+ to generate documentation.
Now create the basic DB tables with this command:
RAILS_ENV=production rake db:migrate
Now, run the following command to load some default configurations for Redmine:
RAILS_ENV=production rake redmine:load_default_data
Select the language as 'en' (English), by typing in
en
and pressing ENTER key when asked for.
Now you just have to go to cPanel and start the mongrel server for the App from the 'Ruby On Rails' page.
Then checkout the rewrite you created. Redmine should be waiting for you there.
Sign in with the following default admin account:
Username: admin
Password: admin
NOTE: Change this password as the very first step once you login, from 'My Account > Change Password'.
Get in and start configuring you Redmine installation as per your requirements.
Enjoy!
- 18640 reads
Add new comment