Notes on compiling Redmine 2.0.3 on CentOS 5.5

185 which ruby # check ruby’s verison

# required
186 yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel

# system info: Centos 5.5
# kernel version does not matter
188 cat /etc/motd
189 uname -a

# required
220 yum -y install openssl-devel readline-devel zlib-devel curl-devel libyaml-devel 221 yum install mysql-server mysql-devel
222 yum install httpd httpd-devel

# ruby’s version should be 1.9.3
227 lynx http://www.ruby-lang.org/ja/downloads/xvjf ruby-1.9.3-p194.tar.bz2 229 tar xvjf ruby-1.9.3-p194.tar.bz2
230 cd ruby-1.9.3-p194
232 ./configure ; make ; make install
233 cd

# check ruby’s version again
234 which ruby

# symlink, safer for standard $PATH
235 ln -s /usr/local/bin/ruby /usr/bin/
236 which ruby
237 whereis ruby
238 /usr/bin/ruby -v

# No gem now, let’s install
243 which gem
244 gem install bundler –no-rdoc –no-ri

# make UTF-8 default encoding for MySQL
249 cd /etc
250 ls my.cnf
251 cp my.cnf my.cnf.`date -I`.orig
252 vi my.cnf

# The change
[vuhung@ ~]$ diff /etc/my.cnf /etc/my.cnf.2012-08-08.orig
13,14d12
< character-set-server=utf8
<
18,23d15
<
<
< [mysql]
< default-character-set=utf8
<
<
[vuhung@ ~]$ cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks; # to do so, uncomment this line:
# symbolic-links=0

character-set-server=utf8

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[mysql]
default-character-set=utf8

# mysql -uroot -p
mysql> create database redmine default character set utf8;
mysql> grant all on redmine.* to redmine identified by ‘ flush privileges;
mysql> exit;

# restart mysql (to reload new configurations)
253 /etc/init.d/mysqld restart

# let’s make mysqld and httpd starts up on boot, by default
254 chkconfig mysqld on
255 chkconfig httpd on

# install redmine
261 cd /var/www/
263 wget http://rubyforge.org/frs/download.php/76259/redmine-2.0.3.tar.gz 264 gem install bundler

# yaml is needed by bundler
267 cd /usr/src/
270 wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz 271 tar xvzf yaml-0.1.4.tar.gz
272 cd yaml-0.1.4
273 ./configure –prefix=/usr/local/
274 make
275 make install

# reinstall (remake) ruby 1.9.3
276 cd ..
277 ls
278 cd ruby-1.9.3-p194
279 make clean
280 ./configure ; make ; make install
281 gem install bundler
282 bundle install –without development test
283 pwd
284 cd /var/www/

286 tar xvzf redmine-2.0.3.tar.gz

# symlink to redmine, for the sake of simplicity when cd’ing 288 ln -s redmine-2.0.3 redmine
289 cd redmine

298 bundle install –without development test postgresql sqlite 299 cd /usr/src/mv/

# remove old versioned ImageMagick, if any
312 rpm -e `rpm -qa | grep ImageMagick`

# Download and compile ImageMagick
316 wget http://image_magick.veidrodis.com/image_magick/ImageMagick-6.7.8-8.tar.xz 325 xz -d ImageMagick-6.7.8-8.tar.xz
327 tar xvf ImageMagick-6.7.8-8.tar
328 cd ImageMagick-6.7.8-8
329 ./configure
330 time make
331 make install
332 cd ..
333 cd /var/www/redmine

334 gem install bundler –no-rdoc –no-ri

# Configure Redmine’s database adaptor, make sure “adapter” is “mysql2” (not “mysql”) 338 vi database.yml
[vuhung@myserver config]$ cat /var/www/redmine/config/database.yml production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password:
encoding: utf8

341 bundle install –without development test postgresql sqlite

351 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH 352 cd /var/www/redmine
353 gem install rmagick -v ‘2.13.1’
354 rake generate_secret_token

356 gem install mocha
357 rake generate_secret_token
358 gem install fastercsv

361 bundle install
362 rake generate_secret_token
363 RAILS_ENV=production rake db:migrate
364 gem install passenger –no-rdoc –no-ri
365 passenger-install-apache2-module

# Integrate redmine (passenger) and Apache
372 vi /etc/httpd/conf.d/passenger.conf

[vuhung@ redmine]$ cat /etc/httpd/conf.d/passenger.conf

LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.15/ext/apache2/mod_passenger.so PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.15 PassengerRuby /usr/local/bin/ruby

Header always unset “X-Powered-By”
Header always unset “X-Rack-Cache”
Header always unset “X-Content-Digest”
Header always unset “X-Runtime”

PassengerMaxPoolSize 20
PassengerMaxInstancesPerApp 4
PassengerPoolIdleTime 3600
PassengerUseGlobalQueue on
PassengerHighPerformance on
PassengerStatThrottleRate 10
RailsSpawnMethod smart
RailsAppSpawnerIdleTime 86400
RailsFrameworkSpawnerIdleTime 0

RailsBaseURI /redmine

# make apache, the Linux’s user who runs apache server owner of the directory /var/www/redmine 392 cd /var/www/
394 chown -R apache.apache redmine
396 chown -R apache.apache redmine-2.0.3

# Initilize redmine’s database, environment
400 RAILS_ENV=production bundle exec rake redmine:load_default_data 401 RAILS_ENV=production bundle exec rake generate_session_store

414 mkdir public/plugin_assets

# make plugins, log, files, upload writable
416 useradd redmine
417 chown -R redmine:redmine files log tmp public/plugin_assets/ 418 chmod -R 755 files log tmp public/plugin_assets
419 ln -s /var/www/redmine/public /var/www/html/redmine

# recheck
420 vi /etc/httpd/conf.d/passenger.conf

# restart (reload) apache’s configuration
421 /etc/init.d/httpd configtest
422 /etc/init.d/httpd graceful

428 ln -s /var/www/redmine/public redmine

# make Redmine sends email with Google’s SMTP
Configurate emails:
[vuhung@ ~]$ cat /var/www/redmine/config/configuration.yml

# ==== SMTP server at using TLS (GMail)
#
# This might require some additional configuration. See the guides at: # http://www.redmine.org/projects/redmine/wiki/EmailConfiguration #
#default:
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
# tls: true
enable_starttls_auto: true
address: “smtp.gmail.com”
port: ‘587’
domain: “smtp.gmail.com”
authentication: :plain
user_name: “noreply@domain.com”
password: “password”

development:
email_delivery:
delivery_method: :smtp
smtp_settings:
# tls: true
enable_starttls_auto: true
address: “smtp.gmail.com”
port: ‘587’
domain: “smtp.gmail.com”
authentication: :plain
user_name: “noreply@domain.com”
password: “password”

Cf. http://blog.redmine.jp/articles/redmine-2_0-installation_centos/
Cf. http://www.redmine.org/projects/redmine/wiki/HowTo_install_Redmine_on_CentOS_5 Cf. http://www.redmine.org/projects/redmine/wiki/RedmineInstall Cf. http://www.redmine.org/projects/redmine/wiki/EmailConfiguration
Cf. http://collectiveidea.com/blog/archives/2011/10/31/install-ruby-193-with-libyaml-on-centos/

Trouble shootings etc…:

It seems your ruby installation is missing psych (for YAML output).
http://collectiveidea.com/blog/archives/2011/10/31/install-ruby-193-with-libyaml-on-centos/

[root@myserver redmine]# bundle install –without development test Fetching gem metadata from http://rubygems.org/…….
Using rake (0.9.2.2)
Installing i18n (0.6.0)
Installing multi_json (1.3.6)
Installing activesupport (3.2.6)
Installing builder (3.0.0)
Installing activemodel (3.2.6)
Installing erubis (2.7.0)
Installing journey (1.0.4)
Installing rack (1.4.1)
Installing rack-cache (1.2)
Installing rack-test (0.6.1)
Installing hike (1.2.1)
Installing tilt (1.3.3)
Installing sprockets (2.1.3)
Installing actionpack (3.2.6)
Installing mime-types (1.19)
Installing polyglot (0.3.3)
Installing treetop (1.4.10)
Installing mail (2.4.4)
Installing actionmailer (3.2.6)
Installing arel (3.0.2)
Installing tzinfo (0.3.33)
Installing activerecord (3.2.6)
Installing activeresource (3.2.6)
Using bundler (1.1.5)
Installing coderay (1.0.7)
Installing json (1.7.4) with native extensions
Installing mysql2 (0.3.11) with native extensions
Installing net-ldap (0.3.1)
Installing pg (0.14.0) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb
checking for pg_config… no
No pg_config… trying anyway. If building fails, please try again with –with-pg-config=/path/to/pg_config
checking for libpq-fe.h… no
Can’t find the ‘libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options:
–with-opt-dir
–without-opt-dir
–with-opt-include
–without-opt-include=${opt-dir}/include
–with-opt-lib
–without-opt-lib=${opt-dir}/lib
–with-make-prog
–without-make-prog
–srcdir=.
–curdir
–ruby=/usr/local/bin/ruby
–with-pg
–without-pg
–with-pg-dir
–without-pg-dir
–with-pg-include
–without-pg-include=${pg-dir}/include
–with-pg-lib
–without-pg-lib=${pg-dir}/lib
–with-pg-config
–without-pg-config
–with-pg_config
–without-pg_config

Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/pg-0.14.0 for inspection. Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/pg-0.14.0/ext/gem_make.out An error occured while installing pg (0.14.0), and Bundler cannot continue. Make sure that `gem install pg -v ‘0.14.0’` succeeds before bundling. [root@myserver redmine]#

An error occured while installing rmagick (2.13.1), and Bundler cannot continue. Make sure that `gem install rmagick -v ‘2.13.1’` succeeds before bundling.

[root@myserver redmine]# gem install rmagick
Building native extensions. This could take a while…
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5… yes
extconf.rb:128: Use RbConfig instead of obsolete and deprecated Config. checking for gcc… yes
checking for Magick-config… yes
checking for ImageMagick version >= 6.4.9… no
Can’t install RMagick 2.13.1. You must have ImageMagick 6.4.9 or later.

*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options:
–with-opt-dir
–without-opt-dir
–with-opt-include
–without-opt-include=${opt-dir}/include
–with-opt-lib
–without-opt-lib=${opt-dir}/lib
–with-make-prog
–without-make-prog
–srcdir=.
–curdir
–ruby=/usr/local/bin/ruby

Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1/ext/RMagick/gem_make.out [root@myserver redmine]#

[root@myserver redmine]# gem install rmagick -v ‘2.13.1’
Building native extensions. This could take a while…
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5… yes
extconf.rb:128: Use RbConfig instead of obsolete and deprecated Config. checking for gcc… yes
checking for Magick-config… yes
checking for ImageMagick version >= 6.4.9… yes
checking for HDRI disabled version of ImageMagick… yes
Package MagickCore was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickCore.pc’ to the PKG_CONFIG_PATH environment variable
No package ‘MagickCore’ found
Package MagickCore was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickCore.pc’ to the PKG_CONFIG_PATH environment variable
No package ‘MagickCore’ found
Package MagickCore was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickCore.pc’ to the PKG_CONFIG_PATH environment variable
No package ‘MagickCore’ found
Package MagickCore was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickCore.pc’ to the PKG_CONFIG_PATH environment variable
No package ‘MagickCore’ found
checking for stdint.h… yes
checking for sys/types.h… yes
checking for wand/MagickWand.h… no

Can’t install RMagick 2.13.1. Can’t find MagickWand.h.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options:
–with-opt-dir
–without-opt-dir
–with-opt-include
–without-opt-include=${opt-dir}/include
–with-opt-lib
–without-opt-lib=${opt-dir}/lib
–with-make-prog
–without-make-prog
–srcdir=.
–curdir
–ruby=/usr/local/bin/ruby

Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1/ext/RMagick/gem_make.out [root@myserver redmine]#

Advertisements

Trả lời

Mời bạn điền thông tin vào ô dưới đây hoặc kích vào một biểu tượng để đăng nhập:

WordPress.com Logo

Bạn đang bình luận bằng tài khoản WordPress.com Đăng xuất / Thay đổi )

Twitter picture

Bạn đang bình luận bằng tài khoản Twitter Đăng xuất / Thay đổi )

Facebook photo

Bạn đang bình luận bằng tài khoản Facebook Đăng xuất / Thay đổi )

Google+ photo

Bạn đang bình luận bằng tài khoản Google+ Đăng xuất / Thay đổi )

Connecting to %s