ItecSoftware Logo

Install Redmine Passenger via Apache on Ubuntu

Written by Peter Gilg on - like this:
install redmine passenger

Installing Redmine on any system has been a daunting task for many, especially working thru countless dependencies and linking apps to make the application available via Apache.

Since Ubuntu 10.04, Redmine can now be installed via apt or aptitude, and no doubt the process is much easier, but by no means just as straight forward as we’re used to with other apps available from the repositories.

To get Redmine up and running over Apache on Ubuntu 10.04, we are going to install redmine passenger and these basic steps are required:

  1. Install Apache2, Mysql Server, Subversion, extensions and utilities
  2. Install Redmine via apt
  3. Test Redmine using Webrick
  4. Install Passenger

1. Install Apache, Mysql Server and necessary extensions and utilities

$ sudo apt-get install build-essential apache2 apache2-threaded-dev apache2-suexec-common libapache2-svn libmysqlclient15-dev

2. Install and configure Redmine

$ sudo apt-get install redmine redmine-mysql subversion

Redmine will then be installed in /usr/share/redmine and configuration data in /etc/redmine. We can then simply symlink the public web directory to our preferred location, eg:

$ ln -s /usr/share/redmine/public /var/www/redmine

(Update: as RandomGuy points out in his comment below, Install the Ruby 1.8 dev package, the default one is missing some important files…)

$ sudo apt-get install ruby1.8-dev

In addition, we want to configure Redmine’s database access. Let’s modify /etc/redmine/default/database.yml and add appropriate values for your environment:

production:
  adapter: mysql
  database: redmine
  host: localhost
  username: redmine
  password: password
  encoding: utf8

Now we proceed to create the session store and the databases with seed data:

$ rake generate_session_store
$ RAILS_ENV=production rake db:migrate
$ RAILS_ENV=production rake redmine:load_default_data

3. Test Redmine using Webrick

At this point we should be able to start webrick from our redmine installation folder, Redmines internal web server and test the basic installation on port 3000:

 $ ruby script/server webrick -e production

then open http://localhost:3000 in a browser and we should see Redmine homepage. If not, re-check all previous steps and pay attention to file permission settings.

4. Install Passenger Apache module

In order to compile and enable passenger in Apache, we need to download the Redmine source code from RubyForge. Then on to installing the gem and compile the Apache extension and enabling it:
 $ sudo gem install passenger
 $ sudo /var/lib/gems/1.8/bin/passenger-install-apache2-module

Set the Rails Base URL in the Apache config before enabling the module and restart Apache:
<Directory /var/www/redmine>
    RailsBaseURI /redmine
    PassengerResolveSymlinksInDocumentRoot on
</Directory>
$ sudo a2enmod passenger
$ /etc/init.d/apache2 restart

And that’s it. If things don’t work out smooth for you, make sure to pay attention to any error messages you might be given and if you hit a wall, drop us a comment and we’ll try to help.

Listed in Linux, Ubuntu, Web Development

Tags: apache2, redmine, ubuntu 10.04, webrick

9 responses to “Install Redmine Passenger via Apache on Ubuntu”

  1. Gulab Pasha says:

    Hi,

    gem installation is giving some error.

    root@mybhumi:/usr/share/redmine# gem install passenger
    Building native extensions. This could take a while…
    ERROR: Error installing passenger:
    ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.8 extconf.rb
    extconf.rb:8:in `require’: no such file to load — mkmf (LoadError)
    from extconf.rb:8

    Gem files will remain installed in /var/lib/gems/1.8/gems/fastthread-1.0.7 for inspection.
    Results logged to /var/lib/gems/1.8/gems/fastthread-1.0.7/ext/fastthread/gem_make.out

  2. Gulab Pasha says:

    Hi,

    I have configure redmine in my ubuntu 10.04 server and it working fine with port 3000.

    And now i have configure passenger to work redmine with apache2 on port 80. But it is not working

    It is still working with port 3000.

    Do i have to restart the redmine to work with default port 80.

    Please help

  3. Peter says:

    Hi Gulab,

    you should check if passenger is loaded by running “php -i” or check phpinfo().
    Also when building passenger, you will need to download the redmine source code, despite the fact that you already installed it using apt or aptitude, and build it from there.

  4. RandomGuy says:

    For those who get the gem install FAILED error:
    Install the Ruby 1.8 dev package, the default one is missing important files…

    sudo apt-get install ruby1.8-dev

    Source: http://railsforum.com/viewtopic.php?id=22116

  5. Srinivas HN says:

    hi i am having the error while installing the rake

    error says
    rake aborted!
    No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
    /usr/lib/ruby/1.8/rake.rb:2377:in `raw_load_rakefile’
    (See full trace by running task with –trace)

    please help me on this

  6. Srinivas HN says:

    Hi i am able to run the webrick but in the apache configuration am not able set RailsBaseURI am getting Invalid command ‘RailsBaseURI
    i have installed the passenger module and enabled when i put the urails url in the apache’s site-available and if i try to restart the apache its giving this prolem

    Thanks

  7. Peter says:

    Srinivas – did you download the redmine source code and build/compile passenger from there?

  8. Sipickles says:

    How do you build the redmine source? I am only familiar with configure/make system. Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *