Install Redmine Passenger via Apache on Ubuntu
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:
- Install Apache2, Mysql Server, Subversion, extensions and utilities
- Install Redmine via apt
- Test Redmine using Webrick
- 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.