You are hereBlogs / admin's blog / Installing Redmine on HostMonster

Installing Redmine on HostMonster


By admin - Posted on 27 November 2010

http://www.gettaskdone.com/portfolio/consulting-portfolio/redmine-at-hos...

Just in case link dies -- copy is below:

Create MySQL Database and Username

Login to CPanel and click on MySQL Database Wizard, it will prompt you for database name, then ask you to make a user, make sure you GRANT ALL privileges. Remember this database and username we will use it later.

I will explain how to create DB for languages other than English a bit later.

Create a Sub-Domain

For the purposes of this tutorial name it redmine, point this sub domain to ~/public_html/redmine.

Do NOT copy any files into this directory, we will be deleting it later

Make sure you have the right version of Rails installed

In case it is different from what you need you can install a specific Rails version on your machine by running:

%prompt> gem install rails -v=2.3.5

Create RoR directory

It is not recommended that you put your RoR apps within the ~/public_html directory, as users would be able to see the rb files. So we are going to create a rails directory.

%prompt> cd ~
%prompt> mkdir rails

Create Rails App

You create a rails app on HostMonster just like you would on your system, by using the rails command. We are creating the rails project inside of the rails directory

%prompt> cd rails
%prompt> rails -D redmine

We need -D to let rails know that we want custom dispatch.rb, dispatch.cgi and dispatch.fcgi files for later steps.

Create a Sym-Link for Sub-Domain

Since the HostMonster interface won’t let you select a directory outside of public_html, we are going to create a sym link from the ~/public_html/redmine folder to ~/rails/redmine. To do this we will be deleting the ~/public_html/redmine directory. The sym link will recreate it.

%prompt> cd ~/public_html
%prompt> rm -R redmine
%prompt> ln -s ~/rails/redmine/public redmine

Please note the space between ~/rails/redmine/public and redmine This command says create a new folder named redmine that points to ~/rails/redmine/public

Do a Smoke-Test

Goto subdomain.yourdomain.com, you should see the default rails welcome page. This is fine, this is what you should see right now.

Prepare Redmine

Download the latest final release of Redmine (it’s 0.9.1 now). Extract this to your desktop, you should now have a folder name redmine on your desktop. Login to your CPanel and goto File Manager. You’ll want to navigate to ~/rails/redmine/public, you’ll want to download the following files and put them in your local copy of redmine. Which should be ~/Desktop/redmine/public. Download dispatch.rb, dispatch.cgi and dispatch.fcgi.

Now edit your database.yml file with the database, username and password you created in step one. You only have to change those three values for production and development configurations. To do so copy config/database.yml.example into config/database.yml and edit the latter. Comment out all the rest lines.

Now inside of your local redmine folder select all the files and folders and right click and select ‘Compress all the items…’. What we are doing is uploading this archive, I seem to have problems every time I try to uploadredmine file by file.

Upload Redmine

If you don’t have File Manager open still then login to CPanel and open it again. Navigate to your ~/rails/redmine folder and click the check boxes on all items and click delete. Now, upload your archive. Once it’s done uploading click on the archive in File Manager and hit extract.

Finish install

Now ssh into your server, your going to want to chmod 755 your ~/rails/redmine/public folder.

%prompt> cd ~/rails/redmine
%prompt> chmod 755 public

Next, you must create a custom .htaccess file for Apache to handle this directory properly. First remove any .htaccess file that may already be in the ~/rails/redmine/public directory.

%prompt> cd public
%prompt> rm .htaccess

Download file from here: http://www.gettaskdone.com/redmine-htaccess/htaccess.txt into ~/rails/redmine/public directory and save it as .htaccess.

Best way to do this is by typing following set of commands:

%prompt> cd ~/rails/redmine/public
%prompt> wget http://www.gettaskdone.com/redmine-htaccess/htaccess.txt
%prompt> mv htaccess.txt .htaccess

Generate a session store secret.

This is required on the trunk version of Redmine at r2493 or above and the released 0.8.7 version or above.

Redmine stores session data in cookies by default, which requires a secret to be generated. This can be done by running:

%prompt> cd ~/rails/redmine
%prompt> RAILS_ENV=production rake config/initializers/session_store.rb

Setup Database

We have to give redmine it's database structure and default values.

%prompt> cd ~/rails/redmine
%prompt> RAILS_ENV=production rake db:migrate

Insert default configuration data in database

Run the following command:

%prompt> RAILS_ENV=production rake redmine:load_default_data

This step is optional but highly recommended, as you can define your own configuration from scratch. It will load default roles, trackers, statuses, workflows and enumerations.

You should now be able to goto subdomain.yourdomain.com and see Redmine in action.