Nov
12
2010
Continuing on from our last post Redmine Project Management on Debian Lenny, here we will setup Ruby on Rails (and thus Redmine) to run through Apache2, using Passenger (aka mod_rails).
This is a fairly brief step by step guide and assumes you are familiar with Debian, the command line, and tools like apt-get and ruby gems.
- Install passenger:
sudo gem install passenger
- Setup passenger in Apache. Run this command and follow the instructions:
sudo passenger-install-apache2-module
- When it asks you to edit the Apache config file, do it like so (using the contents given to you by the program):
Create /etc/apache2/mods-available/passenger.load with the contents:
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/ext/apache2/mod_passenger.so
Create /etc/apache2/mods-available/passenger.conf with the contents:
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.14
PassengerRuby /usr/bin/ruby1.8
Enable passenger module:
a2enmod passenger
Note: Make sure you use the values provided by the program and do not simply copy & paste what is here!
- Edit the Virtual host file to something like this:
<VirtualHost *>
ServerName redmine.mydomain.com
DocumentRoot /var/redmine/1.0-stable/public
RailsEnv production
</VirtualHost>
Note: The document root cannot be a softlink, because the dispatch script of rails will change directory using “../”
- Restart Apache and all should be good:
sudo /etc/init.d/apache2 restart
- Test by going to http://redmine.mydomain.com
no comments
| posted in Server
Nov
12
2010
Redmine is an Open Source web based project management tool. It’s self hosted (i.e you install it on your own server), and features Issue Tracking, Wiki, Source control management and more.
Here we will setup Redmine on a Debian Lenny server, using Ruby on Rails & Apache2.
This is a fairly brief step by step guide and assumes you are familiar with Debian, the command line, and tools like apt-get and ruby gems.
- Install Ruby & build tools:
sudo apt-get install ruby ruby-dev build-essential libopenssl-ruby1.8
- Install Ruby gems. We have to do this manually because the Debian port is out of date:
wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
tar -xzvf rubygems-1.3.7.tgz
cd rubygems-1.3.7
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
- Install Ruby Gem packages:
sudo gem install rails -v=2.3.5
sudo gem install rack -v=1.0.1
sudo gem install mysql
- Download Redmine:
sudo mkdir /var/redmine
cd /var/redmine
sudo svn co http://redmine.rubyforge.org/svn/branches/1.0-stable
- Create a user & database in MySQL for ‘redmine’. You can do this via mysql command line, or PHPMyAdmin. Ensure the user has all privileges to the redmine database.
- Create the db config file for Redmine:
cd /var/redmine/1.0-stable/config
sudo cp database.yml.example database.yml
Edit this file with the correct settings for production.
- Create some default data in the DB:
RAILS_ENV=production rake redmine:load_default_data
- Generate the session store secret, and create the DB tables:
rake generate_session_store
RAILS_ENV=production rake db:migrate
- Setup file permissions:
cd /var/redmine/1.0-stable
sudo mkdir tmp public/plugin_assets
sudo chown -R www-data:www-data files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets
- Test the server now using:
sudo ruby script/server webrick -e production
Find it at http://localhost:3000/ (you may need to open the firewall).
You can stop webrick using CTRL+C.
The default user account is: admin / admin
Now to setup Ruby on Rails with Apache2.
no comments
| posted in Server