Installing Redmine on (bluehost) shared hosting

Hi, here a script to install readmine  0.8.4 ( on a shared host that offers ruby on rails. enjoy

#automatic install of redmine 0.8.4 ( on a shared server (tested on bluehost)
#AUTHOR: Marco Bernasocchi (
#BEFORE starting:
# - create an empty DB (using cpanel) and a DB user with full permissions on the db
# - create a mail user used to send out mails (quota can be set to 1Mb since you just need to send mails with it)
# - cd into the dir you want to install to. (for example /home/username/railsApps/redmine)
#AFTER (not mandatory):
# - create a subdomain (in cpanel) for redmine and link it to the public folder in redmine
# example:
# 	delete the default created folder
# 	rm -rf /home/username/public_html/redmine/
#	create symlink to the public folder
# 	ln -s /home/username/railsApps/redmine/public /home/username/public_html/redmine
# now redmine is located at
# login: admin
# passw: admin
#set this vars
#get redmine 0.8.4
tar zxvf redmine-0.8.4.tar.gz
rm redmine-0.8.4.tar.gz
mv redmine-0.8.4/* .
rmdir redmine-0.8.4
#use fastCGI dispatcher
mv public/dispatch.fcgi.example public/dispatch.fcgi
#set some permissions
chmod 700 public/dispatch.fcgi
chmod 700 tmp
chmod 700 log
#force production environnement
sed 's|# ENV[|ENV[|g' config/environment.rb > TMPFILE && mv TMPFILE config/environment.rb
#create config/database.yml
echo 'production:' > config/database.yml
echo ' adapter: mysql' >> config/database.yml
echo ' database: '$MY_DB >> config/database.yml
echo ' host: localhost' >> config/database.yml
echo ' username: '$MY_DB_USER >> config/database.yml
echo ' password: '$MY_DB_PASSW >> config/database.yml
echo ' encoding: utf8' >> config/database.yml
#create config/email.yml
echo '# Outgoing email settings' > config/email.yml
echo 'production:' >> config/email.yml
echo '  delivery_method: :smtp' >> config/email.yml
echo '  smtp_settings:' >> config/email.yml
echo '    address: '$MY_MAIL_SUBDOMAIN$MY_DOMAIN >> config/email.yml
echo '    port: '$MY_MAIL_PORT >> config/email.yml
echo '    domain: '$MY_DOMAIN >> config/email.yml
echo '    authentication: :login' >> config/email.yml
echo '    user_name: '$MY_MAILER >> config/email.yml
echo '    password: '$MY_MAILER_PASSW >> config/email.yml
#create app
rake db:migrate RAILS_ENV="production"
rake redmine:load_default_data RAILS_ENV="production"

If you plan to integrate with a repository don’t forget to check the settings>repositories tab, where it says “Fixing keywords”, it is a very cool function that allows you to automatically change the issue status by using keywords in the commit message.

14 Responses

  1. xiheng

    Hey there, thanks very much for this write-up. It helped a great deal. I’m new to Ruby and just got this bluehost account. The installation script is awesome..

  2. I believe that it will be slower. A lot of eye candy has been added since the 8.04 release. I would suggest upgrading to Xubuntu, which is more lightweight.

  3. You saved my day, thanks!
    After I ran the script and tried the application on the browser I got an HTTP 500 error, it disappeared after I commented this line(config/environment.rb:8) :
    #RAILS_GEM_VERSION = '2.1.2' unless defined? RAILS_GEM_VERSION

  4. Chris B

    I’ve been struggling to get SMTP setup on an old Rails 1.2.6 site that I have to migrate to BlueHost (not my choice). However, no matter what combination of settings I try I still get the error “Net::SMTPFatalError (550 No Such User Here)” I’ve tried both port 25 and 26, I’ve tried using, and local host for the address, I’ve tried using username@… and username +… for the username. BlueHost tech support is useless at helping me with this. So frustrated, I’d switch hosts if it weren’t the fact that the client already shelled out money for an SSL cert with BlueHost and a “Pro” hosting account, and that this is just a temp site until their new one is finished.

  5. I did above mentioned all the steps, all the steps commands executed without any error, then i tried to access the url its show folder structure. how can i access it. i strongly believe some thing is missed in the above steps/…

  6. Anirvan

    Hi Marco and everyone,
    I use BlueHost shared hosting. After examining the superior proj. mgmt features of Redmine, I want to move our collaborative project website to this platform. However, I am stuck in the installation process, zero help from the Redmine forums.
    Requesting your help here, after going through this message thread. It seems a few instructions maybe out of date since Marco’s original post…. OR maybe I am missing some step somewhere…
    First: the environment for my installation:
    $ RAILS_ENV=production script/about
    About your application’s environment
    Ruby version 1.8.7 (x86_64-linux)
    RubyGems version 1.7.2
    Rack version 1.1.3
    Rails version 2.3.14
    Active Record version 2.3.14
    Active Resource version 2.3.14
    Action Mailer version 2.3.14
    Active Support version 2.3.14
    Application root /home/myname/rails_apps/lovelyapp
    Environment production
    Database adapter mysql
    Database schema version 20120301153455
    As of now, installation has been made and when I browse to the website, there are 2 (failure) scenarios that I face:
    Scenario 1: The main page appears after a loooong time. This scenario happens only if I use an unmodified .htaccess (in public directory) with following lines:
    Options -MultiViews
    PassengerResolveSymlinksInDocumentRoot on
    #Change to your environment
    RailsEnv production
    RailsBaseURI /
    SetEnv GEM_HOME /home/myname/ruby/gems
    A main page is rendered with some view (a few links). But when I try to click on any of the links (Projects, Login, Register), that is where the problem starts. I get the following 500 error page (on Firefox browser):
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request
    Scenario 2: I read somewhere that it is advisable to use Fast CGI. So I did the following:
    – Copied the code from htaccess.fcgi.example to public/.htaccess
    – Uncommented the line (installing at root of addon domain):
    RewriteBase /
    After doing this, I received the following result on Firefox browser. No views were rendered this time (blank page).
    Application error
    Rails application failed to start properly
    Am I missing some step somewhere?
    Thanks in advance for all your help,

Leave a Reply