1 頁 (共 1 頁)

redmine 安裝

發表於 : 2015-01-15 13:23:53
schumi
環境: CentOS 6.6 + nginx 1.6.2 + thin + redmine 2.6.1

參考
http://www.redmine.org/projects/redmine ... ineInstall
https://gist.github.com/wake/5432215
http://ruby-on-rails-book.kejyun.com/in ... rails.html

開始
1.
vi /etc/yum.repos.d/CentOS-nginx.repo

代碼: 選擇全部

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
2.
yum update

3.
yum groupinstall "Development Tools" -y
yum install nginx ImageMagick ImageMagick-devel mysql mysql-devel

4.
curl -sSL https://rvm.io/mpapis.asc | sudo gpg2 --import -
curl -L https://get.rvm.io | sudo bash -s stable

5.
rvm requirements
rvm install 2.1

6.
gem install rails -v 3.2 --no-rdoc --no-ri
gem install bundler
gem install thin
gem install rmagick
gem install mysql2

7.
vi /AP/redmine/Gemfile.local

代碼: 選擇全部

gem 'thin'
8.
bundle install --without development test

9.
cd /AP/redmine/conf
mv database.yml.example database.yml

10.
vi database.yml

11.
cd /AP/redmine
env RAILS_ENV=production rake db:migrate
env RAILS_ENV=production rake redmine:load_default_data
rake generate_secret_token
thin install
mv /etc/rc.d/thin /etc/init.d/
vi /etc/init.d/thin

12.
vi /etc/thin/redmine.yml

代碼: 選擇全部

pid: /var/run/thin/thin.pid
group: nginx
wait: 30
timeout: 30
log: /var/log/thin/thin.log
max_conns: 1024
require: []

environment: production
max_persistent_conns: 512
servers: 4
daemonize: true
user: nginx
socket: /var/run/thin/thin.sock
chdir: /AP/redmine
13.
mkdir /var/run/thin
chown nginx:nginx /var/run/thin/ -R

13.
vi /etc/logrotate.d/thin

代碼: 選擇全部

/var/log/thin/*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/thin restart >/dev/null
endscript
}
14.
vi /etc/nginx/conf.d/proxy.include

代碼: 選擇全部

proxy_set_header   Host $http_host;
proxy_set_header   X-Real-IP $remote_addr;
proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header   X-Forwarded-Proto $scheme;

client_max_body_size       10m;
client_body_buffer_size    128k;

proxy_connect_timeout      90;
proxy_send_timeout         90;
proxy_read_timeout         90;

proxy_buffer_size          4k;
proxy_buffers              4 32k;
proxy_busy_buffers_size    64k;
proxy_temp_file_write_size 64k;
15.
vi /etc/nginx/conf.d/redmine.conf

代碼: 選擇全部

# Upstream Ruby process cluster for load balancing
upstream thin_cluster {
    server unix:/var/run/thin/thin.0.sock;
    server unix:/var/run/thin/thin.1.sock;
    server unix:/var/run/thin/thin.2.sock;
    server unix:/var/run/thin/thin.3.sock;
}

server {
    listen       your.ip.address.here:80;
    server_name  your.domain.name;

    access_log  /var/log/nginx/redmine-proxy-access;
    error_log   /var/log/nginx/redmine-proxy-error;

    include conf.d/proxy.include;
    root /AP/redmine/public;
    proxy_redirect off;

    location / {
        try_files $uri/index.html $uri.html $uri @cluster;
    }

    location @cluster {
        proxy_pass http://thin_cluster;
    }
}
16.
chkconfig --level 2345 thin on
chkconfig --level 2345 nginx on
/etc/init.d/thin start
/etc/init.d/nginx start

17.
http://your.domain.name
admin/admin