検証環境用
//必要ソフトウェアのインストール
dnf -y update
dnf -y groupinstall "Development Tools"
dnf -y install openssl-devel readline-devel zlib-devel curl-devel libffi-devel
dnf -y install @mysql:8.0 mysql-devel
dnf -y install httpd httpd-devel
//SELINUX無効化
vi /etc/selinux/config
~~~~~~~~~~~~~~~~~~~~~~~
以下の通り変更する
SELINUX=disabled
~~~~~~~~~~~~~~~~~~~~~~~
//ファイアウォールの設定
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --reload
//再起動
reboot
//Rubyをインストール
cd /opt/
curl -O https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0.tar.gz
tar xvf ruby-2.7.0.tar.gz
cd ruby-2.7.0
./configure --disable-install-doc
make
make install
//Rubyのインストール有無を確認
ruby -v
//bundlerをインストール
gem install bundler
//いったん再起動
reboot
//MySQL有効化と初期設定
systemctl enable mysqld
systemctl start mysqld
//mysqlの初期設定
mysql_secure_installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Press y|Y for Yes, any other key for No: y
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0 : 0
New password:(設定したいパスワードを入力)
Re-enter new password:(設定したいパスワードを再入力)
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//sqlにデータ追加
mysql -u root -p
mysql> CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'redmineredmine';
mysql> GRANT ALL ON *.* TO 'redmine'@'localhost' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> CREATE DATABASE redmine CHARACTER SET utf8mb4;
mysql> exit
//Redmineのインストール
cd /var/lib
curl -O https://www.redmine.org/releases/redmine-4.2.3.tar.gz
tar xvf redmine-4.2.3.tar.gz
mv redmine-4.2.3 redmine
//database.yml を作成
vi /var/lib/redmine/config/database.yml
~~~~~~~~~~~~~~~~~~~~~~~~~~
以下の内容を追記し保存
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: "redmineredmine"
encoding: utf8mb4
~~~~~~~~~~~~~~~~~~~~~~~~~~
//configuration.ymlを作成
vi /var/lib/redmine/config/configuration.yml
~~~~~~~~~~~~~~~~~~~~~~~~~~
以下の内容を追記し保存
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "localhost"
port: 25
domain: "centos8"
~~~~~~~~~~~~~~~~~~~~~~~~~~
//Redmineの依存パッケージをインストール
cd /var/lib/redmine
bundle install --without development test --path vendor/bundle
//セッションの改ざんを防止するための秘密鍵を作成
bundle exec rake generate_secret_token
//database.ymlで指定したデータベースに、Redmineのテーブルを作成
RAILS_ENV=production bundle exec rake db:migrate
//Passengerのインストール
gem install passenger -v 5.1.12
//PassengerをApacheで使用するため、Apache用のモジュールをインストール
passenger-install-apache2-module --auto --languages ruby
//Apacheの設定
passenger-install-apache2-module --snippet
※※※※コマンドを実行して表示された設定情報をコピーする※※※※
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Alias /redmine /var/lib/redmine/public
<Location /redmine>
PassengerBaseURI /redmine
PassengerAppRoot /var/lib/redmine
</Location>
<Directory "/var/lib/redmine/public">
Require all granted
</Directory>
LoadModule passenger_module /usr/local/lib/ruby/gems/2.7.0/gems/passenger-5.1.12/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/lib/ruby/gems/2.7.0/gems/passenger-5.1.12
PassengerDefaultRuby /usr/local/bin/ruby
</IfModule>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vi /etc/httpd/conf.d/redmine.conf
※※※※コピーした設定情報をconfファイルの最下部にペーストする※※※※
//apache有効化
systemctl enable httpd
systemctl start httpd
//redminディレクトリの所有者を変更
chown -R apache:apache /var/lib/redmine
//ブラウザでアクセス
http://(サーバのIPアドレス)/redmine
例:http://192.168.10.1/redmine
初期ID・PWは以下の通り
ID:admin
PW:admin
コメント