Redmine

From DreamHost

Jump to: navigation, search
The instructions provided in this article or section are considered advanced.

You are expected to be knowledgeable in the UNIX shell.
Support for these instructions is not available from DreamHost tech support.
Server changes may cause this to break. Be prepared to troubleshoot this yourself if this happens.
We seriously aren't kidding about this. Read the blinky part again.

The instructions provided in this article or section require shell access unless otherwise stated.

You can use the PuTTY client on Windows, or SSH on UNIX and UNIX-like systems such as Linux or Mac OS X.
Your account must be configured for shell access in the Control Panel.
More information may be available on the article's talk page.

Contents


This article describes how to install Redmine, an integrated Wiki and Issue Tracker with support for Subversion. These instructions assume you will be doing this on a shared host (DreamHost).

Installation

For help on using the shell you can take a look at the UNIX commands and you can also get help on changing directories.

If you want to save the output for debugging and support then you can look at the Redirection Symbol.

Instructions

Note: As of 0.8-stable, Step 14 is not required; The default .htaccess file works just fine.

From Alan Daveline’s Blog About Everything

  1. From the Dreamhost control panel, create a new subdomain for the application such as yoursubdomain.yourdomain.com
        1. Make sure the domain supports “Ruby on Rails Passenger (mod_rails)?”
        2. Specify your web directory: /home/username/yoursubdomain.yourdomain.com/public
               * you must add the public!!!
  2. From the Dreamhost control panel create a new MySQL database named yourdatabasename
  3. ssh into your Dreamhost account
  4. cd ~/yoursubdomain.yourdomain.com
  5. svn export --force svn://rubyforge.org/var/svn/redmine/branches/0.7-stable ./
         * check http://www.redmine.org/wiki/redmine/Download for the latest version
  6. also watch out for permissions
         * chmod -v -R 755 ./*
  7. cd ~/yoursubdomain.yourdomain.com/config
  8. cp database.yml.example database.yml
  9. nano database.yml
        1. edit the database.yml config file with the appropriate info. Should be similar to the following
           production:
           adapter: mysql
           database: yourdatabasename
           username: yourusername
           password: yourpassword
           host: mysql.yourdomain.com
 10. cd ~/yoursubdomain.yourdomain.com/public
 11. cp dispatch.rb.example dispatch.rb
 12. cp dispatch.fcgi.example dispatch.fcgi
 13. cp dispatch.cgi.example dispatch.cgi
 14. nano .htaccess (replace with following text)
     Options +FollowSymLinks +ExecCGI
     RewriteEngine On
     RewriteRule ^$ index.html [QSA]
     RewriteRule ^([^.]+)$ $1.html [QSA]
     RewriteCond %{REQUEST_FILENAME} !-f
     ErrorDocument 500 "H2Application errorH2 Rails application failed to start properly"
         * replace the H2 with the proper HTML tag when you place it in the .htaccess
 15. cd ~/yoursubdomain.yourdomain.com
 16. from application root type
         * rake db:migrate RAILS_ENV="production"
 17. also type the following to load config defaults
         * rake redmine:load_default_data RAILS_ENV="production"
         * choose "en" for english
 18. browse to http://yoursubdomain.yourdomain.com

Sending Email

From Matt Jones' Blog

In order to get Redmine to send emails, you will need to update config/environment.rb

Find the following code:

	# SMTP server configuration
	config.action_mailer.smtp_settings = {
		:address => "127.0.0.1",
		:port => 25,
		:domain => "somenet.foo",
		:authentication => :login,
		:user_name => "redmine@somenet.foo",
		:password => "redmine",
	}
	
	config.action_mailer.perform_deliveries = true

	# Tell ActionMailer not to deliver emails to the real world.
	# The :test delivery method accumulates sent emails in the
	# ActionMailer::Base.deliveries array.
	#config.action_mailer.delivery_method = :test
	config.action_mailer.delivery_method = :smtp  

Update the domain, user_name and password values if using SMTP.

To use Sendmail, change the above code to:

	# SMTP server configuration
	config.action_mailer.smtp_settings = {
		:address => "127.0.0.1",
		:port => 25,
		:domain => "yourdomain",
		:authentication => :plain,
	}
	
	config.action_mailer.perform_deliveries = true

	# Tell ActionMailer not to deliver emails to the real world.
	# The :test delivery method accumulates sent emails in the
	# ActionMailer::Base.deliveries array.
	#config.action_mailer.delivery_method = :test
	config.action_mailer.delivery_method = :sendmail  

Don't forget to restart Passenger by adding the file restart.txt to the tmp folder.

  • Once you add the tmp/restart.txt file to restart redmine change directory (cd) to the root of the redmine install and issue the following command to restart the redmine application.
touch tmp/restart.txt

Jed.schneider

Using Redmine 0.8 With Google Apps and Passenger

With the stable release of Redmine 0.8 comes the use of the email.yml config file to replace the above SMTP Server Configuration code from the above Redmine#Sending Email section.

First, make sure you have created the email account and logged into the account once from your mail.example.com webmail application. Then, proceed with the following:

A default yml config file is supplied as part of the Redmine install in the config directory: email.yml.example To copy...

cp email.yml.example email.yml

Now open email.yml in your favorite editor and change the production settings, saving once edited.

# Outgoing email settings

production:
  delivery_method: :smtp
  smtp_settings:
    address: smtp.gmail.com
    port: 587
    domain: your.domain.using.gmail.without.the.dotmail.subdomain.com
    authentication: :login
    user_name: your.username@your.domain.using.gmail.without.the.dotmail.subdomain.com
    password: yourpassword

Note that the domain doesn't include the mail subdomain, so if your site is example.com and you are using dreamhost and Google Apps, then your mail server is mail.example.com, just use example.com! The email address needs to be fully qualified.

  • Note: yml is whitespace sensitive, use spaces, not tabs.

You have to include some methods written to handle the SSL connection with the gmail server. This is a two step process, including the class, and installing the class in your lib directory.

Open the config/environments/production.rb file with your text editor. A require statement in ruby is like an import statement in java, it needs to go above the method calls, so above the first config call add the following:

   require 'smtp_tls'

And save your changes. You can name the class anything you want but this was the name of the file created by the guys at expandrive.com to do this exact process: http://blog.expandrive.com/2008/12/04/redminerails-email-through-gmail-smtp/comment-page-1/ But Dan Cameron posted a more specific solution to google apps on the redmine.org forum, so I used that script and just renamed it (url in source code below).

    cd /lib
    curl -O http://gist.github.com/raw/44466/c3875f981d37dfdc1685882f58937ef3dcb1b38e/gistfile1.rb
    cp gistfile1.rb smtp_tls.rb

Finally, restart Redmine as detailed in the Redmine#Sending Email section above and go to the Administration->Settings->Email Notifications and send a test email. You should get a green message notifying you that the mail was successfully sent. Jed.schneider

Features

  • Bug and Feature Tracker
  • Wiki
  • MySQL, PostgreSQL support
  • Unicode Support
  • Svn, git, mercurial, bazzaar repository support.

Link a new repository

When a new project is made you will probably link a repository to it. Go to the project. Then settings -> repository -> Create. Choose the repository type and enter its full local path. For example, for git:

 /home/username/repodict/.git

It is important to tell Redmine to look for new repositories. Execute this line:

 ruby /home/username/sub.domain.com/script/runner "Repository.fetch_changesets" -e  production

Change production for any envirorment you made.

Logging In

Username: admin Password: admin

Please login and change the administrator password as soon as possible

Installing trunk

The big advantage to installing trunk, as opposed to a stable version of Redmine, is that it works with the Rails 2.2.2, which is what Dreamhost installs for you. Things work exactly like the above instructions except:

  1. Use "svn export --force svn://rubyforge.org/var/svn/redmine/trunk redmine" to check it out
  2. Do a "rm -r public ; ln -s redmine/public public" when you're in your subdomain.yourdomain.com directory
  3. You can skip step 14 (changing the .htaccess)...or maybe not? If it doesn't work, then change your .htaccess
  4. You have to create a session key. Do this as early on as you can. Edit your subdomain.yourdomain.com/redmine/config/environment.rb to include a "config.action_controller.session = { :session_key => "_myapp_session", :secret => "aoeuaoeuaoeuaoeuaoeu" }" (where "aoeuaoeuaoeuaoeuaoeu" is some 30+ character long random string which no one will ever be able to guess). If you get "500 Internal server errors", it's probably because you forgot to do this part. If you do this part and you STILL get "500 Internal server errors", restart your server. You can do this by going to the Dreamhost panel, editing "subdomain.yourdomain.com" (from "Managing domains") and then saving the changes (even though you didn't make any changes).
  5. Make sure you uncomment the RAILS_ENV ||= 'production' line in config/environment.rb

How to Fix Redmine if Dreamhost Upgrades to a Newer Version of Rails

Sometimes Dreamhost upgrades Rails, which can break Redmine since it currently only works with the older versions of Rails, 2.0.2 or lower. For example, Dreamhost upgraded several servers to Rails 2.2.2 on 1/5/09, breaking several Redmine instances. In the user discussion that followed this event, one helpful Dreamhost customer shared the following steps for re-installing Rails 2.0.2 and "freezing" Redmine so that it will continue using the old version, even if Dreamhost upgrades Rails again in the future. (Note: the original discussion can be viewed at http://www.dreamhoststatus.com/2009/01/05/hooray-another-rails-upgrade/):

  1. Remove old Rails installations (these overcome the "the rack(0.3.0 not >= 0.9.0)" error.):
     rm -fR /home/YOUR_DOMAIN/.gem
     rm -fR /home/YOUR_DOMAIN/REDMINE_DIR/vendor/rails
  2. Edit REDMINE_DIR/config/environment.rb and ensure it has the following lines:
     RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION
     ENV['GEM_PATH'] = '/home/YOUR_DOMAIN/.gem:/usr/lib/ruby/gems/1.8'
  3. Navigate to your Redmine directory and install ROR v2.0.2 (highest version of Rails supported by Redmine):
     gem install -v=2.0.2 rails
     Note: You will probably get 2 WARNINGs - we have taken these into account in step 2.
  4. Freeze your Redmine to use 2.0.2 and nothing else:
     rake rails:freeze:edge TAG=rel_2-0-2
     IMPORTANT: Do NOT type “rake rails:freeze:gems” - this breaks it again. Also, I did not need to run “rake rails:update”.
  5. Replace REDMINE_DIR/config/boot.rb with REDMINE_DIR/vender/rails/railties/environments/boot.rb. This overcomes the “undefined method 'install_gem_spec_stubs' for #)” error.

Note: You may experience a small delay (up to an hour?) before Redmine starts working again.

Alternative Packages

Bugzilla

Mantis is a PHP bug tracker

Trac

Personal tools