rvm和redmine的安装
____________________________________________________________________________________________________________________________
install RVM and RUBY | OK
____________________________________________________________________________________________________________________________
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
source /root/.bashrc
source /root/.bash_profile
mkdir -p /root/.rvm/user
echo "ruby_url=https://cache.ruby-china.org/pub/ruby" > /root/.rvm/user/db
curl -L raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable --ruby --rails
_______________________________________________________________________________________
curl -L https://raw.githubusercontent.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s
rvm list known
rvm install 1.9.3
rvm remove 1.9.3
rvm list
rvm use 1.9.3
rvm gemset create rails20
rvm gemset list
rvm use 1.9.3@rails20
rvm gemset list
______________________________________________________________
OK
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
source /root/.bashrc
source /root/.bash_profile
mkdir -p /root/.rvm/user
echo "ruby_url=https://cache.ruby-china.org/pub/ruby" > /root/.rvm/user/db
curl -sSL https://get.rvm.io | bash -s stable --ruby --rails
\curl -sSL https://get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
rails -v
Rails 4.2.0
rvm gemset list
gemsets for ruby-2.2.0 (found in /usr/local/rvm/gems/ruby-2.2.0)
=> (default)
global
#show redmine
http://www.redmine.org/projects/redmine/wiki/RedmineInstall
ruby -v
rvm remove 1.9.3
rvm list known
rvm install 2.1
gem install bundler
rvm use 2.1.1 --default
rvm gemset create rails4.2
gem install rails --version=4.2
rvm use 2.1.1@rails4.2
_________________________________________________________________________________________
ruby_redmine
URL
http://www.iyunv.com/thread-43667-1-1.html
http://ruby-china.org/wiki/rvm-guide
#show redmine
http://www.redmine.org/projects/redmine/wiki/RedmineInstall
_______________________________________________________________________________________
yum install zlib-devel gcc gcc-c++ make autoconf curl-devel ImageMagick-devel -y
_______________________________________________________________________________________
rvm install -> show ruby version -> ruby install -> rails install -> redmine install
|
|
↓
http://www.redmine.org/projects/redmine/wiki/RedmineInstal
_______________________________________________________________________________________
#first you should install mysql
_______________________________________________________________________________________
_______________________________________________________________________________________
#1 config redmine /config/$.yml
tar -zxf redmine-3.3.0.tar.gz -C /opt
cd /opt/redmine-3.3.0/config
cp -a database.yml.example database.yml
vi /opt/redmine-3.3.0/config/database.yml
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: "redmine"
encoding: utf8
socket: /usr/local/mysql/mysqld.sock(mysqld.sock的绝对路径)
cp -a configuration.yml.example configuration.yml
_______________________________________________________________________________________
#2 redmine install
#install environment package
cd /opt/redmine-3.3.0/
rvm use 2.1
bundle install --without development test
useradd -M -g redmine -s /sbin/nologin redmine
chown -R redmine.redmine /opt/redmine-3.3.0
_______________________________________________________________________________________
#3 config mysql data and user
#Mysql database seting
#login mysql,create redmine data and user
mysql -uroot -p
mysql> create database redmine character set utf8 collate utf8_bin;
mysql> create user 'redmine'@'localhost' identified by 'redmine';
mysql> grant all privileges on *.* to 'redmine'@'localhost';
mysql> flush privileges;
_______________________________________________________________________________________
#4 redmine install
#if you restore redmine.first you must restoe old mysql data."mysql -uroot -p redmine < redmine.bak.sql"
cd /opt/redmine-3.3.0
rake generate_secret_token
vim /usr/local/rvm/gems/ruby-2.3.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb
:465
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data
>zh
mkdir -p tmp tmp/pdf public/plugin_assets
chmod -R 755 files log tmp public/plugin_assets
_______________________________________________________________________________________
_______________________________________________________________________________________
#>updata or bakcup redmine
#1backup your mysql database (you must be use "mysql -uroot -p redmine < redmine.sql" ).and check mysql user privileges.command test connect mysql user.
#2backup /opt/redmine-3.3.0/files to new /opt/redmine-3.3.0/files
cd /opt/redmine-3.3.0
vim /usr/local/rvm/gems/ruby-2.3.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb
:465
bundle exec rake generate_secret_token
bundle exec rake db:migrate RAILS_ENV=production
_______________________________________________________________________________________
_______________________________________________________________________________________
#back your plugins
#backup /opt/redmine-3.3.0/plugins to new /opt/redmine-3.3.0/plugins
bundle exec rake redmine:plugins:migrate RAILS_ENV=production
bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production
_______________________________________________________________________________________
_______________________________________________________________________________________
#if error please runing gem install rmagick
gem install rmagick
_______________________________________________________________________________________
_______________________________________________________________________________________
#run service
cd /opt/redmine-3.3.0/
ruby bin/rails server webrick -e production -b 0.0.0.0 -p 3000 &
_______________________________________________________________________________________
other
_______________________________________________________________________________________
#ruby bin/rails server webrick -e production
#ruby script/rails server webrick -e production -p 3000 -d
#nohup ruby bin/rails server webrick -e production >>/opt/redmine/running_redmine.log 2>&1 &
_______________________________________________________________________________________
_______________________________________________________________________________________
#redmine user and password login
admin
admin
http://IP:3000
_______________________________________________________________________________________
_______________________________________________________________________________________
#sendmail seting
vi /opt/redmine-3.3.0.20/config/configuration.yml
default:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "smtp.mxhichina.com"
port: 25
authentication: :plain
domain: 'mail.e-eduspace.com'
user_name: 'redmine@e-eduspace.com'
password: 'Yjkj123456'
________________________________________________________________________________________
#redmine source install to /opt/redmine-3.3.0
#install......
#first "ruby bin/rails server webrick -e production -b 0.0.0.0 -p 3000 &" is OK,
kill -9 PID
_____________________________________________________________________________________
tar -zxf nginx-1.8.0.tar.gz -C /root
_____________________________________________________________________________________
cd /opt/redmine-3.3.0/public
cp -a dispatch.fcgi.example dispatch.fcgi
cp -a htaccess.fcgi.example .htaccess
_____________________________________________________________________________________
gem install passenger
cd /root
passenger-install-nginx-module
>Enter
>Enter
>2
choose source package path for /root/nginx-1.8.0
>/usr/local/nginx
>Enter
>yes
_____________________________________________________________________________________
nginx:
vi /usr/local/nginx/conf/nginx.conf
http{
##
###
####
#####
include /usr/local/nginx/conf/conf.d/*.conf;
}
vim /usr/local/nginx/conf/conf.d/redmine.conf
server {
listen 80;
server_name localhost;
access_log /usr/local/nginx/logs/accese.log combined;
index index.html index.htm index.jsp index.php;
root /opt/redmine-3.3.3/public;
passenger_enabled on;
}