CentOS 6.7 x64 Apache/PHP/Mariadb环境安装Redmine3.2.1
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS 6.7 x64 Apache/PHP/Mariadb环境安装Redmine3.2.1相关的知识,希望对你有一定的参考价值。
系统安装按照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 << EOF production: adapter: mysql2 database: redmine host: localhost username: redmineuser password: "redmine.2016P" encoding: utf8 EOF [[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的主要内容,如果未能解决你的问题,请参考以下文章
CentOS 6.7 x64 Redmine与Subversion结合
4# CentOS 6.7 x64 安装Subversion1.9.3(svn,http)