2012年7月14日 星期六

Redmine 2.0.3 安裝筆記 ( Redmine 專案管理系統)

Redmine 專案管理系統
使用平台為 CentOS 6.3  [  LAMP ]

前置作業
yum install php php-mysql php-mbstring php-mcrypt php-gd  ImageMagick-devel freetype-devel ghostscript
yum install ruby*
gem update --system  
gem install rubygems-update
gem install bundler
gem install  rake
gem install  i18n
gem install  multi_json
gem install  builder
gem install  activemodel
gem install  erubis
gem install  journey
gem install  rack
gem install  rack-cache
gem install  rack-test
gem install  hike
gem install  tilt
gem install  sprockets
gem install  actionpack
gem install  mime-types
gem install  polyglot
gem install  treetop
gem install  mail
gem install  actionmailer
gem install  arel
gem install  tzinfo
gem install  activerecord
gem install  activeresource
gem install  bundler
gem install  coderay
gem install  fastercsv
gem install  json
gem install  metaclass
gem install  mocha
gem install  mysql
gem install  net-ldap
gem install  pg
gem install  rack-ssl
gem install  rdoc
gem install  thor
gem install  railties
gem install  rails
gem install  prototype-rails
gem install  ruby-openid
gem install  rack-openid
gem install  activesupport
gem install rmagick

下載與安裝 Redmine
cd /usr/local/src/
wget http://rubyforge.org/frs/download.php/76259/redmine-2.0.3.tar.gz
tar -zvxf redmine-2.0.3.tar.gz
mv redmine-2.0.3 redmine
mv redmine /var/www/html/
cd /var/www/html/
chown -R apache.apache redmine
chmod -R 755 redmine

cd /var/www/html/redmine

# gem list
*** LOCAL GEMS ***
actionmailer (3.2.6)
actionpack (3.2.6)
activemodel (3.2.6)
activerecord (3.2.6)
activeresource (3.2.6)
activesupport (3.2.6)
arel (3.0.2)
builder (3.0.0)
bundler (1.1.4)
coderay (1.0.7)
daemon_controller (1.0.0)
erubis (2.7.0)
fastercsv (1.5.5)
fastthread (1.0.7)
flexmock (0.8.6)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.4)
json (1.7.3)
mail (2.4.4)
metaclass (0.0.1)
mime-types (1.19)
mocha (0.12.0)
multi_json (1.3.6)
mysql (2.8.1)
net-ldap (0.3.1)
passenger (3.0.13)
pg (0.14.0)
polyglot (0.3.3)
prototype-rails (3.2.1)
rack (1.4.1)
rack-cache (1.2)
rack-openid (1.3.1)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.6)
railties (3.2.6)
rake (0.9.2.2, 0.8.7)
rdoc (3.12)
rmagick (2.13.1)
ruby-openid (2.2.0, 2.1.8)
rubygems-update (1.8.24)
shoulda (2.11.3)
sprockets (2.4.5, 2.1.3)
sqlite3 (1.3.6)
thor (0.15.4)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.33)
yard (0.8.2.1)
[root@CentOS63 src]#

# bundle install

Fetching gem metadata from http://rubygems.org/.......
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.3.6)
Using activesupport (3.2.6)
Using builder (3.0.0)
Using activemodel (3.2.6)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.6)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.6)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.6)
Using activeresource (3.2.6)
Using bundler (1.1.4)
Using coderay (1.0.7)
Using fastercsv (1.5.5)
Using json (1.7.3)
Using metaclass (0.0.1)
Using mocha (0.12.0)
Using mysql (2.8.1)
Using net-ldap (0.3.1)
Using pg (0.14.0)
Using rack-ssl (1.3.2)
Using rdoc (3.12)
Using thor (0.15.4)
Using railties (3.2.6)
Using rails (3.2.6)
Using prototype-rails (3.2.1)
Installing ruby-openid (2.1.8)
Using rack-openid (1.3.1)
Using rmagick (2.13.1)
Installing shoulda (2.11.3)
Installing sqlite3 (1.3.6) with native extensions
Installing yard (0.8.2.1)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
#
#gem install passenger
#passenger-install-apache2-module

[root@CentOS63 conf]# gem install passenger
Fetching: fastthread-1.0.7.gem (100%)
Building native extensions.  This could take a while...
Fetching: daemon_controller-1.0.0.gem (100%)
Fetching: passenger-3.0.13.gem (100%)
Successfully installed fastthread-1.0.7
Successfully installed daemon_controller-1.0.0
Successfully installed passenger-3.0.13
3 gems installed
Installing ri documentation for fastthread-1.0.7...
Building YARD (yri) index for fastthread-1.0.7...
Installing ri documentation for daemon_controller-1.0.0...
Building YARD (yri) index for daemon_controller-1.0.0...
Installing ri documentation for passenger-3.0.13...
Building YARD (yri) index for passenger-3.0.13...
Installing RDoc documentation for fastthread-1.0.7...
Installing RDoc documentation for daemon_controller-1.0.0...
Installing RDoc documentation for passenger-3.0.13...

# passenger-install-apache2-module

================================================

Welcome to the Phusion Passenger Apache 2 module installer, v3.0.13.
This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.
Here's what you can expect from the installation process:
 1. The Apache 2 module will be installed for you.
 2. You'll learn how to configure Apache.
 3. You'll learn how to deploy a Ruby on Rails application.
Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.
Press Enter to continue, or Ctrl-C to abort.
--------------------------------------------
Checking for required software...
 * GNU C++ compiler... found at /usr/bin/g++
 * Curl development headers with SSL support... found
 * OpenSSL development headers... found
 * Zlib development headers... found
 * Ruby development headers... found
 * OpenSSL support for Ruby... found
 * RubyGems... found
 * Rake... found at /usr/bin/rake
 * rack... found
 * Apache 2... found at /usr/sbin/httpd
 * Apache 2 development headers... found at /usr/sbin/apxs
 * Apache Portable Runtime (APR) development headers... found at /usr/bin/apr-1-config
 * Apache Portable Runtime Utility (APU) development headers... found at /usr/bin/apu-1-config
--------------------------------------------
Compiling and installing Apache 2 module...
...........
...........
............
--------------------------------------------
The Apache 2 module was successfully installed.
Please edit your Apache configuration file, and add these lines:
   LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.13/ext/apache2/mod_passenger.so
   PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.13
   PassengerRuby /usr/bin/ruby
After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!
Press ENTER to continue.

--------------------------------------------
Deploying a Ruby on Rails application: an example
Suppose you have a Rails application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:
   <VirtualHost *:80>
      ServerName http://www.yourhost.com/
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /somewhere/public   
      <Directory /somewhere/public>
         # This relaxes Apache security settings.
         AllowOverride all
         # MultiViews must be turned off.
         Options -MultiViews
      </Directory>
   </VirtualHost>
And that's it! You may also want to check the Users Guide for security and
optimization tips, troubleshooting and other useful information:
  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.13/doc/Users guide Apache.html
Enjoy Phusion Passenger, a product of Phusion (http://www.phusion.nl/) :-)
http://www.modrails.com/
Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.

=============================================================

cd /var/www/html/redmine/public/
cp dispatch.fcgi.example  dispatch.fcgi
cp htaccess.fcgi.example  htaccess.fcgi

cd /var/www/html/
chown apache.apache dispatch.fcgi
chown apache.apache htaccess.fcgi
chmod 755 dispatch.fcgi

cd  /var/www/html/redmine/config/
cp database.yml.example database.yml
設定 redmine DB 相關資訊
vi database.yml

Mysql> create database redmine character set utf8;
mysql> GRANT ALL ON redmine.* TO redmine@localhost IDENTIFIED BY 'redmine';
mysql> flush privileges;

Create Redmine Session Store
# RAILS_ENV=production bundle exec rake generate_session_store
Migrate the Database models
# RAILS_ENV=production bundle exec rake db:migrate
load Redmine defafut data ....
# RAILS_ENV=production bundle exec rake redmine:load_default_data
設定 Apache
vi /etc/httpd/conf/httpd.conf
Listen 8080
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.13/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.13
PassengerRuby /usr/bin/ruby
<VirtualHost *:8080>
 DocumentRoot /var/www/html/redmine/public
 ErrorLog logs/redmine_error_log
 <directory /var/www/html/redmine/publie >
   AllowOverride all
   Options -MultiViews
 </directory>
</VirtualHost>


沒有留言:

張貼留言