redmine3的安装和升级
redmine3的安装和升级
参考:
http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Requirements
Redmine3.0的需求:currenttrunkruby1.9.3,2.0.01,2.1,2.2Rails4.21.搭建redmine3环境【安装软件包】#yuminstallzlib-develgccgcc-c++makeautoconfcurl-develImageMagick-develmysqlmysql-devel【下载安装包,修改db和email的设置】#tarzxvfredmine-3.0.0.tar.gz&&cdredmine-3.0.0/config#cp-adatabase.yml.exampledatabase.yml#cp-aconfiguration.yml.exampleconfiguration.yml【建立ruby2.2+rails4.2的环境】#gpg--keyserverhkp://keys.gnupg.net--recv-keys409B6B1796C275462A1703113804BB82D39DC0E3#curl-sSLhttps://get.rvm.io|bash-sstable--ruby--rails重新登录一次:$ruby-vruby2.2.0p0(2014-12-25revision49005)[x86_64-linux]$rails-vRails4.2.0#rvmgemsetlistgemsetsforruby-2.2.0(foundin/usr/local/rvm/gems/ruby-2.2.0)=>(default)global#cd/data/website/redmine-3.0.0【安装依赖包】#bundleinstall--withoutdevelopmenttest#useradd-s/sbin/nologin-M-c"redmine"redmine#chown-Rredmine:redmine/data/website/redmine-3.0.0若是全新安装:【db】mysql登录后,建立redmine数据库和用户:#mysql-hx.x.x.x-Pxxxx-uroot-pmysql>createdatabaseredminecharactersetutf8collateutf8_bin;mysql>createuser'redmine'@'127.0.0.1'identifiedby'xxxxxx';mysql>grantallprivilegesonredmine.*to'redmine'@'127.0.0.1';mysql>exit;#rakegenerate_secret_token#RAILS_ENV=productionrakedb:migrate#RAILS_ENV=productionrakeredmine:load_default_data#mkdir-ptmptmp/pdfpublic/plugin_assets#chmod-R755fileslogtmppublic/plugin_assets若是升级:【db】备份数据库检查db用户权限命令行测试连接执行:#bundleexecrakegenerate_secret_token#bundleexecrakedb:migrateRAILS_ENV=production若有插件:#bundleexecrakeredmine:plugins:migrateRAILS_ENV=production#bundleexecraketmp:cache:cleartmp:sessions:clearRAILS_ENV=production启动服务:#cd/data/website/redmine-3.0.0/#rubybin/railsserverwebrick-eproduction也可以放入后台:#nohuprubybin/railsserverwebrick-eproduction>>/data/log/web/redmine/running_redmine.log2>&1&默认管理员:admin,admin访问http://IP:30002.迁移redmine服务到nginx下#yuminstallpcrepcre-devel#wgethttp://nginx.org/download/nginx-1.6.2.tar.gz#tarzxvfnginx-1.6.2.tar.gz-C/data/download/#mkdir-p/var/cache/nginx/{client_temp,proxy_temp,fastcgi_temp,uwsgi_temp,scgi_temp}#geminstallpassenger#passenger-vPhusionPassengerversion4.0.59"PhusionPassenger"isatrademarkofHongliLai&NinhBui.注:若遇到geminstallpassenger不能生效的问题,可能是ruby的仓库被GFW了,此时,先安装fastthread可以解决问题:#geminstallfastthread#geminstallpassenger安装:#passenger-install-nginx-moduleEnteryourchoice(1or2)orpressCtrl-Ctoabort:2--------------------------------------------WhereisyourNginxsourcecodelocated?Pleasespecifythedirectory:/data/download/nginx-1.6.2--------------------------------------------WheredoyouwanttoinstallNginxto?Pleasespecifyaprefixdirectory[/opt/nginx]:/etc/nginx--------------------------------------------ExtraNginxconfigureoptionsIfyouwanttopassextraargumentstotheNginx'configure'script,thenpleasespecifythem.Ifnot,thenspecifynothingandpressEnter.Ifyouspecifynothingthenthe'configure'scriptwillberunasfollows:sh./configure--prefix='/etc/nginx'--with-http_ssl_module--with-http_gzip_static_module--with-http_stub_status_module--with-cc-opt='-Wno-error'--add-module='/usr/local/rvm/gems/ruby-2.2.0/gems/passenger-4.0.59/ext/nginx'Extraargumentstopasstoconfigurescript:--sbin-path=/usr/sbin/nginx--conf-path=/etc/nginx/nginx.conf--error-log-path=/var/log/nginx/error.log--http-log-path=/var/log/nginx/access.log--pid-path=/var/run/nginx.pid--lock-path=/var/run/nginx.lock--http-client-body-temp-path=/var/cache/nginx/client_temp--http-proxy-temp-path=/var/cache/nginx/proxy_temp--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp--http-scgi-temp-path=/var/cache/nginx/scgi_temp--user=nginx--group=nginx--------------------------------------------ConfirmconfigureflagsTheNginxconfigurescriptwillberunasfollows:sh./configure--prefix='/etc/nginx'--with-http_ssl_module--with-http_gzip_static_module--with-http_stub_status_module--with-cc-opt='-Wno-error'--add-module='/usr/local/rvm/gems/ruby-2.2.0/gems/passenger-4.0.59/ext/nginx'--sbin-path=/usr/sbin/nginx--conf-path=/etc/nginx/nginx.conf--error-log-path=/var/log/nginx/error.log--http-log-path=/var/log/nginx/access.log--pid-path=/var/run/nginx.pid--lock-path=/var/run/nginx.lock--http-client-body-temp-path=/var/cache/nginx/client_temp--http-proxy-temp-path=/var/cache/nginx/proxy_temp--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp--http-scgi-temp-path=/var/cache/nginx/scgi_temp--user=nginx--group=nginx--------------------------------------------NginxwithPassengersupportwassuccessfullyinstalled.PleaseedityourNginxconfigurationfile,andsetthepassenger_rootandpassenger_rubyconfigurationoptionsinthe'http'block,likethis:http{...passenger_root/usr/local/rvm/gems/ruby-2.2.0/gems/passenger-4.0.59;passenger_ruby/usr/local/rvm/gems/ruby-2.2.0/wrappers/ruby;...}Afteryou(re)startNginx,youarereadytodeployanynumberofwebapplicationsonNginx.PressENTERtocontinue.--------------------------------------------Deployingawebapplication:anexampleSupposeyouhaveawebapplicationin/somewhere.AddaserverblocktoyourNginxconfigurationfile,setitsrootto/somewhere/public,andset'passenger_enabledon',likethis:server{listen80;server_namewww.yourhost.com;root/somewhere/public;#<---besuretopointto'public'!passenger_enabledon;}Andthat'sit!YoumayalsowanttochecktheUsersGuideforsecurityandoptimizationtipsandotherusefulinformation:/usr/local/rvm/gems/ruby-2.2.0/gems/passenger-4.0.59/doc/UsersguideNginx.htmlhttps://www.phusionpassenger.com/documentation/Users%20guide%20Nginx.htmlEnjoyPhusionPassenger,aproductofPhusion(www.phusion.nl):-)https://www.phusionpassenger.comPhusionPassengerisatrademarkofHongliLai&NinhBui.#useradd-s/sbin/nologin-M-c"nginxServer"nginx#mkdir-p/etc/nginx/conf.d/data/log/svr/nginx/data/log/web/redmine$cat/etc/nginx/nginx.conf#usernobody;worker_processes4;error_log/data/log/svr/nginx/error.log;#error_loglogs/error.lognotice;#error_loglogs/error.loginfo;pid/var/run/nginx.pid;events{useepoll;worker_connections65535;}http{includemime.types;default_typeapplication/octet-stream;server_tokensoff;log_formatmain'$remote_addr-$remote_user[$time_local]"$request"''$status$body_bytes_sent"$http_referer"''"$http_user_agent""$http_x_forwarded_for"';access_log/data/log/svr/nginx/access.logmain;sendfileon;tcp_nopushon;tcp_nodelayon;keepalive_timeout65;server_names_hash_bucket_size128;client_header_buffer_size32k;large_client_header_buffers432k;client_body_temp_path/tmp;client_max_body_size500m;fastcgi_connect_timeout600;fastcgi_send_timeout300;fastcgi_read_timeout3600;fastcgi_buffer_size400k;fastcgi_buffers161m;fastcgi_busy_buffers_size10m;fastcgi_temp_file_write_size20m;fastcgi_intercept_errorson;gzipon;gzip_min_length1k;gzip_buffers416k;gzip_http_version1.0;gzip_comp_level2;gzip_disable"MSIE[1-6].";gzip_typestext/plainapplication/x-javascripttext/csstext/javascriptapplication/x-httpd-phpp_w_picpath/jpegp_w_picpath/gifp_w_picpath/png;gzip_varyon;passenger_root/usr/local/rvm/gems/ruby-2.2.0/gems/passenger-4.0.59;passenger_ruby/usr/local/rvm/gems/ruby-2.2.0/wrappers/ruby;#Loadconfigfilesfromthe/etc/nginx/conf.ddirectory#Thedefaultserverisinconf.d/default.confincludeconf.d/*.conf;}$cat/etc/nginx/conf.d/redmine.conf##redmine#server{listenx.x.x.x:80;server_nameredmine.xxx.com;root/data/website/redmine-3.0.0/public;passenger_enabledon;access_log/data/log/web/redmine/access.logmain;}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。