Running Redmine 1.4.7 on Hawkhost shared hosting


Recommended Posts

Installing Redmine on Hawkhost shared hosting


The Ruby environment on Hawkhost shared hosting currently supports Redmine up to version 1.4.7, which is at the moment the latest version that runs on Rails 2.x. Ruby-on-Rails is supported through the CPanel and through a set of specific binaries, already compiled and installed for particular Ruby Gems, required by many rails applications. The following is a living guide for installing and running Redmine on Hawkhost's shared hosting environment.


This guide assumes you have a regular Hawkhost shared hosting account with regular CPanel admin access, and already have some familiarity with both CPanel and using a telnet / SSH program. These instructions seem very long, however if you are already are used to editing remote files, logging on to telnet, and logging into cpanel, this can be followed in as little as 10-20 minutes, maybe less. You should then have a working, production ready, Redmine install. 


Part 1 - Carving out a place for Redmine


First order of business is finding a place to put Redmine itself, with a spot in a docroot where Redmine could map to a real URL. Here will be using a separate "subdomain" for Redmine, as probably covers the most 'use cases' with the same instructions, and is not very invasive, works well for testing, is easy to add to an existing site, or shared among many sites, and basically the instructions would still work well for an account used only for Redmine.  These instructions will use a subdomain named 'support' with its own 'public_html' folder on fictitious '' that will map a local docroot of '~/sites/' to a Redmine application in '~/sites/'. Its important to point out that the Redmine files should never be placed inside any docroot. Here we use 'sites' folder to be clear sort of like a home folder, rather than accepting the CPanel default subdomain inside the primary domains docroot, and place the docroot and the app in separate folders. Each install of Redmine is tied to one domain, as a limitation of Redmine and so they are placed together here as well.


Create the subdomain and docroot:

1) Log into CPanel and Open Subdomains (icon)

2) In the Create a Subdomain section set:

  - Subdomain to: support

  - Document Root to: sites/

3) Click Create

4) Confirmation page should say similar to: 'has been created'. Click Back.


Part 2 - Creating the Redmine launcher


So far we have created a "subdomain", which created our 'public_html' folder for the docroot. Now, likewise, we will create our 'redmine' folder through CPanel by using the Ruby on Rails manager to create the shared hosting Ruby on Rails "launcher" for the redmine application. This facility will also automatically load our Redmine application instance when the hosting environment restarts, and gives us our server-wide non-conflicting port for the actual running Ruby on Rails application. We do this before installing the Redmine application files because the launcher will only create an instance if the folder doesn't already exist, so that it can copy the default Rails application files. For our purposes Redmine is already a complete application, and the manager's starter files aren't needed and would cause issues if left in place. While we are configuring the instance, will also go ahead and map the application to the domains docroot. When the application is launched it will simply be on a port on the regular shared hosts IP, addressable thought your root or other sub or add-on domain's name of course, as well.


Create the shared hosting Ruby launcher instance:

5) From CPanel home, Open the Ruby on Rails (icon) in Software/Services section.

6) In the Create Ruby on Rails Application section set:

  - App Name to: mydomai_redmine  (note the abbreviated domain name part, to 7 chars)

  - Load on Boot to: checked

  - Application Path to: sites/

7) Click Create

8) Confirmation page should say similar to: 'Your app is installed'. Click Back.


Configure an Redmine instance docroot mapping:

9) While still in the CPanel Ruby on Rails (icon) tool:

10) In the Create A Rewrite section:

  - In App Name find: mydomai_redmine  (note: is the same abbreviated domain name part, to 7 chars)

11) Click Create Rewrite

12) In the Create a URL Rewrite section, set:

  - In App Name find: mydomai_redmine  (note: is the same abbreviated domain name part, to 7 chars)

  - Domain and URL domain to: support.mydomain

  - Domain and URL for URL: leave blank

13) Click Save

14) Confirmation page should say similar to: 'http://support.mydomain/ will now be transparently rewritten to http://mydomain:12002/ (mydomai_redmine)'. Click Back.


Part 3 - Creating the database

While we are still in CPanel doing basic things, is good time to go ahead and create the required Database. Each redmine instance needs one database all its own. 

Create the Redmine instance database:

15) From CPanel home, Open the MySQL® Databases (icon) in Databases section.

16) In the Create New Database section set:

  - New Database to: myaccount_ mydomai_redmine (note: can be very confusing, 'myaccount_' is the non-blank portion with your abbreviated account name)

17) Click Create Database

18) Confirmation page will be same page with you database now in the list of databases: as 'myaccount_mydomai_redmine'.


Create new user:

19) In the MySQL Users / Add New User section set:

  - Username to: myaccount_ mydomai (note: can be very confusing, 'myaccount_' is the non-blank portion with your abbreviated account name)

  - Set both password fields by whatever means, the password generator button is a great option :)

20) Click Create User

21) Confirmation page should say similar to: 'Added user "myaccount_mydomai" with password "xxxxx"'. Click Back.

Add new user to new database:

22) In the Add User To Database section set:

  - User to: myaccount_mydomai

  - Database to: myaccount_mydomai_redmine

23) Click Add

24) Confirmation page should say similar to: 'MySQL Account Maintenance'.

25) In the Manage User Privileges section set:

  - ALL PRIVILEGES to: checked

26) Click Make Changes

27) Confirmation page should say similar to: 'User "myaccount_mydomai" was added to the database "myaccount_mydomai_redmine". Click Back.

28) In the Current Databases section should now see similar to: 'Database: myaccount_mydomai_redmine  / Size: 0.00 MB / User: myaccount_mydomai'

Part 4 - Creating the Redmine support email account


Finally in CPanel need to create the "support" email account Redmine will use to verify registrations and send update or change notifications with. Its assumed that these days most will want the ability to verify registration email automatically, and that project change notifications in Redmine will be necessary so they are a part of this basic redmine install. If you already have a suitable Hawkhost email on the same account, or have an acceptable email that works by another remote SMTP (or otherwise) outgoing email, then this step can be skipped. This whole email thing can be a very difficult, and if you aren't sure then is probably just best to create a new email and get Redmine working "at all" first, and fine tune from there.


The strategy here is to create an email account to accept SMTP that is sort-of "bound" to the Redmine install, and just for it's own use. The actual email sender that users see, the one configured later in Redmine through its web pages, can be the same email or something else completely. For these instructions will also not be using TLS and friends to keep it simple.


Create SMTP outgoing mail account:

29) From CPanel home, Open the Email Accounts (icon) in the Mail section.

30) In the top section set:

  - Email to: redmine

  - Set the @ domain drop-down list to the actual redmine sub-domain: support.mydomain

  - Set both password fields by whatever means, the password generator button is a great option here, as well

31) Click Create Account

32) Green confirmation message should say similar to: 'Account created: "redmine @ support.mydomain".'


Part 5 - Installing the Redmine application files

Next order of business is getting and installing the actual Redmine application files, where here we will use the current latest version that supports Rails 2.x, and is known to work in the current Hawkhost Ruby environment. These instructions, and most of the later instructions, require using a telnet / SSH client to access the command line, where if you don't have one that works with Hawkhost, would recommend 'Putty' (unless Hawkhost recommends another) from and then follow instructions similar to the VPS Tenet instructions in Redmine versions can be found here, however we will be downloading them through the shell to the folder, and not through the browser and website.   


Get and install the redmine application files:

33) Log into Telnet / SSH and change to the site root. type:

cd ~/sites/
34) Download and extract Redmine. type:

mv 1.4.7.tar.gz redmine-1.4.7.tar.gz
tar -zxvf redmine-1.4.7.tar.gz
35) Replace the RoR manager's default application with Redmine application. type:

mv redmine redmine_default
mv redmine-1.4.7 redmine
See next post...
Link to comment
Share on other sites

Part 6 - Configuring the Redmine installation files


Now is a good time to edit the configuration files before trying to install or run any of the components, and much easier than going back and forth. This, and the next few parts, cover the bulk Hawkhost shared server specifics, however the principle strategies would work in many other environments.  For most regular Redmine installs, the Rails production vs. development configuration differentiation is not very meaningful, so here we only configure the 'production' Rails settings. The 'development' case for most would actually be a second 'production' redmine install with a newer version they would be testing for upgrade to import the old database, but that's for another guide later :). As far as editing the specific files there are may ways, such as using the File Manager in CPanel. And in looking at it, I wouldn't recommend using the "code" editor and just use the regular "text" editor, and just click 'edit' when prompted. Personally I use BeyondCompare mostly for editing in remote work as its a bit less tedious, and a little safer editing against a shadowed local copy using the compare. Many others use FileZilla, and both applications use FTP and access the file more like it was a local file. To configure either of these you only need your primary domain name as the host, and your regular admin credentials for user and password, and keep in mind that Hawkhost uses regular FTP on port 21 for additional users accounts you create yourself, SSH SFTP on port 22 for your main Hawkhost account's FTP login.


* Important: Redmine, and much of Ruby, use YAML type text files, where indentation is by done by adding exactly two spaces per indent level and indent levels are actually syntactically meaningful. The example sections below show the proper formatting.

Rename Redmine configuration files to correct names:

36) Still logged into Telnet / SSH, change to redmine install folder. type:

cd ~/sites/
37) Rename the Redmine email and database example files to configuration.yml and database.yml. type:

mv config/configuration.yml.example config/configuration.yml
mv config/database.yml.example config/database.yml
Configure the Redmine database.yml settings:

38) Edit 'config/database.yml' to change these values in the 'production' section:

  - database to: myaccount_mydomai_redmine

  - username to: myaccount_mydomai

  - password to: [your myaccount_mydomai db password]

  adapter: mysql
  database: myaccount_mydomai_redmine
  host: localhost
  username: myaccount_mydomai
  password: [your myaccount_mydomai db password]
Configure the Redmine configuration.yml (email) settings:

39) Edit 'config/configuration.yml' to add these values in the 'production' section at the bottom of the file:

  - add email_delivery sub-section to: production:

  - add smtp_settings sub-section to: email_delivery:

  - add enable_starttls_auto set to: false  (note: assumes your mail.mydomain resolves to a Hawkhost SMTP, as should by default)

  - add address set to: "mail.mydomain"  (note: actual address to the SMTP server, using the Redmine base domain should be fine)

  - add domain set to: "mydomain"  (note: is setting for the HELO domain, using the Redmine base domain should be fine)

  - add user_name set to: "[email protected]"  (note: is full Redmine support email account login name)

  - add password set to: "[your 'redmine @ support.mydomain' mail account password]"

# specific configuration options for production environment
# that overrides the default ones
      enable_starttls_auto: false
      address: "mail.mydomain"
      domain: "mydomain"
      user_name: "[email protected]"
      password: "[your 'redmine @ support.mydomain' mail account password]"
Configure the Redmine environment.yml (general) settings:

40) Edit 'config/environment.rb' to uncomment and change this value:

  - config.log_level from: :info to: :warn

  # Force all environments to use the same logger level
  # (by default production uses :info, the others :debug)
  config.log_level = :warn
Configure the Redmine Gemfile (dependencies) settings:

41) Edit 'Gemfile' to change this value at the top of the file:

  - gem "rails" from: "2.3.15"  to: "~> 2.3.15"

source :rubygems
gem "rails", "~> 2.3.15"
gem "i18n", "~> 0.4.2"
42) Still in 'Gemfile', change this value in the middle of the file:

  - gem "mysql" from: "~> 2.8.1"  to: ">= 2.8.1", "< 3.0.0"

platforms :mri_18, :mingw_18 do
  group :mysql do
    gem "mysql", ">= 2.8.1", "< 3.0.0"
Part 7 - Installing the Redmine dependencies


Next we install necessary Redmine dependencies, like the Ruby Gems. This is undoubtedly the hardest part, and is where most hit a wall. A few important fundamentals that will help us through: 1) Ruby Gems often have a binary component and on Unix are usually compiled at install time, 2) a shared environment is necessarily restricted from compiling and building new binaries directly, 3) we have a nice sane list of what's been built for us, in CPanel, which thankfully were also built with the intent of running rails, 4) the continuing Redmine service releases for Rails 2.x increases our chances of getting a matching set of dependencies. For anyone who has ever gotten into trouble with APT or YUM on UNIX, this is the exact same thing. The Gem command gets installable dependencies, and for Rails there is Bundler that interprets Rails Gemfile and uses Gem and is supposed to get he dependencies for you, and Redmine is a Rails application, and all of which comes quickly to a grinding halt on production system with a managed set of dependencies.


The strategy here is to grab the "gems" and other dependencies (and those that depend on them) that match the currently installed binary bits, then things should work as normal, and the rest of the regular install process can proceed. Normally, in theory (and often in reality), a modern Rails application install should begin with bundler installing dependencies for us, however our story begins without a working bundler. The bundler requirement is new if you were using Redmine 8.x previously. I'd also recommend not installing the Gem documentation (via --no-ri --no-rdoc) for something like this especially in a shared environment as the number of files and size (and install time) increases substantially, and are more or less completely unnecessary.  Because we must hand pick our Gem versions to match our existing binaries, we will not actually be using 'bundler' for most of the installs. Bundler will mostly help us find what's missing, and later will make the Gemfile.lock file needed to show startup scripts that the app is installed.


Get and install the Ruby 'bundler', used to install Rails application dependences:

43) Log into Telnet / SSH, change to redmine install folder, add 'local gems' to shell path. type:

cd ~/sites/
44) Install the Ruby 'bundler' gem. type:

gem install bundler --no-ri --no-rdoc
Get and install the Redmine application dependencies:

45) Install core dependencies, where versions must match Hawkhost. type:

gem install rake -v '10.3.2' --no-ri --no-rdoc
46) Install other dependencies. type:

gem install coderay -v '~> 1.0.6' --no-ri --no-rdoc
gem install fastercsv -v '~> 1.5.0' --no-ri --no-rdoc
gem install i18n -v '~> 0.4.2' --no-ri --no-rdoc
gem install net-ldap -v '~> 0.3.1' --no-ri --no-rdoc
gem install ruby-openid -v '~> 2.1.4' --no-ri --no-rdoc
gem install tzinfo -v '~> 0.3.31' --no-ri --no-rdoc
47) Run bundler to 'bundle' the Redmine application. type:

bundle install --without development test sqlite postgresql pg rmagick
48) Confirmation should look similar to the below, but doesn't need to be exactly the same. Any missing gems or other issues would show here on this step. Issues here are indicative of significantly updated or incomplete Hawkhost server, where should contact support. Seeing a "complete bundle" here generally means that the Ruby on Rails environment is healthy overall.

Using rake (10.3.2)
Using activesupport (2.3.18)
Using rack (1.1.6)
Using actionpack (2.3.18)
Using actionmailer (2.3.18)
Using activerecord (2.3.18)
Using activeresource (2.3.18)
Using coderay (1.0.9)
Using fastercsv (1.5.5)
Using i18n (0.4.2)
Using mysql (2.9.1)
Using net-ldap (0.3.1)
Using rails (2.3.18)
Using ruby-openid (2.1.8)
Using tzinfo (0.3.38)
Using bundler (1.5.2)
Your bundle is complete!
Gems in the groups development, test, sqlite, postgresql, pg and rmagick were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Part 8 - Installing the Redmine application


Finally, now that the file configuration in complete and dependencies are in place, we install the actual Redmine application. This will prepare the folders for sessions, logs, and otherwise, and will create the DB schema and load it with default values. All of which is necessary before starting Redmine for the first time.  Some of this has changed slightly from the older 0.8.x versions.


Configure the Redmine session store:

49) If not already, log into Telnet / SSH, and change to redmine install folder, add 'local gems' to shell path. type:

cd ~/sites/
50) Call the Redmine session store configuration through rake. type:

rake generate_session_store
51) These commands will likely produce a warning message similar to the below, which can be safely ignored:

Please install RDoc 2.4.2+ to generate documentation.
Configure the Redmine schema and database defaults:

52) Run both the schema migrate and defaults commands through rake. type:

rake db:migrate RAILS_ENV="production"
rake redmine:load_default_data RAILS_ENV="production"
53) Answer data set language to be loaded, which occurs during "load_default_data", English is default:

Select language: ar, bg, bs, ca, cs, da, de, el, en, en-GB, es, et, eu, fa, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sq, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en]
See next post...
Link to comment
Share on other sites

Part 9 - Starting Redmine


Now the moment of truth... where we will start Redmine through the regular CPanel. This is really the only way to start Redmine that counts. The CPanel Ruby on Rails module will basically be managing the Redmine Rails process for us, and is responsible for launching Redmine automatically whenever the server starts. Also, if you do make Redmine configuration changes like any of the ones in the previous instructions, like adjusting Email setting in the configuration files, you will need to stop and re-start the Redmine instance similar to the instructions below. Now a little background is probably in order, to demystify some of what is going on here. Basically, CPanel RoR manager will launch the Redmine application using Rails with Mongrel. Then, the Lightspeed 'Apache' webserver will "re-write" any page URLs, and effectively act as a "front end" for Mongrel for our Redmine instance. Because the Mongrel RoR front-end facility was never really updated for Rails 3.x, and because CPanel launcher uses Mongrel, we need to use Rails 2.x here. This particular stack is what all of these instructions are basically wrapped around. Rails 2.x has broad support, is very stable, and is still a perfectly good production platform for Redmine.


Start and test the Redmine application instance:

54) From CPanel home, Open the Ruby on Rails (icon) in Software/Services section.

55) In the Available Ruby on Rails Applications section:

  - In App Name find application: mydomai_redmine

  - In App Status should say: not running

  - In Actions hover over: run

56) Click Run

57) Confirmation page should say similar to: 'The following Ruby on Rails application was started: mydomai_redmine'. Click Back. You may also get a message saying it wasn't started with a list of only warning messages about deprecated GEMs. This is also normal, and after clicking back Redmine will still show that it's in a 'running' state.


Open your running Redmine application in a browser:

58) Open new browser tab or window

59) Open: 'http://support.mydomain'  (note: where 'mydomain' is of course whatever base domain have been using for these instructions)

60) The new Redmine site should show, with a very basic Spartan looking, un-configured, blue Redmine page. 


Part 10 - Configuring Redmine for regular use


Now will need to configure a few basics, which should definitely be done before the site is really used for the first time. Following these steps are important to having a safe and useable production Redmine install, and the admin password should be changed immediately after starting the application for the first time. Also, if you are an active participant in the day-to-day Redmine goings on, should make another account later on to use as your regular user for those activities, rather than participating as 'admin'. For these instructions the administrative setup should be finished as 'admin' here. It is also important to not yet configure additional settings for the admin account which are not in these instructions, until later, after initial configuration here is complete.


* Important: do this first step immediately, the changing the admin password.


Open Redmine home, and set the admin password:

61) Open the Redmine home page, if not already. Page sub-heading should say Home.

62) Click Sign in on the upper-right.

63) Change these values in the orange-pink login box:

  - Login to: admin

  - Password to: admin

64) Click Login

65) Page should now be similar to previous home, but with 'Logged in as admin' on the upper-right.

66) Click My account on the upper-right.

67) Next to the My account sub-heading, click Change password on the right side.

68) In the Change password section set:

  - password to: admin

  - New password to: [new password for admin account]

  - Confirmation to: [same new password for admin account]

69) Click Apply

70) Confirmation message in green should be similar to: 'Password was successfully updated.' Page should be My account page.


Set and hide the Redmine admin email address:

71) While still logged in as admin, on the same My account page.

72) Change this value in the Information section:

  - Email to: [easily accessible admin address, for testing notifications]  (note: not the redmine SMTP account from earlier steps)

73) Change this value in the Email notifications section:

  - I don't want to be notified of changes that I make myself to: checked

74) Change these values in the Preferences section:

  - Hide my email address to: checked

  - Time zone to: [time zone, as appropriate]

75) Click Save

76) Confirmation message in green should be similar to: 'Account was successfully updated.' Page should be My account page.


* Note: resist the urge to change additional settings from what is indicated in the instructions, especially if is first time.


Configure basic site settings:

77) While still logged in as admin from any page, click Administration on the top-left.

78) In the Administration section, click Settings (icon) on the middle-left.

79) Should see Settings sub-section, with General tab open on the left.

80) Change this value in the General tab:

  - Host name and path to: support.mydomain  (note: 'mydomain' is actual base domain name, and 'support' is actual subdomain for redmine)

81) Click Save

82) Confirmation message in green should be similar to: 'Successful update.' Should still be on General tab.

83) Change this value in the Authentication tab:

  - Self-registration to: account activation by email

84) Click Save

85) Confirmation message in green should be similar to: 'Successful update.' Should still be on Authentication tab.

86) Change these values in the Email notifications tab:

  - Emission email address to: [another easily accessible real email address]  (note: is notification sender's email address. can be  another related appropriate address, or admin email address, or the Redmine support email account from 'part 4' above)

  - In Emails footer at bottom replace text: http://hostname/my/account with: http://support.mydomain/my/account  (note: 'mydomain' is actual base domain name, and 'support' is actual subdomain for redmine)

87) Click Save

88) Confirmation message in green should be similar to: 'Successful update.' Page should be Settings page on Email notifications tab.


Send Redmine test notification email:

89) While still logged in as 'admin', and while still on Settings page with the Email notifications tab open.

90) Click Send a test email at the very bottom-right of the page.

91) Confirmation message in green at the top should be similar to: 'An email was sent to [your easily accessible admin address]'


Check Redmine test notification email:

92) In a new browser tab or window (or whatever means appropriate) open the [easily accessible admin address]'s email.

93) An email should have arrived from your Redmine application. Open the email.

94) Check the email for these characteristics:

  - From address is: [correct real sender address]  (note: from step 86)

  - Redmine URL in body is: http://support.mydomain  (note: is full public URL back to your Redmine application)

  - To change your notification preferences, please click here at bottom is:  http://support.mydomain/my/account  (note: from step 86)

Redmine test
From admin@mydomain

This is a test email sent by Redmine.
Redmine URL: http://support.mydomain/

You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://support.mydomain/my/account
95) Click link for To change your notification preferences, please click here

96) Page should open for your Redmine site, to My account for the 'admin' user.

97) Click Sign out on the upper-right of the page.

98) Page should now look like basic home page for Redmine, as before.



Instructions should work to this point on any shared Hawkhost server. (If you find this is not the case please create a ticket with support. If afterward you find that the instructions could be updated or fixed, please leave message below, or PM me :))



More soon, setting up basic project so receive updates as manager...

Link to comment
Share on other sites

  • 2 months later...


Thank you for the great manual about Redmine installation on Hawkhost. After the Hawkhost upgraded their Cpanel, I switched to local server, but know trying to return everything back.

I have a problem with Mysql installation. Can't install this gem. I tryed even two servers, everythere same probem. "Bundle install" (from 47 point) recommends me to run: gem install mysql -v '2.9.1'

But after this I get the problem: "

Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
	ERROR: Failed to build gem native extension.

        /usr/bin/ruby extconf.rb
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
*** extconf.rb failed ***

Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options."

Have you seen something similar?

Link to comment
Share on other sites

Thank to Support I resolved this issue. Please take into account:


On the point 47)

bundle install --without development test sqlite postgresql pg rmagick


You will get an error with mySQL gem installation, here you should apply to support they will install it for you.


But after that I started to get another problem, for unknown reason Bundle wanted to load, rake 10.2.0. To get rid of this error, please add to your Gemfile: gem 'rake', "~> 10.1.1"


Everything works now, I hope till the next update from Hawkhost :rolleyes:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.