Redmine 3.2 インストール(CentOS 7)

ライブラリ インストール

sudo firewall-cmd --zone=public --add-service=http --permanent
sudo firewall-cmd --reload
sudo firewall-cmd --zone=public --list-services
sudo yum -y groupinstall "Development Tools"
sudo yum -y install openssl-devel readline-devel zlib-devel curl-devel libyaml-devel libffi-devel
sudo yum -y install postgresql-server postgresql-devel
sudo yum -y install httpd httpd-devel
sudo yum -y install ImageMagick ImageMagick-devel ipa-pgothic-fonts
sudo /etc/init.d/vboxadd setup
sudo systemctl stop firewalld
sudo systemctl disable firewalld
sudo systemctl start httpd
sudo systemctl enable firewalld
sudo systemctl start firewalld

HTML用ディレクトリ 書き換え可能設定

sudo vi /etc/httpd/conf/httpd.conf

<Directory />
  AllowOverride All
  Require all granted

tar xvf ruby-2.2.3.tar.gz
cd ruby-2.2.3
./configure --disable-install-doc
sudo make install
sudo ln -s /usr/local/bin/ruby /usr/bin/ruby
sudo ln -s /usr/local/bin/gem /usr/bin/gem
sudo gem install bundler --no-rdoc --no-ri
sudo ln -s /usr/local/bin/bundle /usr/bin/bundle

データベース 初期設定

sudo postgresql-setup initdb
sudo vi /var/lib/pgsql/data/pg_hba.conf

# Put your actual configuration here
# ----------------------------------
# If you want to allow non-local connections, you need to add more
# "host" records. In that case you will also need to make PostgreSQL
# listen on a non-local interface via the listen_addresses
# configuration parameter, or via the -i or -h command line switches.
host redmine redmine md5
host redmine redmine ::1/128 md5

sudo service postgresql start
sudo systemctl enable postgresql

sudo -u postgres psql


su -
cd /var/lib/pgsql
sudo -u postgres createdb -E UTF-8 -l ja_JP.UTF-8 -O redmine -T template0 redmine
sudo -u postgres createdb -E UTF-8 -l ja_JP.UTF-8 -O redmine -T template0 redmine_development
sudo -u postgres createdb -E UTF-8 -l ja_JP.UTF-8 -O redmine -T template0 redmine_test

sudo gem install bundler --no-rdoc --no-ri

Redmineソースコード ダウンロード

sudo svn co /var/lib/redmine
cd /var/lib/redmine/config/
sudo cp database.yml.example database.yml
sudo cp configuration.yml.example configuration.yml
sudo chmod 777 database.yml
sudo chmod 777 configuration.yml

cd /var/lib/redmine
vi config/database.yml

  adapter: postgresql
  database: redmine
  host: localhost
  username: redmine
  password: "redmine"
  encoding: utf8


  adapter: postgresql
  database: redmine_development
  host: localhost
  username: redmine
  password: "redmine"
  encoding: utf8


  adapter: postgresql
  database: redmine_test
  host: localhost
  username: redmine
  password: "redmine"
  encoding: utf8

vi config/configuration.yml

    delivery_method: :smtp
      address: "localhost"
      port: 25
      domain: ""

  rmagick_font_path: /usr/share/fonts/truetype/takao-gothic/TakaoPGothic.ttf

sudo bundle install --without development test --path vendor/bundle
sudo bundle exec rake generate_secret_token
sudo RAILS_ENV=production bundle exec rake db:migrate
sudo RAILS_ENV=production REDMINE_LANG=ja bundle exec rake redmine:load_default_datafault_data

sudo gem install passenger
sudo ln -s /usr/local/bin/passenger-install-apache2-module /usr/bin/passenger-install-apache2-module
sudo passenger-install-apache2-module --auto


sudo passenger-install-apache2-module --snippet

sudo touch /etc/httpd/conf.d/redmine.conf
sudo vi /etc/httpd/conf.d/redmine.conf

# Redmineの画像ファイル・CSSファイル等へのアクセスを許可する設定。
# Apache 2.4のデフォルトではサーバ上の全ファイルへのアクセスが禁止されている。
<Directory "/var/lib/redmine/public">
  AllowOverride All
  Require all granted

# Passengerの基本設定。
# passenger-install-apache2-module --snippet で表示された設定を記述。
# 環境によって設定値が異なるため以下の5行はそのまま転記せず、必ず
# passenger-install-apache2-module --snippet で表示されたものを使用すること。
LoadModule passenger_module /usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.1.4/buildout/apache2/
<IfModule mod_passenger.c>
  PassengerRoot /usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.1.4
  PassengerDefaultRuby /usr/local/bin/ruby

# 必要に応じてPassengerのチューニングのための設定を追加(任意)。
# 詳しくはPhusion Passenger users guide(参照。
PassengerMaxPoolSize 20
PassengerMaxInstancesPerApp 4
PassengerPoolIdleTime 864000
PassengerStatThrottleRate 10

Header always unset "X-Powered-By"
Header always unset "X-Runtime"

Alias /redmine /var/lib/redmine/public
<Location /redmine>
  PassengerBaseURI /redmine
  PassengerAppRoot /var/lib/redmine

sudo chmod 755 config/database.yml
sudo chmod 755 config/configuration.yml
sudo chown -R apache:apache /var/lib/redmine

sudo service httpd configtest
sudo systemctl enable httpd
sudo service httpd restart



<Redmineインストール サーバーIPアドレス>/redmine

(動画では、vagrant private IPアドレスと入力)