Sunday, December 25, 2011

Redmine on Ubuntu 10.10

Most tutorials for setting up Redmine on Ubuntu end with using Webbrick to test, but I wanted a production setup. This is a reconstruction of what finally worked (assuming no prior installs of ruby or rails, but a fully set up LAMP stack):

$ sudo apt-get install ruby-dev redmine
$ sudo gem install passenger
$ sudo apt-get install apache2-dev libapr1-dev libaprutil1-dev 
$ echo "export PATH=/var/lib/gems/1.8/bin:$PATH" >> ~/.bashrc
$ sudo /var/lib/gems/1.8/bin/passenger-install-apache2-module 
$ sudo a2enmod rewrite

$ sudo vim /etc/apache2/sites-enabled/000-default
LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.11
PassengerRuby /usr/bin/ruby1.8
...snip...
<VirtualHost *:80>
  ServerName redmine.yourdomain.ca
  DocumentRoot /usr/share/redmine/public
  <Directory /usr/share/redmine/public>
    AllowOverride all
    Options -MultiViews
  </Directory>
</VirtualHost>


And some bind, if you are running your own DNS...

$sudo vim /etc/bind/named.conf.local

...snip...
zone "yourdomain.ca" {
      type master;
      file "/var/lib/bind/yourdomain.ca.hosts";
};

$sudo vim /var/lib/bind/yourdomain.ca.hosts

$ttl 38400
yourdomain.ca.    IN    SOA    tower110103. yourdomain.gmail.com. (
            1287417087
            10800
            3600
            604800
            38400 )
yourdomain.ca.    IN    NS    ns1.yourdomain.ca.
yourdomain.ca.        IN     A       192.168.1.5
redmine.yourdomain.ca.    IN    A    192.168.1.5
ns1.yourdomain.ca.    IN    A    192.168.1.5    

Restart apache and bind

$ sudo /etc/init.d/apache2 restart
$ sudo /etc/init.d/bind9 restart



References

  • https://help.ubuntu.com/community/RubyOnRails
  • http://finiteline.homeip.net/index.php/programming/70-ruby/100-redmine-on-ubuntu-11-10
  • http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_Ubuntu
  • http://www.redmine.org/projects/redmine/wiki/HowTo_have_both_development_and_production_environment_available_from_Apache_with_VirtualHost