Redmine is a flexible project management web application written in the Ruby on Rails framework, it is cross-platform and cross-database and is an open source project released under the terms of the GNU General Public License v2 (GPL).
Redmine requires Ruby on Rails support which is an open source web application framework that runs on the Ruby programming language.
Here I am going to explain how to install Redmine 2.3.X with the latest rails (3.2) support in a source compiled method on a fresh ubuntu based linux server.
First we need to install all the dependencies for building ruby on rails, For that issue the following commands,
apt-get update
apt-get install gcc g++ mysql-server libmysqlclient-dev libssl-dev zlibc
Now we can start installing Ruby,
Download the latest package from the link below
ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
tar -zxvf ruby-1.9.3-p0.tar.gz
cd ruby-1.9.3-p0
./configure
make && make install
Now install the package manager RubyGems,
Download from this link,
http://files.rubyforge.vm.bytemark.co.uk/rubygems/rubygems-1.8.25.tgz
tar -zxvf rubygems-1.8.25.tgz
cd rubygems-1.8.25
ruby setup.rb
After the installation ends, we can see a message like this,
RubyGems 1.8.25 installed
RubyGems installed the following executables:
/usr/local/bin/gem
Now start installing Rails and Rack using the gem package manager as follows,
gem install rails
gem install rack
gem install rake
Install redmine by downloading it from the following link,
http://files.rubyforge.vm.bytemark.co.uk/redmine/redmine-2.3.1.tar.gz
tar -zxvf redmine-2.3.1.tar.gz
mkdir /var/www/html/
mv redmine-2.3.1 /var/www/html/redmine
None prepare the mysql database for Redmine..
mysql -u root -p<password>
mysql>create database redmine character set utf8;
mysql>grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'redmine.pass';
mysql>/q
Copy the file config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for "production" environment.
cd /var/www/html/redmine/
cp config/database.yml.example config/database.yml
vim config/database.yml
production:
adapter: mysql2 <--- for Redmine 2.X
database: redmine
host: localhost
port: 3306
username: redmine
password: redmine.pass
:wq
Redmine uses Bundler to manage gems dependencies, You need to install Bundler first:
gem install bundler
Then you can install all the gems required by Redmine using the following command,
bundle install --without development test rmagick postgresql sqlite
bundle show mysql2 <-- show mysql2 adapter support
Now Generate a session store secret. This step generates a random key used by Rails to encode cookies storing session data. For that issue the below command ..
rake generate_secret_token
<ENTER>
Now we need to create the database structure, by running the following command under the application root directory,
cd /var/www/html/redmine/
RAILS_ENV=production rake db:migrate
Insert default configuration data in database, by running the following command,
RAILS_ENV=production rake redmine:load_default_data
Setting up permissions,
mkdir /var/www/html/redmine/public/plugin_assets/
chown -R redmine.redmine files log tmp public/plugin_assets/
chmod -R 755 files log tmp public/plugin_assets/
We can test the installation by running WEBrick web server, for that follow the command below.
ruby script/rails server webrick -e production
Once WEBrick has started, point your browser to http://<ip>:3000. You should now see the application welcome page.
Use default administrator account to log in
login : admin
password : admin
Hit ctrl+c to shut down the application.
For running Redmine under Apache follow the steps below,
Install apache and some dependencies by issuing the following commands,
apt-get install apache2 apache2-prefork-dev libapr1-dev libaprutil1-dev libcurl4-openssl-dev
groupadd -g 48 apache
useradd -u 48 -g 48 apache -s /bin/false
vim /etc/apache2/envvars
user apache
group apache
:wq
chown -R apache.apache /var/www/html/redmine/
Here I am using Passenger support for Apache to run rails application. Phusion Passenger is an application server which can directly integrate into Apache. It is designed to be fast, stable, reliable and it supports applications written in multiple programming languages. At this time, Ruby and Python are supported.
Install the passenger support using gem package manager,
gem install passenger
Now install the apache passenger module as shown below
ruby /usr/local/lib/ruby/gems/1.9.1/gems/passenger-4.0.2/bin/passenger-install-apache2-module
This will create a mod_passenger.so file.
Now, create a file passenger.load
vim /etc/apache2/mods-available/passenger.load
LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-4.0.2/libout/apache2/mod_passenger.so
create a file passenger.conf
vim /etc/apache2/mods-available/passenger.conf
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-4.0.2
PassengerDefaultRuby /usr/local/bin/ruby
Enable the two modules,
a2enmod passenger
a2enmod rewrite
Deploying a Ruby on Rails application.
Suppose you have a Rails application in /somewhere. Add a virtual host to your Apache configuration file and set its DocumentRoot to /somewhere/public
vim /etc/apache2/sites-available/default
<VirtualHost *:80>
ServerName redmine.yourhost.com
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /var/www/html/redmine/public
RailsEnv production
RailsBaseURI /redmine
<Directory /var/www/html/redmine/public>
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>
/etc/init.d/apache2 restart
Redmine will be listening at http://redmine.yourhost.com
Installing a plugin
Copy your plugins into plugins directory. If you are using GitHub, you can do so by changing into your plugin directory and issuing a command,
git clone git://github.com/user_name/name_of_the_plugin.git
Run the following command to upgrade your database,
rake redmine:plugins:migrate RAILS_ENV=production
Now Restart Redmine
You should now be able to see the plugin list in Administration -> Plugins.
Uninstalling a plugin
Run the following command to downgrade your database,
rake redmine:plugins:migrate NAME=plugin_name VERSION=0 RAILS_ENV=production
Remove the plugin from the plugins directory.
Thanks for reading ..
Cheers /-
No comments:
Post a Comment