Redmine 2.0.3 安裝配置

 1.優化系統

# cat /etc/redhat-release 

CentOS release 5.3 (Final)

#yum install git

#git clone git://github.com/leopku/centostweak.git                <--------此腳本只針對於 Centos系列

#chmod +x centostweak.sh

#./centostweak.sh

有關於 redmine 版本安裝的一些對ruby rails rubygems 版本有要求,可以根據以下參考

redmine:http://www.redmine.org/projects/redmine/wiki/RedmineInstall

ruby:http://www.ruby-lang.org/en/downloads/

rubyGmes:http://rubyforge.org/projects/rubygems/


2.安裝依賴包 

yum -y install zlib-devel zlib openssl-devel perl cpio expat-devel gettest-devel curl gcc gcc-c++ make mysql-server mysql mysql-devel freetype-devel libpng-devel libjpeg-devel gd-devel bzip2-devel fontconfig libtiff-devel libwmf-devel 

啓動mysql服務

service mysqld start

安裝RVM環境

curl -L https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer |bash -s stable 

設置rvm全局環境變量

vim /etc/profile

最後加

export RVM_HOME="/usr/local/rvm/"

export CLASSPATH="/$RVM_HOME/bin:$PATH"

source /etc/profile             <--------rvm 環境變量生效


3.安裝 RUBY 1.9.2

http://www.ruby-lang.org/en/downloads/

./configure --prefix=/usr/local/ruby

make && make install

設在ruby環境變量

vim /etc/profile

export PATH=/usr/local/ruby/bin:/usr/local/ruby/lib/ruby/gems/1.9.1/gems:$PATH

export PATH="/usr/local/ImageMagick/bin:$PATH"

source /etc/profile             <--------ruby 環境變量生效

rvm 1.9.2 --default

4.開始安裝 rails 3.2.6

gem install rails -v=3.2.6

5. 安裝 ImageMagick & rmagick &sqlite3

tar zxvf ImageMagick-6.6.4-7.tar.gz 

./configure --prefix=/usr/local/ImageMagick 

make && make install

設置Imageagick環境變量

vim /etc/profile

export PATH="/usr/local/ImageMagick/bin:$PATH"

source /etc/profile

gem install rmagick

gem install sqlite3 -v '1.3.6'

6.配置redmine數據庫,以及授權用戶

mysql> create database redmine character set utf8;

mysql> grant all privileges on redmine.* to 'redmine'@'locahost' identified by 'redmine';

mysql> flush privileges;

7.安裝redmine 依賴 

bundle install

8.安裝mysql2 

gem install "mysql2"


9. 開始下載安裝redmine

cd /tmp

http://ftp.ruby-lang.org/pub/ruby/

tar zxvf redmine-2.0.3.tar.gz

mv redmine-2.0.3 /usr/local/redmine

cd /usr/local/redmine

cp config/database.yml.example config/database.yml

修改redmine 數據庫連接文件如下:

cat config/database.yml

# Default setup is given for MySQL with ruby1.8. If you're running Redmine

# with MySQL and ruby1.9, replace the adapter name with `mysql2`.   (這裏已經提示 mysql2) 

# Examples for PostgreSQL and SQLite3 can be found at the end.

production:

  adapter: mysql2                        <-----------類型一定是要 msyql2 (mysql一直是不對滴,bundle install 安裝的版本mysql2-0.3.11 可以看看注視吆。)

  database: redmine                      <-----------設置要連接的數據庫

  host: localhost                        <-----------mysql主機地址

  username: root                         <-----------redmine 數據庫的用戶

  password:                              <-----------設置的密碼

  encoding: utf8

關於database.yml的配置問題,讓我着實處理了下。。實際上該文件一小點的不符要求就導致安裝根本無法繼續。並且給出的提示也多半不着頭腦。

10.這是生成會話存儲(跟1.X完全區分開rake generate_session_store)

 rake generate_secret_token

11.創建數據庫結構,應用程序根目錄下運行以下命令:

RAILS_ENV=production rake db:migrate

本人也盡力去修改redmine默認的端口 ,努力了 沒找到,so 改爲啓動指定端口 -p 80

Redmine 後臺啓動

ruby /usr/local/redmine/script/rails server webrick -e production -p80 >/dev/null 2>&1  &

設置開機啓動Redmine 

echo "ruby /usr/local/redmine/script/rails server webrick -e production -p80 >/dev/null 2>&1  &" >> /etc/rc.local

然後可以用瀏覽器 http://IP 登陸。

使用默認的管理員帳戶登錄:

登錄者:admin

密碼:admin

登陸後可以在admin的控制面板裏修改語言爲中文。經測試中文化較完善,顯示、輸入中文均未見什麼問題。


設置發送郵件 

cp config/configuration.yml.example config/configuration.yml

修改如下:

Example configuration.yml Configurations

Simple Login Authentication (default settings)

# Outgoing email settings

production:

  email_delivery:

    delivery_method: :smtp

    smtp_settings:

      address: smtp.example.net

      port: 25

      domain: example.net

      authentication: :login

      user_name: [email protected]

      password: redmine

development:

  email_delivery:

    delivery_method: :smtp

    smtp_settings:

      address: 127.0.0.1

      port: 25

      domain: example.net

      authentication: :login

      user_name: [email protected]

      password: redmine

 


設置redmine的log  (就不用翻譯了 對着改改就成了)

Logging configuration

Redmine defaults to a log level of :info, writing to the log subdirectory. Depending on site usage, this can be a lot of data so to avoid the contents of the logfile growing without bound, consider rotating them, either through a system utility like logrotate or via the config/additional_environment.rb file.

To use the latter, copy config/additional_environment.rb.example to config/additional_environment.rb and add the following lines. Note that the new logger defaults to a high log level and hence has to be explicitly set to info.

1#Logger.new(PATH,NUM_FILES_TO_ROTATE,FILE_SIZE)

2config.logger = Logger.new(config.log_path, 2, 1000000)

3config.logger.level = Logger::INFO


gem list 安裝的軟件包

[root@localhost ~]# 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.5)

coderay (1.0.7)

erubis (2.7.0)

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)

minitest (1.6.0)

mocha (0.12.1)

multi_json (1.3.6)

mysql2 (0.3.11)

net-ldap (0.3.1)

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, 2.5.8)

rmagick (2.13.1)

ruby-openid (2.1.8)

shoulda (2.11.3)

sprockets (2.1.3)

thor (0.15.4)

tilt (1.3.3)

treetop (1.4.10)

tzinfo (0.3.33)

yard (0.8.2.1)

 


出現過程中遇到的一些比較糾結的問題

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.

 

解決辦法:

修改 Gemfile 中把所有關於pg的行註銷 (總體是我們不用PostgreSQL數據庫 所以直接忽視)

還有相關的sqlite3

如下:

platforms :mri, :mingw do

#  group :postgresql do

#    gem "pg", ">= 0.11.0"

#  end

 

#  group :sqlite do

#    gem "sqlite3"

#  end

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章