viernes, 23 de marzo de 2012

Install redmine 1.3.2 on ubuntu server 11.10 with Apache + Passenger

Redmine is a powerful issue tracker and project management web application. This tutorial explains how install the last version of redmine 1.3.2 on a Ubuntu server 11.10 with MySQL, Apache and Passenger.


To start, install the following packages. When asked type the root password for the MySQL database.

 sudo apt-get install git-core build-essential ruby1.8-dev rubygems rake mysql-server libmysqlclient-dev  

Install Rack and Rails gems

 sudo gem install rack -v=1.1.3
 sudo gem install rails -v=2.3.14
 sudo gem install mysql
 sudo gem install rdoc 

You can add the --http-proxy http://user:password@proxy_ip_address:port to install gems behind a proxy server.

Configure mysql database, create a new database named redmine, add the redmine user and grant administrative rights to redmine database:

 mysql -u root -p  
 mysql> CREATE DATABASE redmine DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;  
 mysql> CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'type_user_password';  
 mysql> GRANT ALL privileges ON redmine.* TO 'redmine'@'localhost';  
 mysql> exit

Download the latest version of Redmine from its Git repository. Optional if you are behind a proxy you need to configure its address with:

 git config --global http.proxy http://user:password@proxy_ip_address:port  

Download Redmine project to /opt directory:

 cd /opt  
 sudo git clone http://github.com/edavis10/redmine.git  
 cd redmine  
 sudo git checkout -b 1.3.2 1.3.2  

Configure Redmine:

 sudo cp config/database.yml.example config/database.yml  
 sudo nano config/database.yml  

Remove the contents of the file and type:

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

Add required directories:

 sudo mkdir -p /opt/redmine/tmp /opt/redmine/public/plugin_assets  
 sudo mkdir /opt/redmine/tmp/pids  

Add required rights:

 sudo chown -R www-data:www-data files log tmp public/plugin_assets  
 sudo chmod -R 755 files log tmp public/plugin_assets  
 sudo chmod -R 777 files public/plugin_assets  

Finish redmine configuration:

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

Test redmine without Apache:

 sudo ruby script/server webrick -e production  

Now you can go to http://server_address:3000 and check if everything works. Type Ctrl+Z to stop the server.

Configure Apache to work with Redmine and Passenger: Add the required packages:

 sudo apt-get install apache2 apache2-prefork-dev libapr1-dev libaprutil1-dev libcurl4-openssl-dev  
 sudo gem install passenger  
 sudo ruby /var/lib/gems/1.8/gems/passenger-3.0.11/bin/passenger-install-apache2-module 

Add passenger to apache:

 sudo nano /etc/apache2/mods-available/passenger.load  

Type the following text:

 LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.11/ext/apache2/mod_passenger.so  

Configure passenger:

 sudo nano /etc/apache2/mods-available/passenger.conf  

Type the following text:

 PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.11  
 PassengerRuby /usr/bin/ruby1.8  

Enable Apache modules:

 sudo a2enmod passenger  
 sudo a2enmod rewrite  

Add a link from redmine to the www directory:

 sudo ln -s /opt/redmine/public/ /var/www/redmine  

Configure Apache:

 sudo nano /etc/apache2/sites-available/default  

Type the following text:

 <VirtualHost *:80>  
      ServerAdmin webmaster@localhost  
      DocumentRoot /var/www  
      RailsEnv production  
      RailsBaseURI /redmine  
      <Directory /opt/redmine/public/>  
           Options FollowSymLinks  
           AllowOverride None  
           Order deny,allow  
           Allow from all  
      </Directory>  
      ErrorLog ${APACHE_LOG_DIR}/error.log  
      # Possible values include: debug, info, notice, warn, error, crit,  
      # alert, emerg.  
      LogLevel warn  
      CustomLog ${APACHE_LOG_DIR}/access.log combined  
 </VirtualHost>  

Additionally add RMagick library:

 sudo apt-get install librmagick-ruby1.8  

Restart the Apache server:

 sudo service apache2 restart  

And that's all, go to http://server_address/redmine to start using redmine. Use "admin" as administrator user and password.

3 comentarios:

  1. I just came to your blog and want to say that I enjoyed reading your blog post. I hope you will post again soon. We Appreciate your work. If you need any kind of information related toAutomate Software Testing, then you can contact us.

    ResponderEliminar
  2. Este comentario ha sido eliminado por el autor.

    ResponderEliminar
  3. Your blog has all the information I was looking for for a long time. I want to thank you for sharing such important information with us. I will share your blog with my friends. I wish you to keep sharing such important blogs with us in the future also. Apart from this, if you ever need software testing services then you can get all the information by clicking on the given link.

    ResponderEliminar