Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

Embed Size (px)

Citation preview

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    1/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 1/16

     07/02/2015  Bùi Đứ c Hiệu  Redmine

    Bạn có th c m c? Hãy tìm ki m những bài vi t hữu ích!   SEARCH

    Cài đặt Redmine trên CentOS vớ i Nginx

    và Unicorn / Redmine / Cài đặt Redmine trên CentOS vớ i Nginx và Unicorn

    Việc cài đặt Redmine hiện tại có thể thự c hiện dễ dàng qua Bitnami, như ng tôi vẫn

    thích cách cài đặt thủ công hơ n. Vớ i một chút hiểu biết về Ruby on Rails và CSS,

    HTML chúng ta có thể chỉnh sử a lại vài thứ  mà chúng ta thích dễ dàng hơ n nhiềuso vớ i việc cài đặt từ  các gói đóng sẵn. Bài viết này sẽ trình bày từ ng bư ớ c cài đặt

    để triển khai một Redmine Server, các thành phần nào các bạn đã cài thì có thể

    bỏ qua. Tuy hệ điều hành đư ợ c thử  nghiệm là CentOS 7 như ng việc cài đặt trên

    CentOS 6 cũng không khác gì cả.

    1. Môi trư ờ ng cài đặt

    – OS: CentOS 7

    Username

    Password

     Remember Me

    Login →

    Lost Password

    Đăng nhập

    Bài viế t phổ biế n

    Cài đặt Redmine trên CentOS

    vớ i Nginx và Unicorn

    Giớ i thiệu về Zimbra

    Zonmob Labs

    http://labs.zonmob.com/http://labs.zonmob.com/http://labs.zonmob.com/http://labs.zonmob.com/http://labs.zonmob.com/http://labs.zonmob.com/http://labs.zonmob.com/zimbra/gioi-thieu-ve-zimbra.htmlhttp://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.htmlhttp://labs.zonmob.com/wp-login.php?action=lostpasswordhttp://labs.zonmob.com/redminehttp://labs.zonmob.com/http://labs.zonmob.com/redmine

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    2/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 2/16

    – Ruby: 2.1.5

    – Redmine: 2.6.1

    – Nginx: 1.6.2

    – Unicorn: 4.8.3

    2. Cài đặt các gói phụ thuộc của Redmine – Cài đặt các gói phụ thuộc cần thiết

    – Cơ  sở  dữ  liệu đư ợ c sử  dụng là MariaDB, thay thế cho MySQL

    Nếu các bạn vẫn muốn dùng MySQL

    3. Cài đặt Ruby

    Cài đặt Ruby 2.1.5 trong môi trư ờ ng rbenv

    Agile

    Git

    Linux

    Tổng kết rút kinh nghiệm dự án Dog and Chicken

    Tại sao email của tôi lại vào

    thư  mục spam?

    Work倀ow cho developer

    team sử  dụng Unity3D và Git

    Bài viế t mớ i nhất

    Work倀ow cho developer

    team sử  dụng Unity3D và Git

    Kinh nghiệm Git: Branchearly, branch often

    Một số k ĩ  thuật cần biết khi

    làm việc vớ i Git

    Tổng kết rút kinh nghiệm dự 

    án Dog and Chicken

    Test Cases cho Games Apps /

    Checklist cho Games Apps

    Chủ đề

    123

    $ sudo yum -y groupinstall "Development Tools"$ sudo yum -y install openssl-devel readline-devel zlib-devel curl-devel lib$ sudo yum -y install ImageMagick ImageMagick-devel ipa-pgothic-fonts

    1 $ sudo yum -y install mariadb-server mariadb-devel

    1 $ sudo yum -y install mysql-server mysql-devel

    1 $ sudo yum install gcc make openssl openssl-devel

    12

    34

    $ cd /usr/local/$ sudo git clone git://github.com/sstephenson/rbenv.git rbenv 

    $ mkdir -p rbenv/shims rbenv/versions$ sudo groupadd /usr/local/rbenv

    http://labs.zonmob.com/testing-qa/test-cases-cho-games-apps-checklist-cho-games-apps.htmlhttp://labs.zonmob.com/unity/tong-ket-rut-kinh-nghiem-du-dog-chicken.htmlhttp://labs.zonmob.com/git/mot-so-ki-thuat-can-biet-khi-lam-viec-voi-git.htmlhttp://labs.zonmob.com/git/kinh-nghiem-git-branch-early-branch-often.htmlhttp://labs.zonmob.com/unity/workflow-cho-developer-team-su-dung-unity3d-va-git.htmlhttp://labs.zonmob.com/unity/workflow-cho-developer-team-su-dung-unity3d-va-git.htmlhttp://labs.zonmob.com/mail/tai-sao-email-cua-toi-lai-vao-thu-muc-spam.htmlhttp://labs.zonmob.com/unity/tong-ket-rut-kinh-nghiem-du-dog-chicken.htmlhttp://labs.zonmob.com/linuxhttp://labs.zonmob.com/githttp://labs.zonmob.com/agile

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    3/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 3/16

    Tạo một môi trư ờ ng vớ i thiết lập †le /etc/pro儀le.d/rbenv.sh

    Cài đặt Bundler

    4. Thiế t lập MariaDB

    Thiết lập cấu hình cho MariaDB lư u tại /etc/my.cnf 

    Mail

    Nginx

    Redmine

    Testing – QA

    Unity

    Zimbra

    5678

    $ sudo chgrp -R rbenv rbenv/$ sudo git clone git://github.com/sstephenson/ruby-build.git /usr/local/rben $ cd /usr/local/rbenv/ruby-build$ ./install.sh

    123

    export RBENV_ROOT="/usr/local/rbenv"export PATH="/usr/local/rbenv/bin:$PATH"eval "$(rbenv init -)"

    12345

    6789101112

    $ source /etc/profile.d/rbenv.sh$ sudo rbenv install -v 2.1.5$ rbenv versions* system (set by /usr/local/rbenv/version)  2.1.3

    $ sudo rbenv global 2.1.3$ rbenv versions  system* 2.1.5 (set by /usr/local/rbenv/version)$ ruby --versionruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]$

    123

    $ sudo gem install bundler --no-rdoc --no-ri$ bundle --versionBundler version 1.7.12

    12

    [mysqld]datadir=/data/mysql # Thư mục dữ liệu, bất kỳ

    http://labs.zonmob.com/zimbrahttp://labs.zonmob.com/unityhttp://labs.zonmob.com/testing-qahttp://labs.zonmob.com/redminehttp://labs.zonmob.com/web-server/nginxhttp://labs.zonmob.com/mail

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    4/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 4/16

    Tạo thư  mục chứ a dữ  liệu và cài đặt.

    Thiết lập mật khẩu tài khoản root bằng mysql_secure_installation

    345678910111213141516171819202122

    23

    socket=/var/lib/mysql/mysql.sock# Disabling symbolic-links is recommended to prevent assorted security risksymbolic-links=0# Settings user and group are ignored when systemd is used.# If you need to run mysqld under a different user or group,# customize your systemd unit file for mariadb according to the# instructions in http://fedoraproject.org/wiki/Systemd character-set-server=utf8 [mysqld_safe]log-error=/var/log/mariadb/mariadb.logpid-file=/var/run/mariadb/mariadb.pid ## include all files from the config directory#!includedir /etc/my.cnf.d [mysql]

    default-character-set=utf8

    1234

    $ sudo mkdir -p /data/mysql # Tạo một thư mục dữ liệu$ sudo chown mysql:mysql /data/mysql$ sudo service mariadb start$ sudo systemctl enable mariadb

    1234567

    8910

    $ mysql_secure_installationNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB  SERVERS IN PRODUCTION USE! PLEASE RE D E H STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the currentpassword for the root user.  If you've just installed MariaDB, andyou haven't set the root password yet, the password will be blank,

    so you should just press enter here. Enter current password for root (enter for none):

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    5/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 5/16

    1112131415161718192021222324252627282930

    313233343536373839404142

    4344454647484950515253

    545556

    OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDBroot user without the proper authorisation. Set root password? [Y/n] yNew password: ${root_passwd}Re-enter new password: ${root_passwd}Password updated successfully!Reloading privilege tables.. ... Success! 

    By default, a MariaDB installation has an anonymous user, allowing anyoneto log into MariaDB without having to have a user account created forthem.  This is intended only for testing, and to make the installationgo a bit smoother.  You should remove them before moving into aproduction environment. Remove anonymous users? [Y/n] y

     ... Success! Normally, root should only be allowed to connect from 'localhost'.  Thisensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y ... Success! By default, MariaDB comes with a database named 'test' that anyone canaccess.  This is also intended only for testing, and should be removedbefore moving into a production environment. 

    Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so farwill take effect immediately. Reload privilege tables now? [Y/n] y ... Success!

     Cleaning up... 

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    6/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 6/16

    Tạo cơ  sở  dữ  liệu và tài khoản trên MariaDB cho Redmine

    5. Cài đặt Redmine

    Tải về mã nguồn Redmine từ  trang chủ và tạo một liên kết sang /opt .

    57585960

    All done! If you've completed all of the above steps, your MariaDBinstallation should now be secure. Thanks for using MariaDB!

    1234567891011

    1213141516171819202122

    $ mysql -u root -pEnter password: ${mysql_root_password}Welcome to the MariaDB monitor.  Commands end with ; or \g.Your MariaDB connection id is 10Server version: 5.5.40-MariaDB MariaDB Server Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input stateme MariaDB [(none)]>

    MariaDB [(none)]>MariaDB [(none)]> CREATE DATABASE redmine DEF ULT character set utf8;Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> grant all on redmine.* TO redmine@localhost identified by Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> flush privileges;Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> exit;

    123

    4

    $ cd /usr/local/src$ sudo curl -O http://www.redmine.org/releases/redmine-2.6.1.tar.gz $ sudo tar zxvf redmine-2.6.1.tar.gz

    $ sudo ln -s ./redmine-2.6.1 /opt/redmine # Tạo một liên kết tượng trưng

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    7/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 7/16

    Sau đó, thiết lập cơ  sở  dữ  liệu của Redmine.

    Đầu tiên, sao chép †le cấu hình ví dụ.

    Sau đó, điền các thông tin đã tạo lúc trư ớ c.

     /opt/redmine/con儀g/database.yml 

    Cài đặt các gói phụ thuộc và nhập cơ  sở  dữ  liệu thông qua bundle

    6. Cài đặt Unicorn

    Cài đặt Unicorn bằng cách chỉnh sử a Gem†le ( /opt/redmine) và thêm vào đoạn

    dư ớ i đây,

    1 $ sudo cp -p /opt/redmine/config/database.yml.example /opt/redmine/config/da

    123456

    789101112

    # Default setup is given for MySQL with ruby1.9. If you're running Redmine# with MySQL and ruby1.8, replace the adapter name with `mysql`.# Examples for PostgreSQL, SQLite3 and SQL Server can be found at the end.# Line indentation must be 2 spaces (no tabs). production:

      adapter: mysql2  database: redmine  host: localhost  username: redmine  password: "${redmine_passwd}"  encoding: utf8

    1234

    $ cd /opt/redmine$ bundle install --without development test --path vendor/bundle$ bundle exec rake generate_secret_token$ RAILS_ENV=production bundle exec rake db:migrate

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    8/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 8/16

     /opt/redmine/Gem儀le

    Rồi chạy bundle.

    Sau đó, thiết lập biến môi trư ờ ng cho Redmine.

     /etc/pro儀le.d/redmine.sh

    Cập nhật các biến môi trư ờ ng.

    Tập tin cấu hình của Unicorn như  sau:

    Các tập tin socket là về, như ng nó là một lỗi không tìm thấy trong Nginx khi đặt

    dư ớ i /tmp/ . http://serverfault.com/questions/463993/nginx-unix-domain-socket-

    error/464025#464025

    /opt/redmine/con†g/unicorn.rb

    1 gem 'unicorn', '4.8.3'

    1 $ bundle install

    12

    RAILS_ROOT=/opt/redmineexport RAILS_ROOT

    1 $ source /etc/profile.d/redmine.sh

    1234

    # -*- coding: utf-8 -*-# S ố lượ ng worker c ủa nginx worker_processes 2 

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    9/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 9/16

    Sau bắt đầu-up script.

    /opt/redmine/script/unicorn.sh

    5678910111213

    1415161718192021222324

    2526272829303132

    # Sock listen  '/var/run/unicorn.sock'pid  '/var/run/unicorn.pid' # Log log = File.expand_path('log/unicorn.log', ENV['RAILS_ROOT'])stderr_path File.expand_path('log/unicorn.log', ENV['RAILS_ROOT'])stdout_path File.expand_path('log/unicorn.log', ENV['RAILS_ROOT']) 

    preload_app trueGC.respond_to?(:copy_on_write_friendly=) and GC.copy_on_write_friendly = true before_fork do |server, worker|defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! old_pid = "#{ server.config[:pid] }.oldbin"unless old_pid == server.pid  begin  sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU  Process.kill :QUIT, File.read(old_pid).to_i

      rescue Errno::ENOENT, Errno::ESRCH  endend

    end

     after_fork do |server, worker|  defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connectioend

    12345678910

    #!/bin/bash set -e TIMEOUT=60APP_ROOT=${RAILS_ROOT}PID=/var/run/unicorn.pidRAILS_ENV=productionCMD="bundle exec unicorn -D -c $APP_ROOT/config/unicorn.rb -E $RAILS_ENV"action="$1"

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    10/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 10/16

    111213141516171819

    2021222324252627282930

    313233343536373839404142

    4344454647484950515253545556

    set -u old_pid="$PID.oldbin" cd $APP_ROOT || exit 1 sig () {  test -s "$PID" && kill -$1 `cat $PID`}

     oldsig () {  test -s $old_pid && kill -$1 `cat $old_pid`} case $action instart)  sig 0 && echo >&2 "Already running" && exit 0  $CMD  ;;stop)

      sig QUIT && rm -f ${PID} && exit 0  echo >&2 "Not running"  ;;force-stop)  sig TERM && exit 0  echo >&2 "Not running"  ;;restart|reload)  sig HUP && echo reloaded OK && exit 0  echo >&2 "Couldn't reload, starting '$CMD' instead"  $CMD  ;;

    upgrade)  if sig USR2 && sleep 2 && sig 0 && oldsig QUIT  then  n=$TIMEOUT  while test -s $old_pid && test $n -ge 0  do  printf '.' && sleep 1 && n=$(( $n - 1 ))  done  echo 

    if test $n -lt 0 && test -s $old_pid  then  echo >&2 "$old_pid still exists after $TIMEOUT seconds"  exit 1

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    11/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 11/16

    Các redmine http://localhost/redmine/ bạn cần phải chỉnh sử a con†g.ru như  sau

    nếu gọi là thư  mục con như .

     /opt/redmine/con儀g.ru

    / Redmine phần của, hãy thay thế nó vớ i môi trư ờ ng của bạn.

    7. Cài đặt Nginx

    Lắp đặt trọn gói.

    575859606162636465

    6667686970

      fi  exit 0  fi  echo >&2 "Couldn't upgrade, starting '$CMD' instead"  $CMD  ;;reopen-logs)  sig USR1  ;;

    *)  echo >&2 "Usage: $0 "  exit 1  ;;esac

    12345678

    910

    # This file is used by Rack-based servers to start the application.RAILS_RELATIVE_URL_ROOT="/redmine"require ::File.expand_path('../config/environment',  __FILE__)if RAILS_RELATIVE_URL_ROOT then  map RAILS_RELATIVE_URL_ROOT do  run Rails.application  endelse

      run Rails.applicationend

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    12/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 12/16

    Các bản gốc nếu /etc/nginx/conf.d/redmine.conf Làm thế nào có thể như  vậy nên

    viết như , các trang web có sẵn thờ i gian này trong cùng một cách như  Ubuntu, bạn

    có thể tạo và cấu hình các trang web cho phép.

    Sau tập tin cấu hình Nginx.

    /etc/nginx/nginx.conf 

    12

    $ sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release$ sudo yum -y install nginx

    1 $ sudo mkdir -p /etc/nginx/sites-avaliable/ /etc/nginx/sites-enabled/

    123456789101112

    1314151617181920212223242526

    user nginx;worker_processes  1; error_log  /var/log/nginx/error.log warn;pid  /var/run/nginx.pid; 

    events {  worker_connections  1024;} 

    http {  include  /etc/nginx/mime.types;  default_type application/octet-stream; 

    log_format main  '$remote_addr - $remote_user [$time_local] "$request"'$status $body_bytes_sent "$http_referer" '

      '"$http_user_agent" "$http_x_forwarded_for"'; 

    access_log  /var/log/nginx/access.log main; 

    sendfile on;  #tcp_nopush on; 

    keepalive_timeout  65;

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    13/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 13/16

    Sauđ

    ó, các tậ

    p tin cấ

    u hình cho Redmine. / Redmine tôi gán cho redmine. Cũ

    ng hỗ

    trợ  SSL Chúng tôi muốn SSL truyền thông.

    /etc/nginx/sites-available/redmine

    272829303132

     #gzip on;

     #include /etc/nginx/conf.d/*.conf;

      include /etc/nginx/sites-enabled/*;}

    12345

    678910111213141516

    171819202122232425262728

    2930

    upstream rails-unicorn {  server unix:/var/run/unicorn.sock fail_timeout=0;} server {

      listen 80;  server_name localhost;  return 301 https://$host$request_uri;} server {  listen 443;  server_name localhost; 

    ssl on;

      ssl_certificate /etc/nginx/ssl/redmine.crt;  ssl_certificate_key /etc/nginx/ssl/redmine.key; 

    ssl_session_timeout 5m; 

    ssl_protocols SSLv3 TLSv1;  ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;  ssl_prefer_server_ciphers on; 

    #listen 80; ## listen for ipv4; this line is default and implied  #listen [::]:80 default ipv6only=on; ## listen for ipv6 

    root /usr/share/nginx/html/public;  index index.php index.html index.htm;

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    14/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 14/16

    Việc kích hoạt tập tin cấu hình /etc/nginx/sites-enabled/  để tạo ra một liên kết tư ợ ng

    trư ng.

    Sau đó, các tập tin và CSS HTML, vv đư ợ c lư u trữ  trong các Redmine

    313233343536373839

    4041424344454647484950

    515253545556575859606162

    6364

     # Make site accessible from http://localhost/

      server_name localhost; 

    location /redmine/ {  try_files $uri $uri.html $uri/index.html @rails-unicorn;  }  location ~ ^/assets/(.*) {  alias /opt/redmine/public/assets/$1;

      } 

    location @rails-unicorn {  proxy_set_header X-Real-IP $remote_addr;  proxy_set_header X-Forwarded_For $proxy_add_x_forwarded_for;  proxy_set_header Host $http_host;  proxy_pass http://rails-unicorn;  } 

    # Only for nginx-naxsi : process denied requests  #location /RequestDenied {

      # For example, return an error code  #return 418;  #} 

    error_page 404 /404.html; 

    # redirect server error pages to the static page /50x.html  #  error_page 500 502 503 504 /50x.html;  location = /50x.html {  root /usr/share/nginx/html;  }

     }

    1 $ sudo ln -s /etc/nginx/sites-available/redmine /etc/nginx/sites-enabled/

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    15/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 15/16

    Leave a Reply

    Your email address will not be published. Required †elds are marked

     /opt/redmine/public  và tạo ra một liên kết tư ợ ng trư ng của trự c thuộc gốc tài liệu

    Khở i động Unicorn và Nginx.

    No related posts.

     About   Latest Posts

    Bùi Đứ c HiệuLập trình viên at Zonmob Tech., JSC

    Yêu thích tìm hiểu nhữ ng công nghệ mớ i

    *

    1 $ sudo ln -s /opt/redmine/public/ /usr/share/nginx/html/

    123

    $ cd /opt/redmine$ sudo ./script/unicorn.sh start$ sudo service nginx start

    http://www.zonmob.com/http://labs.zonmob.com/author/hieubdhttp://labs.zonmob.com/author/hieubd

  • 8/17/2019 Cài Đặt Redmine Trên CentOS Với Nginx Và Unicorn - Zonmob Labs

    16/16

    5/5/2016 Cài đặt Redmine trên CentOS với Nginx và Unicorn - Zonmob Labs

    http://labs.zonmob.com/redmine/cai-dat-redmine-tren-centos-voi-nginx-va-unicorn.html 16/16

    Name

    Email

    Website

    You may use these HTML tags and attributes:

    Post Comment

    © Copyright 2014, Zonmob Tech., JSC

    *

    *