{"id":1092,"date":"2010-04-04T19:00:00","date_gmt":"2010-04-04T11:00:00","guid":{"rendered":"\/?p=1092"},"modified":"2010-04-04T19:00:00","modified_gmt":"2010-04-04T19:00:00","slug":"1092","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/other\/1092.html","title":{"rendered":"\u57fa\u4e8eCentos\u90e8\u7f72Redmine\u9879\u76ee\u7ba1\u7406\u7cfb\u7edf"},"content":{"rendered":"

Redmine\u5b89\u88c5\u6307\u5357<\/strong><\/p>\n

1.\u7cfb\u7edf\u9700\u6c42<\/strong>
Ruby 1.8.7 on Rails 2.3.5
\u6570\u636e\u5e93 \uff08\u53c2\u8003\u4e0b\u9762\u7684\u517c\u5bb9\u6570\u636e\u5e93\u5217\u8868\uff09<\/p>\n

\u53ef\u9009\u7684\uff1a<\/strong>
SVN \u5ba2\u6237\u7aef\uff08\u7248\u672c\u4e0d\u4f4e\u4e8e1.3\uff09\uff0c\u7528\u4e8e\u7248\u672c\u5e93\u6d4f\u89c8\u529f\u80fd\uff08\u5fc5\u987b\u914d\u7f6e\u5230\u60a8\u7684 PATH \u8bbe\u7f6e\u4e2d\uff09
RMagick \uff08\u7528\u4e8e\u5c06\u7518\u7279\u56fe\u8f93\u51fa\u81f3PNG\u56fe\u5f62\u6587\u4ef6\uff09<\/p>\n

\u652f\u6301\u7684\u6570\u636e\u5e93\uff1a<\/strong>
MySQL 4 \u6216\u66f4\u9ad8\u7248\u672c\uff08\u63a8\u8350\uff09
\u6587\u672c\u5df2\u7ecf\u8fd0\u7528yum\u63d0\u524d\u90e8\u7f72\u597d\uff0c\u65b9\u6cd5\u5982\u4e0b\uff1a
yum install -y mysql mysql-server mysql-devel
PostgreSQL 8 \uff088.3\u7248\u672c\u672a\u7ecf\u5145\u5206\u6d4b\u8bd5\uff09
SQLite 3<\/p>\n

2.Ruby on Rails\u90e8\u7f72<\/strong>
mkdir \/opt\/source
cd \/opt\/source
wget http:\/\/ftp.ruby-lang.org\/pub\/ruby\/1.8\/ruby-1.8.7.tar.gz<\/a>
tar zxvf ruby-1.8.7.tar.gz
cd ruby-1.8.7
.\/configure
make && make install
cd ext\/zlib
ruby extconf.rb –with-zlib-include=\/usr\/include –with-zlib-lib=\/usr\/lib
cd ..\/..\/
make && make install<\/p>\n

cd \/opt\/source
wget
http:\/\/production.cf.rubygems.org\/rubygems\/rubygems-1.3.6.tgz<\/a>
tar zxvf rubygems-1.3.6.tgz
cd rubygems-1.3.6
ruby setup.rb<\/p>\n

gem install rails -v=2.3.5
gem install mysql<\/p>\n

3.\u68c0\u67e5Ruby on Rails\u72b6\u6001<\/strong>
ruby -v<\/p>\n

ruby 1.8.7 (2008-05-31 patchlevel 0) [i686-linux]
gem list<\/p>\n

*** LOCAL GEMS ***<\/p>\n

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
mysql (2.8.1)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)<\/p>\n

4.\u6570\u636e\u5e93\u8bbe\u7f6e(\u4ee5Mysql\u4e3a\u4f8b)<\/strong>
\u542f\u52a8Mysql\u6570\u636e\u5e93
\/etc\/init.d\/mysqld start<\/p>\n

\u521b\u5efa\u6570\u636e\u5e93\u4e0e\u8bbe\u7f6e\u6743\u9650
mysql -u root -p
Enter password:<\/p>\n

mysql> create database redmine character set utf8;
mysql> grant all on redmine.* to
‘redmine’@’localhost’<\/a> identified by ‘redmine’;
mysql> flush privileges;<\/p>\n

5.\u914d\u5236 redmine \u73af\u5883\u548c\u6570\u636e\u5e93<\/strong>
cd \/opt\/source
wget
http:\/\/rubyforge.org\/frs\/download.php\/69449\/redmine-0.9.3.tar.gz<\/a>
tar zxvf redmine-0.9.3.tar.gz
mv redmine-0.9.3 \/opt\/redmine
cd \/opt\/redmine\/config
cp database.yml.example database.yml
vi database.yml<\/p>\n

production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: redmine
encoding: utf8<\/p>\n

\u5728\u7a0b\u5e8f\u7684\u6839\u76ee\u5f55\u4e0b\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u521b\u5efa\u6570\u636e\u5e93\u7ed3\u6784\uff1a
cd \/opt\/redmine\/
RAILS_ENV=production rake config\/initializers\/session_store.rb
rake db:migrate RAILS_ENV="production"<\/p>\n

\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u5411\u6570\u636e\u5e93\u4e2d\u5bfc\u5165\u9ed8\u8ba4\u7684\u914d\u7f6e\u6570\u636e\uff1a
rake redmine:load_default_data RAILS_ENV="production"
\u8fd9\u4e00\u6b65\u64cd\u4f5c\u662f\u53ef\u9009\u7684\uff0c\u4f46 \u5f3a\u70c8\u63a8\u8350 \u60a8\u6267\u884c\u5b83\uff0c\u60a8\u4e5f\u53ef\u4ee5\u4ece\u5934\u5f00\u59cb\u4e00\u6b65\u6b65\u586b\u5199\u81ea\u5df1\u7684\u914d\u7f6e\u53c2\u6570\u3002\u6b64\u547d\u4ee4\u5c06\u5bfc\u5165\u9ed8\u8ba4\u89d2\u8272\u3001\u8ddf\u8e2a\u6807\u7b7e\u3001\u72b6\u6001\u3001\u5de5\u4f5c\u6d41\u7a0b\u548c\u679a\u4e3e\u503c\u3002<\/p>\n

6.\u8fd0\u884cWEBrick\u670d\u52a1\u5668\u6765\u6d4b\u8bd5\u5b89\u88c5<\/strong><\/p>\n

ruby script\/server -e production<\/p>\n

\u5f53WEBrick\u542f\u52a8\u540e\uff0c\u4f7f\u7528\u6d4f\u89c8\u5668\u8bbf\u95ee http:\/\/localhost:3000\/<\/a> \u60a8\u5c06\u770b\u5230\u7cfb\u7edf\u7684\u6b22\u8fce\u754c\u9762\u3002
\u4f7f\u7528\u9ed8\u8ba4\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\u767b\u5f55\uff1a
* \u7528\u6237\u540d: admin
* \u5bc6\u7801: admin
Redmine\u8865\u5145\u9644\u5f55<\/p>\n

1.Redmine\u5907\u4efd\u65b9\u5f0f\uff1a<\/strong>
Redmine\u7684\u5907\u4efd\u5e94\u8be5\u5305\u62ec\uff1a * \u6570\u636e\uff08\u4fdd\u5b58\u5728redmine\u6570\u636e\u5e93\u4e2d\uff09 * \u9644\u4ef6\uff08\u4fdd\u5b58\u5728Redmine\u5b89\u88c5\u76ee\u5f55\u7684 files \u76ee\u5f55\u4e2d\uff09<\/p>\n

\u4ee5\u4e0b\u662f\u4e00\u4e2a\u53ef\u4ee5\u8fdb\u884c\u6bcf\u5929\u5907\u4efd\u7684\u7b80\u5355\u811a\u672c\u7a0b\u5e8f\uff08\u5047\u8bbe\u60a8\u4f7f\u7528mysql\u6570\u636e\u5e93\uff09\uff1a
cat >> \/var\/spool\/cron\/root << EOF
# Redmine Database
0 1 * * * \/usr\/bin\/mysqldump -u redmine -p redmine redmine | gzip > \/opt\/backup\/db\/redmine_`date +%y_%m_%d`.gz
# Redmine Attachments
30 1 * * * rsync -a \/opt\/redmine\/files \/opt\/backup\/files
EOF<\/p>\n

2.SMTP\u670d\u52a1\u5668\u914d\u7f6e<\/strong><\/p>\n

\u5728 config\/environment.rb \u6587\u4ef6\u4e2d\uff0c\u60a8\u53ef\u4ee5\u8bbe\u7f6e\u60a8\u7684SMTP\u670d\u52a1\u5668\u7684\u53c2\u6570\uff1a<\/p>\n

* config.action_mailer.smtp_settings: SMTP\u670d\u52a1\u5668\u914d\u7f6e
* config.action_mailer.perform_deliveries: \u8bbe\u7f6e\u4e3a false \u4ee5\u7981\u7528\u90ae\u4ef6\u53d1\u9001\u529f\u80fd<\/p>\n

\u4fee\u6539\u6b64\u6587\u4ef6\u540e\u9700\u8981\u91cd\u65b0\u542f\u52a8\u670d\u52a1\u5668\u3002<\/p>\n

\u539f\u6587:<\/strong> http:\/\/www.20071231.com\/ruby-on-rails-based-project-management-system-to-deploy-redmine.html\/comment-page-1\/<\/a>:<\/p>\n

\u8865\u5145:<\/strong>
RedMine\u96c6\u6210\u73af\u5883:
http:\/\/bitnami.org\/stack\/redmine<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

Redmine\u5b89\u88c5\u6307\u5357<\/strong><\/p>\n

1.\u7cfb\u7edf\u9700\u6c42<\/strong>
Ruby 1.8.7 on Rails 2.3.5
\u6570\u636e\u5e93 \uff08\u53c2\u8003\u4e0b\u9762\u7684\u517c\u5bb9\u6570\u636e\u5e93\u5217\u8868\uff09<\/p>\n

\u53ef\u9009\u7684\uff1a<\/strong>
SVN \u5ba2\u6237\u7aef\uff08\u7248\u672c\u4e0d\u4f4e\u4e8e1.3\uff09\uff0c\u7528\u4e8e\u7248\u672c\u5e93\u6d4f\u89c8\u529f\u80fd\uff08\u5fc5\u987b\u914d\u7f6e\u5230\u60a8\u7684 PATH \u8bbe\u7f6e\u4e2d\uff09
RMagick \uff08\u7528\u4e8e\u5c06\u7518\u7279\u56fe\u8f93\u51fa\u81f3PNG\u56fe\u5f62\u6587\u4ef6\uff09<\/p>\n

\u652f\u6301\u7684\u6570\u636e\u5e93\uff1a<\/strong>
MySQL 4 \u6216\u66f4\u9ad8\u7248\u672c\uff08\u63a8\u8350\uff09
\u6587\u672c\u5df2\u7ecf\u8fd0\u7528yum\u63d0\u524d\u90e8\u7f72\u597d\uff0c\u65b9\u6cd5\u5982\u4e0b\uff1a
yum install -y mysql mysql-server mysql-devel
PostgreSQL 8 \uff088.3\u7248\u672c\u672a\u7ecf<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1092"}],"collection":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/comments?post=1092"}],"version-history":[{"count":0,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1092\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/media?parent=1092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/categories?post=1092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/tags?post=1092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}