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

#automatic install of redmine 0.8.4 (https://www.redmine.org/) on a shared server (tested on bluehost)
#
#AUTHOR: Marco Bernasocchi (https://www.bernawebdesign.ch)
#LICENSE: https://www.gnu.org/licenses/gpl-3.0.html
#
#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 https://yoursubdomain.example.com
# login: admin
# passw: admin
#set this vars
#
MY_DB="dbName"
MY_DB_USER="dbUser"
MY_DB_PASSW="dbPassw"
MY_DOMAIN="example.com"
MY_MAIL_SUBDOMAIN="mail."
MY_MAIL_PORT="26"
MY_MAILER="user+example.com"
MY_MAILER_PASSW="mailPassw"
#
#get redmine 0.8.4
wget https://rubyforge.org/frs/download.php/56909/redmine-0.8.4.tar.gz
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.

Categories: Web Development

14 Comments

sarah · 2009-08-16 at 13:49

cool, thanks for the post, I was looking into it too, so you saved me some work

xiheng · 2009-12-12 at 08:10

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..

websites · 2010-05-03 at 09:16

: ) that is one of the ways to think about this 😉

Torri Wheler · 2010-08-06 at 17:21

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.

kadimi · 2010-09-04 at 21:15

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

Chris B · 2011-01-07 at 23:01

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 mail.mydomain.com, mydomain.com 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.

gao · 2011-03-10 at 09:12

New version of the bluehost installation fails, preventing access,
please help me

Suresh · 2011-09-20 at 20:12

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/…

Anirvan · 2012-05-16 at 19:51

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:
[QUOTE]
$ 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
[/QUOTE]
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:
[QUOTE]
Options -MultiViews
PassengerResolveSymlinksInDocumentRoot on
#Change to your environment
RailsEnv production
RailsBaseURI /
SetEnv GEM_HOME /home/myname/ruby/gems
[/QUOTE]
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):
[QUOTE]
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request
….
[/QUOTE]
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).
[QUOTE]
Application error
Rails application failed to start properly
[/QUOTE]
Am I missing some step somewhere?
Thanks in advance for all your help,
Anirvan

    marco · 2012-05-17 at 12:31

    Sorry, don’t have a bluehost account anymore, I moved to dreamhost. I still happily use redmine though. ciao

Symfony project on (bluehost) shared hosting @ GIS and Web Tricks · 2009-07-10 at 09:55

[…] to install redmine follow my previous post, disable the “autofetch commits” option in the administration page […]

Installing Redmine on bluehost · 2010-11-21 at 07:39

[…] installing redmine on a bluehost server, and thanks to scripts like this one, most of everything is covered (except the RAILS_ENV=production rake […]

Installing redmine on Bluehost | d3fin3.me · 2011-03-31 at 07:09

[…] Knowledge Base Berna Web Design This entry was posted in Redmine, Web-based Software. Bookmark the permalink. ← Igniting […]

Installing Redmine on bluehost - Admins Goodies · 2011-08-19 at 15:47

[…] installing redmine on a bluehost server, and thanks to scripts like this one, most of everything is covered (except the RAILS_ENV=production rake […]

Leave a Reply