標籤:專案管理 redmine
系統安裝按照1# CentOS 6.7 x64 迷你安裝
Apache/PHP/MariaDB環境按照2# CentOS 6.7 x64 Apache/PHP/Mariadb環境搭建
建立資料庫
[[email protected] ~]# mysql -u root -pmariadb.2016P <<EOF 2> /dev/null create database redmine default character set utf8;create user ‘redmineuser‘@‘%‘ identified by ‘redmine.2016P‘;grant all privileges on redmine.* to ‘redmineuser‘@‘%‘ identified by ‘redmine.2016P‘;flush privileges;EOF
下載、安裝Ruby2.3/rubygems2.6.3
[[email protected] src]# wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz[[email protected] src]# wget http://production.cf.rubygems.org/rubygems/rubygems-2.6.3.tgz[[email protected] src]# wget http://www.redmine.org/releases/redmine-3.2.1.tar.gz[[email protected] src]# tar zxf ruby-2.3.0.tar.gz[[email protected] ruby-2.3.0]# cd ruby-2.3.0[[email protected] ruby-2.3.0]# ./configure --prefix=/usr/local/ruby && make && make install[[email protected] ruby-2.3.0]# echo "export PATH=/usr/local/ruby/bin:$PATH" > /etc/profile.d/ruby.sh[[email protected] ruby-2.3.0]# source /etc/profile.d/ruby.sh[[email protected] ruby-2.3.0]# cd ..[[email protected] src]# tar xf rubygems-2.6.3.tgz[[email protected] src]# cd rubygems-2.6.3[[email protected] rubygems-2.6.3]# ruby setup.rb
修改gem源
[[email protected] src]# gem source --remove https://rubygems.org/[[email protected] src]# gem sources -a https://ruby.taobao.org/
配置Redmine
[[email protected] src]# tar zxf redmine-3.2.1.tar.gz[[email protected] src]# mv redmine-3.2.1 /data/redmine[[email protected] src]# sed -i "s/source ‘https:\/\/rubygems.org‘/source ‘https:\/\/ruby.taobao.org‘/" /data/redmine/Gemfile[[email protected] src]# cp /data/redmine/config/configuration.yml.example /data/redmine/config/configuration.yml[[email protected] src]# cp /data/redmine/public/dispatch.fcgi.example /data/redmine/public/dispatch.fcgi[[email protected] src]# cp /data/redmine/public/htaccess.fcgi.example /data/redmine/public/htaccess.fcgi[[email protected] src]# sed -i ‘s/#imagemagick_convert_command:/imagemagick_convert_command:\ \/usr\/local\/imagemagick\/bin\/convert/‘ /data/redmine/config/configuration.yml[[email protected] src]# sed -i ‘s/attachments_storage_path:/attachments_storage_path\: \/data\/redmine\/files/‘ /data/redmine/config/configuration.yml# 設定資料庫[[email protected] src]# cat > /data/redmine/config/database.yml << EOFproduction: adapter: mysql2 database: redmine host: localhost username: redmineuser password: "redmine.2016P" encoding: utf8EOF[[email protected] src]# chown -R www.www /data/redmine[[email protected] src]# mkdir /data/wwwlogs/redmine[[email protected] src]# chown -R www:www /data/wwwlogs/redmine/[[email protected] src]# rm -rf /data/redmine/files/delete.me
配置Apache
[[email protected] src]# mv /usr/local/apache/conf/vhost/0.conf{,\.bak}[[email protected] src]# cat > /usr/local/apache/conf/vhost/redmine.conf << EOF<VirtualHost *:80> ServerName redmine.test.com ServerAdmin [email protected] DocumentRoot /data/redmine/public/ ErrorLog /data/wwwlogs/redmine/error_redmine_apache.log CustomLog /data/wwwlogs/redmine/access_redmine_apache.log common <Directory /data/redmine/public/> Options +indexes Order allow,deny Allow from all Require all granted </Directory></VirtualHost>EOF
安裝gem依賴包
[[email protected] src]# gem install bundle[[email protected] src]# gem install rbpdf-font[[email protected] src]# gem install htmlentities -v=4.3.1[[email protected] src]# gem install rmagick --verbose -- --with-opt-dir=/usr/local/imagemagick --with-opt-include=/usr/local/imagemagick/include --with-opt-lib=/usr/local/imagemagick/lib --ruby=/usr/local/ruby[[email protected] src]# gem install mysql2 -- --with-mysql-include=/usr/local/mariadb/include/mysql/ --with-mysql-lib=/usr/local/mariadb/lib/ --with-mysql-dir=/usr/local/mariadb/[[email protected] src]# gem install passenger -v=5.0.28[[email protected] src]# cat >> /usr/local/apache/conf/httpd.conf << EOF LoadModule passenger_module /usr/local/ruby/lib/ruby/gems/2.3.0/gems/passenger-5.0.28/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/local/ruby/lib/ruby/gems/2.3.0/gems/passenger-5.0.28 PassengerDefaultRuby /usr/local/ruby/bin/ruby </IfModule>EOF[[email protected] src]# passenger-install-apache2-module --apxs2-path /usr/local/apache/bin/apxs --apr-config-path /usr/local/apache/bin/apr-1-config# 此處按斷行符號
安裝Redmine
[[email protected] redmine]# cd /data/redmine[[email protected] redmine]# bundle install --without development test postgresql sqlite[[email protected] redmine]# sed -i "/inodot/{ n; s/‘inodot‘/#‘inodot‘/; }" /usr/local/ruby/lib/ruby/gems/2.3.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb[[email protected] redmine]# mv /data/redmine/lib/tasks/testing.rake{,\.bak}[[email protected] redmine]# rm -rf /data/redmine/Gemfile.lock[[email protected] redmine]# gem install rbpdf-font[[email protected] redmine]# bundle install --without development test postgresql sqlite[[email protected] redmine]# bundle exec rake generate_secret_token[[email protected] redmine]# bundle exec rake db:migrate RAILS_ENV=production[[email protected] redmine]# RAILS_ENV=production rake redmine:load_default_data# 此處輸入"zh",然後按斷行符號鍵
重啟Apache
[[email protected] redmine]# service httpd restart
訪問Redmine
瀏覽器訪問伺服器的80連接埠
本文出自 “Junlins” 部落格,請務必保留此出處http://junlins.blog.51cto.com/7601672/1789781
CentOS 6.7 x64 Apache/PHP/Mariadb環境安裝Redmine3.2.1