2024年2月24日
環境
Red Hat Enterprise Linux release 9.2 (Plow)
インストール手順
1.必要なパッケージをインストールします
# dnf --enablerepo=epel,crb -y install ruby-devel postgresql-server-devel openssl-devel libxslt-devel libxml2-devel libcurl-devel zlib-devel httpd-devel gcc gcc-c++ make patch rpm-build ImageMagick ImageMagick-devel
# dnf --enablerepo=epel,crb -y install ruby-devel postgresql-server-devel openssl-devel libxslt-devel libxml2-devel libcurl-devel zlib-devel httpd-devel gcc gcc-c++ make patch rpm-build ImageMagick ImageMagick-devel
# dnf --enablerepo=epel,crb -y install ruby-devel postgresql-server-devel openssl-devel libxslt-devel libxml2-devel libcurl-devel zlib-devel httpd-devel gcc gcc-c++ make patch rpm-build ImageMagick ImageMagick-devel
2.redmine 用のユーザーとデータベースを作成します。
# vi /var/lib/pgsql/data/pg_hba.conf
#host all all 127.0.0.1/32 ident
#host all all ::1/128 ident
host all all 127.0 . 0.1 / 32 scram-sha- 256
host all all :: 1 / 128 scram-sha- 256
# vi /var/lib/pgsql/data/pg_hba.conf
# 87行目 : 以下のように変更
#host all all 127.0.0.1/32 ident
#host all all ::1/128 ident
host all all 127.0.0.1/32 scram-sha-256
host all all ::1/128 scram-sha-256
# vi /var/lib/pgsql/data/pg_hba.conf
# 87行目 : 以下のように変更
#host all all 127.0.0.1/32 ident
#host all all ::1/128 ident
host all all 127.0.0.1/32 scram-sha-256
host all all ::1/128 scram-sha-256
PostgreSQLを再起動します
# systemctl restart postgresql
redmineデータベースを作成します
$ createdb redmine -O redmine
$ psql -c "alter user redmine with password 'password'"
# su - postgres
$ createuser redmine
$ createdb redmine -O redmine
$ psql -c "alter user redmine with password 'password'"
ALTER ROLE
# su - postgres
$ createuser redmine
$ createdb redmine -O redmine
$ psql -c "alter user redmine with password 'password'"
ALTER ROLE
3.redmine をダウンロードしてインストールします。
http://www.redmine.org/projects/redmine/wiki/Download
ファイルのダウンロード
# curl -O https://www.redmine.org/releases/redmine-5.1.1.tar.gz
ファイルの解凍
# tar zxvf redmine-5.1.1.tar.gz
# mv redmine-5.1.1 /var/www/redmine
# cd /var/www/redmine
# vi config/database.yml
#以下の内容で新規作成
production:
adapter: postgresql
# データベース名
database: redmine
host: localhost
# データベースユーザー
username: redmine
# データベースユーザーのパスワード
password: password
encoding: utf8
#以下の内容で新規作成
production:
adapter: postgresql
# データベース名
database: redmine
host: localhost
# データベースユーザー
username: redmine
# データベースユーザーのパスワード
password: password
encoding: utf8
4.smtpの設定を行います
# vi config/configuration.yml
domain: 'cft.arkgame.com'
rmagick_font_path: /usr/share/fonts/google-droid/DroidSansJapanese. ttf
# vi config/configuration.yml
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "localhost"
port: 25
domain: 'cft.arkgame.com'
rmagick_font_path: /usr/share/fonts/google-droid/DroidSansJapanese.ttf
# vi config/configuration.yml
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "localhost"
port: 25
domain: 'cft.arkgame.com'
rmagick_font_path: /usr/share/fonts/google-droid/DroidSansJapanese.ttf
5.# bundler インストール
# gem install bundler
# Redmine で使用する Gem をインストール
# bundle config set --local without 'development test mysql sqlite'
# bundle config set --local without 'development test mysql sqlite'
# bundle install
# bundle config set --local without 'development test mysql sqlite'
# bundle install
# 秘密鍵の生成
# bundle exec rake generate_secret_token
# テーブル生成
# bundle exec rake db:migrate RAILS_ENV=production
# bundle exec rake db:migrate RAILS_ENV=production
# Passenger インストール
# gem install passenger
# bundle exec rake db:migrate RAILS_ENV=production
# Passenger インストール
# gem install passenger
# Apache httpd 用モジュールインストール
# passenger-install-apache2-module
6.Passenger を実行するための httpd の設定を行います
# vi /etc/httpd/conf.d/passenger.conf
LoadModule passenger_module /usr/local/share/gems/gems/passenger- 6.0 . 19 /buildout/apache2/mod_passenger. so
PassengerRoot /usr/local/share/gems/gems/passenger- 6.0 . 19
PassengerDefaultRuby /usr/bin/ruby
SetEnv LD_LIBRARY_PATH /usr/lib64
ServerName redmine. arkgame . com
DocumentRoot /var/www/redmine/public
< Directory "/var/www/redmine/public" >
# 以下の内容で新規作成
LoadModule passenger_module /usr/local/share/gems/gems/passenger-6.0.19/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/share/gems/gems/passenger-6.0.19
PassengerDefaultRuby /usr/bin/ruby
SetEnv LD_LIBRARY_PATH /usr/lib64
NameVirtualHost *:80
<VirtualHost *:80>
ServerName redmine.arkgame.com
DocumentRoot /var/www/redmine/public
</VirtualHost>
<Directory "/var/www/redmine/public">
Options FollowSymLinks
AllowOverride All
</Directory>
# 以下の内容で新規作成
LoadModule passenger_module /usr/local/share/gems/gems/passenger-6.0.19/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/share/gems/gems/passenger-6.0.19
PassengerDefaultRuby /usr/bin/ruby
SetEnv LD_LIBRARY_PATH /usr/lib64
NameVirtualHost *:80
<VirtualHost *:80>
ServerName redmine.arkgame.com
DocumentRoot /var/www/redmine/public
</VirtualHost>
<Directory "/var/www/redmine/public">
Options FollowSymLinks
AllowOverride All
</Directory>
7.httpdを再起動します
# chown -R apache:apache /var/www/redmine
# systemctl restart httpd
# chown -R apache:apache /var/www/redmine
# systemctl restart httpd
# chown -R apache:apache /var/www/redmine
# systemctl restart httpd