terça-feira, 25 de outubro de 2011

Installing RedMine on CentOS 5.5 ( includes compatible versions of Ruby, RubyGems and Rails with OpenLDAP)


1. Installing some Packages dependencies

# yum install gcc cc cl.exe
# yum install zlib zlib-devel
# yum groupinstall "Development Tools"
# yum install mysql-devel
# yum install libncurses5 libreadline5



2. Download and install Ruby

# mkdir /opt ; mkdir /opt/ruby
# cd /opt/ruby
# wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz
# tar -xzvf ruby-1.8.7-p72.tar.gz
# cd ruby-1.8.7-p72
# ./configure
# make
# make install



3. Download and Install RubyGems

# cd /opt/ruby
# wget http://rubyforge.org/frs/download.php/74445/rubygems-1.6.2.tgz
# tar -xzvf rubygems-1.6.2.tgz
# cd rubygems-1.6.2
# ruby setup.rb   # nao pode ser a mais atualizada


4. Install RubyGems Rake, Rack and Rails

# gem install rake  -v '0.8.7'
# gem install rack  -v=1.1.1
# gem install rails -v=2.3.11


5. Install LDAP dependencies

# yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel
#
# cd /etc/yum.repos.d
# rpm --import http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco
# wget http://opensource.wandisco.com/WANdisco-rhel5.repo
# yum install gcc gcc-c++ curl-devel zlib-devel kernel-devel dkms
# yum install httpd httpd-devel 
# yum install mod_dav_svn subversion subversion-tools subversion-devel
# yum install mod_perl mod_perl-devel perl-Apache-DBI perl-Digest-SHA1 perl-LDAP
#
# perl -MCPAN -e shell
  Are you ready for manual configuration? [yes] 
  CPAN build and cache directory? [/root/.cpan] 
  Cache size for build directory (in MB)? [10] 
  Perform cache scanning (atstart or never)? [atstart] 
  Cache metadata (yes/no)? [yes] 
  Your terminal expects ISO-8859-1 (yes/no)? [yes] 
  File to save your history? [/root/.cpan/histfile]
  Number of lines to save? [100] 
  Policy on building prerequisites (follow, ask or ignore)? [ask] 
  Where is your gzip program? [/bin/gzip]
  Where is your tar program? [/bin/tar] 
  Where is your unzip program? [/usr/bin/unzip]
  Where is your make program? [/usr/bin/make] 
  Where is your links program? [/usr/bin/links] 
  Where is your wget program? [/usr/bin/wget] 
  Warning: ncftpget not found in PATH
  Where is your ncftpget program? /usr/bin/ncftpget
  Where is your ftp program? [/usr/kerberos/bin/ftp] 
  Where is your gpg program? [/usr/bin/gpg]
  What is your favorite pager program? [/usr/bin/less] 
  What is your favorite shell? [/bin/bash] 
  Your choice:  [] 
       :
  cpan> install Authen::Simple::LDAP
       :
       a lot of <enter> 
       :
#
# gem install passenger
# passenger-install-apache2-module



6. Download RedMine

# mkdir /opt/redmine
# cd /opt/redmine
# wget http://rubyforge.org/frs/download.php/75097/redmine-1.2.1.tar.gz


7. Install RedMine


# cd /opt/redmine
# tar -xzvf redmine-1.2.1.tar.gz
# cd /opt/redmine/redmine-1.2.1
# chown -R root:root /opt/redmine/redmine-1.2.1






8. Install RedMine dependencies


# gem install rake     -v '0.8.7'
# gem install rack     -v=1.1.1
# gem install rails    -v=2.3.11
# gem install i18n     -v '0.4.2'
# gem install mysql    # or mysql2 '~> 0.2.7'

# yum install -y libxml2 libxml2-devel libxslt libxslt-devel


9. Create MySql Database for Ruby environments (Production, Development and Test)


# mysql -u root -p
mysql> create database redmine_prod character set utf8;
mysql> create database redmine_dev character set utf8;
mysql> create database redmine_test character set utf8;
mysql> create user 'redmine'@'localhost' identified by 'r3dm1n3';
mysql> grant all privileges on redmine_prod.* to 'redmine'@'localhost';
mysql> grant all privileges on redmine_dev.* to 'redmine'@'localhost';
mysql> grant all privileges on redmine_test.* to 'redmine'@'localhost';
mysql> exit



10. Configure all Ruby environments (Production, Development and Test)


# cd /opt/redmine/redmine-1.2.1
# cp config/database.yml.example config/database.yml
# vim config/database.yml
  +----------------------------+
  | production:                |
  |   adapter: mysql           |
  |   database: redmine_prod   |
  |   host: localhost          |
  |   username: redmine        |
  |   password: r3dm1n3        |
  |   encoding: utf8           |
  |                            |
  | development:               |
  |   adapter: mysql           |
  |   database: redmine_dev    |
  |   host: localhost          |
  |   username: redmine        |
  |   password: r3dm1n3        |
  |   encoding: utf8           |
  |                            |
  | test:                      |
  |   adapter: mysql           |
  |   database: redmine_test   |
  |   host: localhost          |
  |   username: redmine        |
  |   password: r3dm1n3        |
  |   encoding: utf8           |
  +----------------------------+


11. Initialize Ruby database environments (PRODuction and DEVelopment)

# rake generate_session_store
# RAILS_ENV=production  rake db:migrate
# RAILS_ENV=development rake db:migrate

# RAILS_ENV=production rake redmine:load_default_data
  Select language: [en]

# RAILS_ENV=development rake redmine:load_default_data
  Select language: [en]



12. Adjusting apache permission and creating symbolic link

# chown -R apache:apache files log tmp public/plugin_assets
# chmod -R 755 files log tmp public/plugin_assets
# ln -s /opt/redmine/redmine-1.2.1/public /var/www/html/redmine



13. Adjusting apache permission and creating symbolic link

# chown -R apache:apache files log tmp public/plugin_assets
# chmod -R 755 files log tmp public/plugin_assets
# ln -s /opt/redmine/redmine-1.2.1/public /var/www/html/redmine



14. Testing installation running a ad-hoc webapplication server

# ruby script/server webrick -e production
  • open following url in your browser http://localhost:3000
    • admin/admin



15. References




2 comentários:

  1. Gostaria de saber como configurar o Redmine pelo Apache e não pelo WebRick ???

    ResponderExcluir
  2. Gostaria de saber também, igual o Aluísio, como que sobe o redmine pelo apache. Aguardo resposta.

    ResponderExcluir