首頁 > 軟體

Redmine - 安裝隨記

2020-06-16 17:58:13

不知道同事為什麼執著於Redmine,倒是給了一台舊機器讓我幫忙安裝,記錄一下遇到的一些坑,興許能幫到需要的朋友。 

安裝Ruby

windows的話可以直接通過RubyInstaller進行安裝。
Linux可以從原始碼安裝。

系統是RedHat,編譯之前yum檢查一下是否存在依賴項

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


不知道怎麼搞的,yum一直提示以下資訊:

Error Message:
    Abuse of Service detected for server xxxx
Error Class Code: 49


排查太麻煩,重新裝了一次yum。
刪除原來的yum

rpm -aq|grep yum|xargs rpm -e --nodeps


相關rpm

wget http://mirrors.163.com/CentOS/6/os/x86_64/Packages/yum-3.2.29-60.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm


安裝

rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh yum-3.2.29-60.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm


找了個可以用的yum源,放到/etc/yum.repos.d/下,執行

yum clean all
yum makecache


再次執行後發現換了個提示

RHN yum command: Unable to read consumer identity Warning and Solution

按以下步驟操作解決問題

修改

  • /etc/yum/pluginconf.d/product-id.conf
  • /etc/yum/pluginconf.d/subscription-manager.conf

把裡面的enabled改成0

儲存退出並執行

rm -rf /var/cache/yum/*
yum clean all


好了,安裝ruby

tar zxvf ruby.tar.gz

cd ruby
./configure
make
make install
ruby -v

export PATH=/usr/local/ruby/bin:$PATH




安裝Redmine

下載redmine-2.6.2.tar.gz

tar zxvf redmine-2.6.2.tar.gz
mkdir /var/www/redmine
cd redmine-2.6.2
cp -av redmine-2.6.2/* /var/www/redmine


話說需要設定個資料庫,剛好機器上帶MySQL,給redmine建立庫和使用者

create database redmine character set utf8;
create user 'redmine'@'localhost' identified by 'my_password';

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


修改下redmine裡的資料庫設定,修改名稱和設定

cd /var/www/redmine/config
cp database.yml.example database.yml


用bundler搞依賴管理

gem install bundler
cd /var/www/redmine
bundle install


出現以下提示

linking shared-object fiddle.so
/usr/bin/ld: ./libffi-3.2.1/.libs/libffi.a(rawapi.o): relocation RX866432 against `.text' can not be used when making a shared object; recompile with -fPIC
./libffi-3.2.1/.libs/libffi.a: could not read symbols: Bad value

recompile with -fPIC?
安裝libffi-dev可以解決這個問題,參考https://github.com/sstephenson/ruby-build/issues/690


建立表

rake db:migrate RAILS_ENV="production"


載入預設設定

rake redmine:load_default_data RAILS_ENV="production"


啟動

ruby script/rails server webrick -e production -d

 

通過Nginx存取redmine,先不搞passenger什麼的。
修改下conf/nginx.conf,儲存重新啟動:

upstream redmine {
        server 127.0.0.1:3000;
}

server {
        server_name redmine;
        root /var/www/redmine/public;

        location / {
                try_files $uri @redmine;
        }

        location @redmine {
                proxy_set_header  X-Forwarded-For $remote_addr;
                proxy_pass http://redmine;
        }
}

 

CentOS下安裝Redmine並整合Git  http://www.linuxidc.com/Linux/2015-01/111848.htm

最簡化的Ubuntu 10.04下Redmine部署方法 http://www.linuxidc.com/Linux/2010-07/27076.htm

Ubuntu 10.04預設安裝Redmine注意事項 http://www.linuxidc.com/Linux/2010-07/27075.htm

CentOS 5 下Redmine的安裝及設定 http://www.linuxidc.com/Linux/2009-12/23311.htm

Ubuntu 9.10下搭建基於PostgreSQL的Redmine http://www.linuxidc.com/Linux/2009-11/22697.htm

Ubuntu中安裝開源專案管理軟體Redmine http://www.linuxidc.com/Linux/2008-03/11819.htm

如何將Turnkey Redmine 虛擬機器從Redmine 1.0.5 升級到1.2 http://www.linuxidc.com/Linux/2011-09/42882.htm

CentOS5下進行Redmine環境搭建,郵件服務設定,LDAP設定 http://www.linuxidc.com/Linux/2013-04/83619.htm


IT145.com E-mail:sddin#qq.com