CentOS 7に Redmine 2.4.1 をなるべくパッケージでインストールする手順です。
検証環境
- CentOS 7
- Redmine 3.4
- Ruby 2.4.1
- PostgreSQL
- Apache
1 2 3 4 5 |
Redmine version Supported Ruby versions Rails version used4.0 ruby 2.2(2.2.2 and later), 2.3, 2.41 Rails 5.1 3.4 ruby 1.9.34, 2.0.03, 2.1, 2.22, 2.3, 2.41 Rails 4.2 |
Yum
Update and Install package
1 2 3 4 5 6 |
yum update yum groupinstall "Development Tools" yum install ImageMagick ImageMagick-devel ipa-pgothic-fonts yum install curl zlib-devel curl-devel openssl-devel apr-devel apr-util-devel ftp wget gcc-c++ patch readline readline-devel zlib libyaml-devel libffi-devel make bzip2 autoconf automake libtool bison subversion |
Apacheのインストール
1 2 3 |
yum install httpd httpd-devel |
Databaseのインストール
1 2 3 |
yum install postgresql-server postgresql-devel |
Rubyのインストール
1 2 3 4 5 6 7 8 9 |
curl -O https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.gz tar xvf ruby-2.4.1.tar.gz cd ruby-2.4.1 ./configure --disable-install-doc make make install ruby -v |
Gems
Update and Install Gems
1 2 3 4 5 6 7 |
gem update gem install bundler gem install rubygems-update update_rubygems gem install rmagick -v '2.16.0' |
PostgreSQL
データベースクラスタの新規作成
1 2 3 |
postgresql-setup initdb |
PostgreSQLに接続するための設定
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
vi /var/lib/pgsql/data/pg_hba.conf # TYPE DATABASE USER ADDRESS METHOD host redmine redmine 127.0.0.1/32 md5 host redmine redmine ::1/128 md5 # "local" is for Unix domain socket connections only local all all peer # IPv4 local connections: host all all 127.0.0.1/32 ident # IPv6 local connections: host all all ::1/128 ident # Allow replication connections from localhost, by a user with the # replication privilege. #local replication postgres peer #host replication postgres 127.0.0.1/32 ident #host replication postgres ::1/128 ident |
など
1 2 3 4 5 6 |
# IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5 |
PostgreSQLの起動および自動起動の設定
1 2 3 4 |
systemctl enable postgresql.service systemctl start postgresql.service |
ユーザーの作成
1 2 3 4 |
cd /var/lib/pgsql sudo -u postgres createuser -P redmine 'create password' |
データベースの作成
1 2 3 |
sudo -u postgres createdb -E UTF-8 -l ja_JP.UTF-8 -O redmine -T template0 redmine |
Redmine
Redmineのインストール
1 2 3 |
svn co https://svn.redmine.org/redmine/branches/3.4-stable /var/lib/redmine |
データベースへの接続設定 database.yml
1 2 3 4 5 6 7 8 9 10 11 12 |
cd /var/lib/redmine cp config/database.yml.example config/database.yml vi config/database.yml production: adapter: postgresql database: redmine host: localhost username: redmine password: "redmine" encoding: utf8 |
設定ファイル configuration.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 |
cp config/configuration.yml.example config/configuration.yml vi config/configuration.yml production: email_delivery: delivery_method: :smtp smtp_settings: address: "localhost" port: 25 domain: "example.com" rmagick_font_path: /usr/share/fonts/ipa-pgothic/ipagp.ttf |
gemパッケージのインストール
1 2 3 4 |
cd /var/lib/redmine bundle install --without development test --path vendor/bundle |
Prepare and connect Database
1 2 3 4 5 |
bundle exec rake generate_secret_token RAILS_ENV=production bundle exec rake db:migrate RAILS_ENV=production REDMINE_LANG=ja bundle exec rake redmine:load_default_data |
Passengerのインストール (gem)
1 2 3 |
gem install passenger |
PassengerのApache用モジュールのインストール
1 2 3 4 |
passenger-install-apache2-module --auto --languages ruby passenger-install-apache2-module --snippet |
Apache
ユーザーの作成
1 2 3 |
adduser redmine |
Create Configure Apache redmine.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
vi /etc/httpd/conf.d/redmine.conf <Directory "/var/lib/redmine/public"> Require all granted </Directory> # PassengerSetting # passenger-install-apache2-module --snippet LoadModule passenger_module /usr/local/lib/ruby/gems/2.4.0/gems/passenger-5.1.5/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/local/lib/ruby/gems/2.4.0/gems/passenger-5.1.5 PassengerDefaultRuby /usr/local/bin/ruby </IfModule> PassengerMaxPoolSize 20 PassengerMaxInstancesPerApp 4 PassengerPoolIdleTime 864000 PassengerStatThrottleRate 10 Header always unset "X-Powered-By" Header always unset "X-Runtime" |
Apacheの起動および自動起動の設定
1 2 3 4 |
systemctl start httpd.service systemctl enable httpd.service |
1 2 3 |
chown -R apache:apache /var/lib/redmine |
Apache Configure Setting httd.conf
1 2 3 4 5 6 7 8 9 |
vi /etc/httpd/conf/httpd.conf User redmine Group redmine DocumentRoot "/var/www/html" ↓ DocumentRoot "/var/lib/redmine/public" |
Apacheの起動および自動起動の設定
1 2 3 4 5 |
service httpd configtest systemctl restart httpd.service reboot |
The following two tabs change content below.
株式会社ギークフィードのサイト編集担当者です。
弊社へのお問い合わせ・質問は、お問い合わせページからお願いいたします。
- 【React】フロントエンドのテストコードを書いてみよう【Vitest】 - 2024-04-30
- Simple AWS DeepRacer Reward Function Using Waypoints - 2023-12-19
- Restrict S3 Bucket Access from Specified Resource - 2023-12-16
- Expand Amazon EBS Volume on EC2 Instance without Downtime - 2023-09-28
- Monitor OpenSearch Status On EC2 with CloudWatch Alarm - 2023-07-02