安装与集成

redmine 2.2.2+git ubuntu下安装

一、安装 mysql 
www.linuxidc.com @linux:~$ sudo apt-get install
mysql-server libmysqlclient-dev

 

二、安装 nginx(安装步骤进行至passenger nginx 模块时,发现可以先不着急安装nginx,彼时一起安装) www.linuxidc.com @linux:~$ sudo apt-get install nginx

下载redmine:

三、安装ruby 1.8 www.linuxidc.com @linux:~$ sudo apt-get install ruby1.8

svn co redmine-2.2

四、安装 RubyGems 1.8.24 wget

www.linuxidc.com @linux:~$ tar -zxf ./rubygems-1.8.24.tgz 
www.linuxidc.com @linux:~$ cd rubygems-1.8.24/
www.linuxidc.com @linux:~/rubygems-1.8.24$ ruby ./setup.rb 

安装前提软件:

五、配置RubyGems(你懂的) www.linuxidc.com @linux:~$ gem sources –clear-all
www.linuxidc.com @linux:~$ gem source –add
www.linuxidc.com @linux:~$ gem sources –update

 

六、安装bundle www.linuxidc.com @linux:~/rubygems-1.8.24$ sudo gem install bundle

sudo apt-get install libpq-dev

七、下载redmine 1.4 www.linuxidc.com @linux:~$  git clone
-b 1.4-stable ./redmine_1.4
www.linuxidc.com @linux:~$ sudo mv ./redmine_1.4/ /opt/
www.linuxidc.com @linux:~$ cd /opt/redmine_1.4/
www.linuxidc.com @linux:/opt/redmine_1.4$ rm ./.git -Rf

sudo apt-get install imagemagick

八、安装redmine 1.4 依赖包 #确保以下依赖包已经正常安装,以免反复
sudo apt-get install ruby1.8-dev
libmagick9-dev libsqlite3-dev  libpq-dev
#其实使用mysql时这两个包 libsqlite3-dev  libpq-dev
并非必须,可以修改Gemfile来避免检查这两个包。
#如果将来希望使用“scrum-pm”
插件,在Redmine Gemfile中添加以下几行,是个好主意!

sudo apt-get install libmagickwand-dev

gem "googlecharts", :require => "gchart"
gem "mini_magick"

sudo apt-get install gcc g++ build-essential libssl-dev libreadline-dev
zlib1g-dev linux-headers-generic libyaml-dev

www.linuxidc.com @linux:/opt/redmine_1.4$
bundle install

sudo apt-get install libsqlite3-dev

Issue A:

export RUBYOPT=”-KU -E utf-8:utf-8″

extconf.rb:1:in `require’: no such file
to load — mkmf (LoadError)

 

How:

安装:

www.linuxidc.com
@linux:/opt/redmine_1.4$ sudo apt-get install style=”COLOR: #000099″>ruby1.8-dev 

安装ruby:

Issue B:

sudo apt-get install curl 

checking for pg_config… no
No pg_config… trying anyway.
If building fails, please try again with

sudo apt-get install git-core

How:

sudo apt-get install libssl-dev(否则gem不能使用)

www.linuxidc.com
@linux:/opt/redmine_1.4$ sudo apt-get install style=”COLOR: #000099″> libpq-dev

sudo apt-get install libxslt-dev libxml2-dev (不装bundle install会出错)

Issue C:

sudo apt-get install libmysql-ruby libmysqlclient-dev(用于mysql)

Can’t install RMagick 2.13.1. Can’t find
Magick-config in …

sudo apt-get install libsqlite3-dev(用于sqlite)

How:

sudo apt-get install zlib1g-dev(否则不能创建工程)

www.linuxidc.com
@linux:/opt/redmine_1.4$ sudo apt-get install style=”COLOR: #000099″>libmagick9-dev

sudo apt-get install nodejs(一定要不然会报ExecJS::RuntimeError in
Welcome#index错误)

Issue D: 

sudo apt-get install g++ (安装thin,eventmachine之类的时候会用到)

sqlite3.h is missing. Try ‘port install
sqlite3 +universal’

bash < <(curl -s
)

How:

source /home/larry/.rvm/scripts/rvm

www.linuxidc.com
@linux:/opt/redmine_1.4$ sudo apt-get install style=”BACKGROUND-COLOR: rgb(255,255,255)”>l style=”COLOR: #000099″>ibsqlite3-dev

ruby:

九、安装与配置redmine数据库 root@simba-laptop:/opt/redmine_1.4# mysql -u root -p

rvm install ruby 1.9.2 or rvm install jruby-1.7.0.preview1

create database redmine character set
utf8;  
create user ‘redmine’@’localhost’
identified by ‘my_password’;  
grant all privileges on
redmine.* to ‘redmine’@’localhost’;  

rvm –default use 1.9.2 or rvm –default use jruby

root@simba-laptop:/opt/redmine_1.4# rake generate_session_store
root@simba-laptop:/opt/redmine_1.4# RAILS_ENV=production rake
db:migrate

ruby -v

Issue A:

rails:

rake aborted!
no such file to load —
net/https

gem -v

How:

gem update –system

root@simba-laptop:/opt/redmine_1.4#
 apt-get install libopenssl-ruby1.8

gem update

www.linuxidc.com @linux:/opt/redmine_1.4$ RAILS_ENV=production rake
redmine:load_default_data

安装bunder

十、配置权限 www.linuxidc.com @linux:/opt/redmine_1.4$ sudo useradd nginx -U
www.linuxidc.com @linux:/opt/redmine_1.4$ sudo chown -R nginx:nginx
files log tmp public/plugin_assets
www.linuxidc.com @linux:/opt/redmine_1.4$ sudo chmod -R 755 files log
tmp public/plugin_assets

gem install bundler

十一、试运行 www.linuxidc.com @linux:/opt/redmine_1.4$ su – nginx
$ bash
nginx@simba-laptop:/opt/redmine_1.4$ cd /opt/redmine_1.4/
nginx@simba-laptop:/$ cd /opt/redmine_1.4/
nginx@simba-laptop:/opt/redmine_1.4$ ruby script/server webrick -e
production

bundle install –without development test

十二、集成至Nginx #安装passenger
www.linuxidc.com @linux:/opt/redmine_1.4$ sudo gem install passenger

配置mysql

#确保以下依赖包已经正常安装,避免反复
www.linuxidc.com @linux:/opt/redmine_1.4$ sudo apt-get install libcurl4-openssl-dev
www.linuxidc.com @linux:/opt/redmine_1.4$
passenger-install-nginx-module 

create database redmine character set utf8;

Issue:看来不先安装Nginx也没问题:

create user ‘redmine’@’localhost’ identified by ‘my_password’;

*Automatically download and install
Nginx?

Nginx doesn’t support loadable modules such as some other web servers
do,
so in order to install Nginx with Passenger support, it must be
recompiled.

Do you want this installer to download, compile and install Nginx for
you?

  1. Yes: download, compile and install Nginx for me. (recommended)
       The easiest way to get started. A stock Nginx 1.2.2 with
    Passenger
       support, but with no other additional third party modules, will
    be
       installed for you to a directory of your choice.

  2. No: I want to customize my Nginx installation. (for advanced
    users)
       Choose this if you want to compile Nginx with more third party
    modules
       besides Passenger, or if you need to pass additional options to
    Nginx’s
       ‘configure’ script. This installer will  1) ask you for the
    location of
       the Nginx source code,  2) run the ‘configure’ script according to
    your
       instructions, and  3) run ‘make install’.

    Whichever you choose, if you already have an existing Nginx
    configuration file,
    then it will be preserved.

    Enter your choice (1 or 2) or press Ctrl-C to abort: 1*

grant all privileges on redmine.* to ‘redmine’@’localhost’;

#开始自行下载、编译并安装Nginx,等待完成

grant all privileges on redmine.* to ‘redmine’@’localhost’ identified
by ‘my_password’;

#链接remine到 Nginx 默认主目录
www.linuxidc.com @linux:~$ sudo ln -s /opt/redmine_1.4/public/
/var/www/redmine

 

#编辑Nginx配置文件
www.linuxidc.com @linux:/opt$ sudo vim /opt/nginx/conf/nginx.conf
#参考配置如下:

复制 config/database.yml.example to config/database.yml

  1.   user  nginx;  
  2.     worker_processes  1;  
  3.   
  4.   
  5.     #error_log  logs/error.log;  
  6.     #error_log  logs/error.log  notice;  
  7.     #error_log  logs/error.log  info;  
  8.   
  9.   
  10.     #pid        logs/nginx.pid;  
  11.   
  12.   
  13.     events   
  14.     {  
  15.         worker_connections  1024;  
  16.     }  
  17.   
  18.   
  19.   
  20.   
  21.     http   
  22.     {  
  23.         passenger_root /usr/lib/ruby/gems/1.8/gems/passenger-3.0.15;  
  24.         passenger_ruby /usr/bin/ruby1.8;  
  25.   
  26.   
  27.         include       mime.types;  
  28.         default_type  application/octet-stream;  
  29.   
  30.   
  31.         #log_format  main  ‘$remote_addr – $remote_user [$time_local] “$request” ‘  
  32.         #                  ‘$status $body_bytes_sent “$http_referer” ‘  
  33.         #                  ‘”$http_user_agent” “$http_x_forwarded_for”‘;  
  34.   
  35.   
  36.         #access_log  logs/access.log  main;  
  37.   
  38.   
  39.         sendfile        on;  
  40.         #tcp_nopush     on;  
  41.   
  42.   
  43.         #keepalive_timeout  0;  
  44.         keepalive_timeout  65;  
  45.   
  46.   
  47.         #gzip  on;  
  48.   
  49.   
  50.         server   
  51.         {  
  52.             listen       80;  
  53.             server_name  localhost;  
  54.             root /var/www;  
  55.   
  56.   
  57.             #charset koi8-r;  
  58.   
  59.   
  60.             #access_log  logs/host.access.log  main;  
  61.   
  62.   
  63. 6165金沙总站,            location /   
  64.             {  
  65.                 root   html;  
  66.                 index  index.html index.htm;  
  67.             }  
  68.   
  69.   
  70.             location /redmine  
  71.             {  
  72.                 passenger_enabled on;  
  73.                 passenger_base_uri /redmine;  
  74.             }  
  75.   
  76.   
  77.   
  78.   
  79.             #error_page  404              /404.html;  
  80.   
  81.   
  82.             # redirect server error pages to the static page /50x.html  
  83.             #  
  84.             error_page   500 502 503 504  /50x.html;  
  85.             location = /50x.html   
  86.             {  
  87.                 root   html;  
  88.             }  
  89.         }  
  90.     }

production:

#启动Nginx
www.linuxidc.com @linux:/opt$ sudo nginx

adapter: mysql

#测试

database: redmine

十三、安装插件 1、Redmine Sprints
#下载插件
www.linuxidc.com @linux:/opt/redmine_1.4$ sudo git clone
git://github.com/software-project/scrum-pm.git
vendor/plugins/redmine_sprints
www.linuxidc.com @linux:/opt/redmine_1.4/vendor/plugins$ sudo git clone
git://github.com/technoweenie/attachment_fu.git
 vendor/plugins/attachment_fu

host: localhost

#修改权限
www.linuxidc.com @linux:/opt/redmine_1.4$ cd vendor/plugins/
www.linuxidc.com @linux:/opt/redmine_1.4/vendor/plugins$ sudo chown -Rf
nginx:nginx ./redmine_sprints/
www.linuxidc.com @linux:/opt/redmine_1.4/vendor/plugins$ chown -Rf
nginx:nginx ./attachment_fu/

username: redmine

#关于此插件依赖包
建议体检修改Redmine Gemfile,在其中中添加以下几行:

password: my_password

gem
“googlecharts”, :require => “gchart”
style=”COLOR: #cc0000″>gem “mini_magick”

 

2、code review
#下载redmine_code_review 并将其解压到 redmin/vendor/plugins
www.linuxidc.com @linux:/opt/redmine_1.4$ cd vendor/plugins/
www.linuxidc.com @linux:/opt/redmine_1.4$ cd vendor/plugins/ sudo chown
-Rf nginx:nginx ./redmine_code_review/
sudo rake db:migrate_plugins RAILS_ENV=production
6165金沙总站 1

rake generate_secret_token

RAILS_ENV=production rake db:migrate

RAILS_ENV=production rake redmine:load_default_data

mkdir tmp tmp/pdf public/plugin_assets

sudo chown -R redmine:redmine files log tmp public/plugin_assets

sudo chmod -R 755 files log tmp public/plugin_assets

ruby script/rails server webrick -e production

查看

git使用

“配置”页面,点击“版本库”标签,SCM的下拉菜单中选择Git,Path to
repository输入框中输入Git库的*本地绝对路径*。然后点击保存即可

 

2.2.2+git ubuntu下安装 下载redmine: svn
co redmine-2.2
安装前提软件: sudo apt-get install libpq-dev sudo a…