linux下redmine安裝筆記
linux下redmine安裝筆記
redmine安裝相對trac要簡單一點。
一、安裝ruby
下載ruby-1.8.7
http://www.ruby-lang.org/en/downloads
#tar xzvf ruby-1.8.7.tar.gz
#cd ruby-1.8.7 #./configure --prefix=/usr/local/ruby #make && make installlibmysqld.a
)
--enable-local-infile //允許從本地匯入資料
--enable-assembler //彙編x86的普通操作符,可以提高效能
--with-plugins=innobase //資料庫外掛
--with-plugins=partition //分表功能,將一個大表分割成多個小表
#make && make install
初始化mysql資料庫
#chown -R mysql:mysql /usr/local/mysql
#cp mysql-5.0.22/support-files/my-medium.cnf /etc/my.cnf
#cd /usr/local/mysql
#bin/mysql_install_db --user=mysql
#chown -R mysql:mysql /usr/local/mysql/var/ //把初始化的資料庫目錄給MySQL所有者
#/usr/local/mysql/bin/mysqld_safe --user=mysql & //啟動MySQL
配置開機自動啟動
#cp mysql-5.0.22/support-files/mysql.server /etc/init.d/mysqld
#chmod 755 /etc/init.d/mysqld
#chkconfig --add mysqld
#chkconfig mysqld on
#service mysqld restart
補充 mysql的配置:
配置my.cnf
配置主要把安裝的目錄的那幾項開啟就行.
改動如下:
[client]
#password = your_password
port = 3306
socket = /tmp/mysql3306.sock
# The Mysql server
[Mysqld]
port = 3306
socket = /tmp/mysql3306.sock
開啟下面幾項
innodb_data_home_dir = /usr/local/mysql/var/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /usr/local/mysql/var/
innodb_log_arch_dir = /usr/local/mysql/var/
六、安裝redmine
注意redmine的版本
Redmine version | Supported Ruby versions | Required Rails version | Required Rack version |
---|---|---|---|
current trunk | ruby 1.8.6, 1.8.7 | Rails 2.3.11 | Rack 1.1.0 |
trunk from r2887 tor4903 | ruby 1.8.6, 1.8.7 | Rails 2.3.5 | Rack 1.0.1 |
trunk from r2493 tor2886 | ruby 1.8.6, 1.8.7 | Rails 2.2.2 | |
trunk before r2493 | ruby 1.8.6, 1.8.7 | Rails 2.1.2 | |
1.1.x | ruby 1.8.6, 1.8.7 | Rails 2.3.5 | Rack 1.0.1 |
1.0.x | ruby 1.8.6, 1.8.7 | Rails 2.3.5 | Rack 1.0.1 |
0.9.x | ruby 1.8.6, 1.8.7 | Rails 2.3.5 | Rack 1.0.1 |
0.8.x | ruby 1.8.6, 1.8.7 | Rails 2.1.2 |
下載redmine-1.1.0
#mkdir /usr/local/redmine
#cd /usr/local/redmine
#svn co http://redmine.rubyforge.org/svn/branches/1.0-stable redmine-1.0
#cd /usr/local/redmine/redmine-1.0/config
#cp database.yml.example database.yml
#vim database.yml //資料庫配置檔案
production: adapter: mysql database:redmine host: localhost username: root //資料庫訪問使用者名稱 password: "123456" //資料庫訪問密碼 encoding: utf8 使用rake建立表 # rake db:migrate RAILS_ENV="production" a.報錯:uninitialized constant ActiveSupport::Dependencies::Mutex 解決方法:rails和rubygems版本不匹配,rubygems降到1.3.5試試 b.報錯:A key is required to write a cookie containing the session data. Use config.action_controller.session = {:key=>"_myapp_session", :secret=> "some secret phrase" } in config/environment.rb 解決方法:rake config/initializers/session_store.rb c.報錯: No such file or directory - /tmp/mysql.sock 解決方法: 由於之前在mysql配置時my.cnf配置了socket導致 vim config/database.yml 在production欄目最後一行新增 socket: /tmp/mysql3306.sock 注意: socket的“:"後面必須有個空格,再接"/tmp/mysql3306.sock" d.報錯: !!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql. rake aborted! 需要安裝mysql介面卡。gem install mysql e.報錯: Access denied for user 'mysql'@'localhost' (using password: YES) 解決辦法: #mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.0.22-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> mysql>grant all privileges on *.* to 'mysql'@'localhost' identified by 'mysql' with grant option; mysql>flush privileges; mysql>exit; f.報錯:Unknown database 'redmine' 解決辦法:建立資料庫redmine mysql>create database redmine; 載入預設配置 # rake redmine:load_default_data RAILS_ENV="production" 這裡會要求選擇預設語言,選中文zh:Select language: bg, ca, cs, da, de, en, es, fi, fr, he, hu, it, ja, ko, lt, nl, no, pl, pt, pt-br, ro, ru, sk, sr, sv, th, tr, uk, vn, zh, zh-tw [en] zh 這個預設設定只是在未登入時的介面語言,當用戶登入後,預設語言還是英語,在My account裡可以修改成其它語言。
啟動WEB服務 # ruby script/server webrick -e production
或# ruby /usr/local/redmine/redmine-1.0/script/server webrick -e production 更換web伺服器 redmine自帶的webrick太慢,特別是區域網,據說是 需要解析目標地址的主機名,直接給ip不用,硬要繞一圈。 使用網上推薦的 mongrel # gem install mongrel # ruby /usr/local/redmine/redmine-1.0/script/server mongrel -e production 本機ip為192.9.100.106,至此在本機使用http://192.9.100.106:3000 或 http://127.0.0.1:3000均能訪問,但區域網其他機器仍然無法訪問。 原因:redhat防火牆遮蔽了埠3000 解決辦法: 配置防火牆,開放寬口3000
# /sbin/iptables -I INPUT -p tcp --dport 3000 -j ACCEPT
# /etc/rc.d/init.d/iptables save
# service iptables restart 至此,redmine安裝完成。後面需要完成redmine、apache、subversion的整合。 以上安裝在虛擬機器上完成,PC 192.9.100.105上始終安裝不上,一樣的步驟,在gem install時老提示: ERROR: http://gems.rubyforge.org/ does not appear to be a respository ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) bad response Not Found 404 (http://gems.rubyforge.org/yaml)Redmine郵件的配置
修改Redmine下資料夾config中的email.yml,資訊如下:
production:
delivery_method: :smtp
smtp_settings:
address: mail.XXXXX
port: 25
domain: XXXXX.com
# authentication: :login
# user_name: [email protected]
# password: XXXXXX
development:
delivery_method: :smtp
smtp_settings:
address: mail.XXXXX
port: 25
domain: XXXXX.com
# authentication: :login
# user_name: [email protected]
# password: XXXXXX
注意用#登出掉的那三行資訊,那是郵件伺服器身份驗證資訊,但是如果你的使用者已經使用了域驗證,就不需要那三行資訊,像我自己用的就是內部的郵件伺服器(MS Exchange),就無須身份驗證的必要。如果使用的是外面郵件伺服器,一般是需要的;引數設定好了,然後重啟Redmine服務,在配置中設定好傳送郵件的帳號,然後測試(測試功能在右下角,我覺得自己眼神實在差,居然沒有發現那個功能,還抱怨Redmine怎麼那麼笨的,沒有提供郵件測試的功能,每次測試都在實際操作中進行,比較更新問題等,哈哈,傻了)。