Linux上安装Redmine
Posted Edward Guan
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux上安装Redmine相关的知识,希望对你有一定的参考价值。
安装基本的软件环境
# yum install libyaml-devel zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel gcc ruby-devel gcc-c++ make postgresql-devel ImageMagick-devel sqlite-devel perl-LDAP mod_perl perl-Digest-SHA
安装Apache
# yum install httpd
设置自启,并启动apache服务
# chkconfig httpd on
# service httpd start
安装MySQL
添加mysql源
# rpm -Uvh http://dev.mysql.com/get/mysql57-community-release-el6-8.noarch.rpm
安装mysql
# yum install mysql-community-server
设置自启,并启动mysql服务
# chkconfig mysqld on
# service mysqld start
查看安装完成后生成的root临时密码
# grep ‘temporary password‘ /var/log/mysqld.log
运行mysql安全配置
# mysql_secure_installation
安装php和phpMyAdmin
安装php和相关扩展包
# yum install php php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc php-pecl-apc php-soap
安装phpMyAdmin
# rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm # yum install phpmyadmin
修改phpMyAdmin虚拟目录配置文件,允许远程访问
# vi /etc/httpd/conf.d/phpmyadmin.conf
把"Allow from 127.0.0.1"修改为"Allow from all"
修改phpMyAdmin配置文件
# vi /usr/share/phpmyadmin/config.inc.php
将认证方式‘cookie‘改为‘http‘
$cfg[‘Servers‘][$i][‘auth_type‘] = ‘http‘;
重启apache服务
# service httpd restart
安装Ruby
安装ruby版本管理器RVM
# \curl -L https://get.rvm.io | bash
# source /etc/profile.d/rvm.sh
列出所有ruby版本
# rvm list known
安装ruby的稳定版本(当前为2.3)
# rvm install 2.3
检查ruby版本
# ruby -v
安装Passenger
# gem install passenger # passenger-install-apache2-module
命令执行完后按照提示进行配置passenger的虚拟目录文件
$ sudo vi /etc/httpd/conf.d/passenger.conf
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.3.1/gems/passenger-5.0.28/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c> PassengerRoot /usr/local/rvm/gems/ruby-2.3.1/gems/passenger-5.0.28 PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.3.1/wrappers/ruby </IfModule>
重启apache服务
sudo service httpd restart
为Redmine创建数据库
登陆mysql
# mysql -u root -p
进行相关数据库配置
mysql> create database redmine_db character set utf8; mysql> create user ‘redmine‘@‘localhost‘ identified by ‘your_new_password‘; mysql> grant all privileges on redmine_db.* to ‘redmine‘@‘localhost‘;
安装Redmine
下载Redmine
# cd /var/www # wget https://www.redmine.org/releases/redmine-3.2.2.tar.gz
解压并重命名文件夹
# tar xfz redmine-3.2.2.tar.gz # mv redmine-3.2.2 redmine # rm -rf redmine-3.2.2.tar.gz
配置redmine数据库
# cd /var/www/redmine/config # cp database.yml.example database.yml
# vi database.yml
production: adapter: mysql2 database: redmine_db host: localhost username: redmine password: "your_new_password" encoding: utf8
安装Rails
# cd /var/www/redmine # gem install bundler # bundle install # rake generate_secret_token
创建redmine数据库表
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data
激活FCGI
# cd /var/www/redmine/public # mkdir plugin_assets # cp dispatch.fcgi.example dispatch.fcgi # cp htaccess.fcgi.example .htaccess
安装mod_fcgi
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm# yum install mod_fcgid
创建数据文件目录
# mkdir -p /opt/redmine/files # chown -R apache:apache /opt/redmine # cd /var/www/redmine/config # cp configuration.yml.example configuration.yml
# vi configuration.yml
attachments_storage_path: /opt/redmine/files
配置Email
# vi /var/www/redmine/config/configuration.yml
email_delivery:
delivery_method: :sendmail
给Redmine创建虚拟目录
# vi /etc/httpd/conf.d/redmine.conf
# # Web application for Redmine # <Directory "/var/www/redmine/public"> Options Indexes ExecCGI FollowSymLinks Order allow,deny Allow from all AllowOverride all </Directory> Alias /redmine /var/www/redmine/public Alias /Redmine /var/www/redmine/public
启动Redmine
# cd /var/www # chown -R apache:apache redmine # chmod -R 755 redmine # service httpd restart
以上是关于Linux上安装Redmine的主要内容,如果未能解决你的问题,请参考以下文章