3# CentOS 6.7 x64 Apache/PHP/Mariadb环境安装Redmine3.2.1

前端之家收集整理的这篇文章主要介绍了3# CentOS 6.7 x64 Apache/PHP/Mariadb环境安装Redmine3.2.1前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

系统安装按照1# CentOS 6.7 x64 最小化安装

Apache/PHP/MariaDB环境按照@L_404_1@



创建数据库

[root@centos2~]#MysqL-uroot-pmariadb.2016P<<EOF2>/dev/null
createdatabaseredminedefaultcharactersetutf8;
createuser'redmineuser'@'%'identifiedby'redmine.2016P';
grantallprivilegesonredmine.*to'redmineuser'@'%'identifiedby'redmine.2016P';
flushprivileges;
EOF


下载、安装Ruby2.3/rubygems2.6.3

[root@centos2src]#wgethttps://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz
[root@centos2src]#wgethttp://production.cf.rubygems.org/rubygems/rubygems-2.6.3.tgz
[root@centos2src]#wgethttp://www.redmine.org/releases/redmine-3.2.1.tar.gz
[root@centos2src]#tarzxfruby-2.3.0.tar.gz
[root@centos2ruby-2.3.0]#cdruby-2.3.0
[root@centos2ruby-2.3.0]#./configure--prefix=/usr/local/ruby&&make&&makeinstall
[root@centos2ruby-2.3.0]#echo"exportPATH=/usr/local/ruby/bin:$PATH">/etc/profile.d/ruby.sh
[root@centos2ruby-2.3.0]#source/etc/profile.d/ruby.sh
[root@centos2ruby-2.3.0]#cd..
[root@centos2src]#tarxfrubygems-2.6.3.tgz
[root@centos2src]#cdrubygems-2.6.3
[root@centos2rubygems-2.6.3]#rubysetup.rb


修改gem源

[root@centos2src]#gemsource--removehttps://rubygems.org/
[root@centos2src]#gemsources-ahttps://ruby.taobao.org/


配置Redmine

[root@centos2src]#tarzxfredmine-3.2.1.tar.gz
[root@centos2src]#mvredmine-3.2.1/data/redmine
[root@centos2src]#sed-i"s/source'https:\/\/rubygems.org'/source'https:\/\/ruby.taobao.org'/"/data/redmine/Gemfile
[root@centos2src]#cp/data/redmine/config/configuration.yml.example/data/redmine/config/configuration.yml
[root@centos2src]#cp/data/redmine/public/dispatch.fcgi.example/data/redmine/public/dispatch.fcgi
[root@centos2src]#cp/data/redmine/public/htaccess.fcgi.example/data/redmine/public/htaccess.fcgi
[root@centos2src]#sed-i's/#imagemagick_convert_command:/imagemagick_convert_command:\\/usr\/local\/imagemagick\/bin\/convert/'/data/redmine/config/configuration.yml
[root@centos2src]#sed-i's/attachments_storage_path:/attachments_storage_path\:\/data\/redmine\/files/'/data/redmine/config/configuration.yml
#配置数据库
[root@centos2src]#cat>/data/redmine/config/database.yml<<EOF
production:
adapter:MysqL2
database:redmine
host:localhost
username:redmineuser
password:"redmine.2016P"
encoding:utf8
EOF
[root@centos2src]#chown-Rwww.www/data/redmine
[root@centos2src]#mkdir/data/wwwlogs/redmine
[root@centos2src]#chown-Rwww:www/data/wwwlogs/redmine/
[root@centos2src]#rm-rf/data/redmine/files/delete.me


配置Apache

[root@centos2src]#mv/usr/local/apache/conf/vhost/0.conf{,\.bak}
[root@centos2src]#cat>/usr/local/apache/conf/vhost/redmine.conf<<EOF
<VirtualHost*:80>
ServerNameredmine.test.com
ServerAdminwalter.jia@junlins.com
DocumentRoot/data/redmine/public/
ErrorLog/data/wwwlogs/redmine/error_redmine_apache.log
CustomLog/data/wwwlogs/redmine/access_redmine_apache.logcommon
<Directory/data/redmine/public/>
Options+indexes
Orderallow,deny
Allowfromall
Requireallgranted
</Directory>
</VirtualHost>
EOF


安装gem依赖包

[root@centos2src]#geminstallbundle
[root@centos2src]#geminstallrbpdf-font
[root@centos2src]#geminstallhtmlentities-v=4.3.1
[root@centos2src]#geminstallrmagick--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
[root@centos2src]#geminstallMysqL2----with-MysqL-include=/usr/local/mariadb/include/MysqL/--with-MysqL-lib=/usr/local/mariadb/lib/--with-MysqL-dir=/usr/local/mariadb/
[root@centos2src]#geminstallpassenger-v=5.0.28
[root@centos2src]#cat>>/usr/local/apache/conf/httpd.conf<<EOF
LoadModulepassenger_module/usr/local/ruby/lib/ruby/gems/2.3.0/gems/passenger-5.0.28/buildout/apache2/mod_passenger.so
<IfModulemod_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
[root@centos2src]#passenger-install-apache2-module--apxs2-path/usr/local/apache/bin/apxs--apr-config-path/usr/local/apache/bin/apr-1-config
#此处按回车


安装Redmine

[root@centos2redmine]#cd/data/redmine
[root@centos2redmine]#bundleinstall--withoutdevelopmenttestpostgresqlsqlite
[root@centos2redmine]#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
[root@centos2redmine]#mv/data/redmine/lib/tasks/testing.rake{,\.bak}
[root@centos2redmine]#rm-rf/data/redmine/Gemfile.lock
[root@centos2redmine]#geminstallrbpdf-font
[root@centos2redmine]#bundleinstall--withoutdevelopmenttestpostgresqlsqlite
[root@centos2redmine]#bundleexecrakegenerate_secret_token
[root@centos2redmine]#bundleexecrakedb:migrateRAILS_ENV=production
[root@centos2redmine]#RAILS_ENV=productionrakeredmine:load_default_data
#此处输入"zh",然后按回车键


重启Apache

[root@centos2redmine]#servicehttpdrestart


访问Redmine

浏览器访问服务器的80端口

原文链接:https://www.f2er.com/centos/381972.html

猜你在找的CentOS相关文章