千家信息网

centos7安装redmine3,并升级redmine1.8到3

发表于:2024-12-02 作者:千家信息网编辑
千家信息网最后更新 2024年12月02日,1.安装mysqlwget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpmrpm -ivh mysql-community
千家信息网最后更新 2024年12月02日centos7安装redmine3,并升级redmine1.8到3

1.安装mysql

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpmrpm -ivh mysql-community-release-el7-5.noarch.rpmyum install mysql-serverservice mysql start

2.安装依赖包

yum install mysql-develyum install libcurl-develyum install ImageMagick-devel

3.安装ruby2.4

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDBcurl -sSL https://get.rvm.io | bash -s stable --rubymv /usr/bin/ruby /usr/bin/ruby2.0ln -s /usr/local/rvm/rubies/ruby-2.4.1/bin/ruby /usr/bin/

4.安装Redmine3

wget http://www.redmine.org/releases/redmine-3.4.2.tar.gztar -zxvf redmine-3.4.2.tar.gz -C /opt/gem install bundlerbundle install --with development test rmagickRAILS_ENV=production REDMINE_LANG=zh bundle exec rake redmine:load_default_data


5.修改配置文件

cp database.yml.example  database.ymlvi database.yml

修改Production

production:  adapter: mysql2  database: redmine  host: localhost  username: root  password: "123456"  encoding: utf8

修改生成sercet.yml

生成密钥

rake secret

把上面命令生成的密钥写入secrets.yml

production:  secret_key_base:xxxxxx

6.升级redmine

从redmine1里导出数据库后

然后导入到redmine3的数据库中

mysql --default-character-set=utf8 redmine3 < redmine1.sql
#升级数据库bundle exec rake db:migrate RAILS_ENV=production#升级插件数据库bundle exec rake redmine:plugins:migrate RAILS_ENV=production#清除老的sessionbundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production

7.配置redmine在nginx里运行

为nginx安装passenger

gem install passengerpassenger-install-nginx#需要选择nginx的源代码路径,然后程序会自动编译nginx

修改nginx.conf

http{  ...  passenger_root /usr/local/rvm/gems/ruby-2.4.1/gems/passenger-5.1.10;  passenger_ruby /usr/local/rvm/gems/ruby-2.4.1/wrappers/ruby;  ..

添加server :

server{            server_name    redmine.abc.com;            charset utf8;            index index.html index.htm index.php;            root    /opt/redmine-3.4.2/public/;            passenger_enabled on;}


0