SEARCH

Linux Install

Android

Linux Tools

Linux AV

Linux Memo

WINDOWS

PROGRAM

動画 Memo

音楽 Memo

モバイルアプリ Memo

FILE FORMAT

PROTOCOL

DEVICE

BookMark

その他


redmine   

install

yum 系統

yum -y update
yum -y groupinstall "Development tools"
yum -y install openssl-devel readline-devel zlib-devel curl-devel libyaml-devel libffi-devel ruby-devel git
yum -y install ImageMagick ImageMagick-devel ipa-pgothic-fonts
yum -y install httpd httpd-devel
yum -y install mariadb mariadb-server mariadb-devel
systemctl enable mariadb.service
systemctl start mariadb.service

ubuntu20

※参考 (というかほぼそのまま)

https://eco.senritu.net/ubuntu20-04%E3%81%B8redmine4-2-x%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB/

apache を入れて ssl の設定までは済ませておく

sudo apt update
sudo apt upgrade
sudo apt install build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev libcurl4-openssl-dev libffi-dev mysql-server mysql-client libapr1-dev libaprutil1-dev imagemagick libmagick++-dev fonts-takao-pgothic subversion git ruby libruby ruby-dev libmysqlclient-dev

sudo apt-get install libapache2-mod-passenger
sudo a2enmod passenger

sudo gem install bundler racc mysql2

sudo mysql -uroot -p
CREATE DATABASE redmine character set utf8mb4;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY '【パスワード】';
GRANT ALL ON redmine.* TO 'redmine'@'localhost';
flush privileges;
exit
sudo mkdir /var/lib/redmine
sudo chown www-data /var/lib/redmine
sudo -u www-data svn co https://svn.redmine.org/redmine/branches/4.2-stable /var/lib/redmine
 
sudo cp /var/lib/redmine/config/database.yml.example /var/lib/redmine/config/database.yml

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

production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: redmine
  password: "【パスワード】"
  encoding: utf8mb4
cd /var/lib/redmine
sudo -u www-data bundle install --without development test --path vendor/bundle
sudo -u www-data bundle exec rake generate_secret_token
sudo -u www-data RAILS_ENV=production bundle exec rake db:migrate
sudo -u www-data RAILS_ENV=production REDMINE_LANG=ja bundle exec rake redmine:load_default_data

ssl.conf

Alias /redmine /var/lib/redmine/public
<Location /redmine>
PassengerBaseURI /redmine
PassengerAppRoot /var/lib/redmine
Require all granted
</Location>
sudo a2ensite redmine.conf
sudo systemctl  reload apache2.service

ruby(手動)

cd /usr/local/src
wget https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.2.tar.gz
tar zxvf ruby-*.tar.gz
cd ruby-*
./configure --disable-install-doc
make
make install
yum remove ruby 

.bashrc

PATH=$PATH:/usr/local/bin
source .bashrc

mysql DB作成

mysql
create database redmine default character set utf8;
create user 'redmine'@'localhost' IDENTIFIED BY '【hogehoge】';
grant all on redmine.* to redmine@localhost identified by '【hogehoge】';
exit; 

gem install bundler

redmine 本体

wget http://www.redmine.org/releases/redmine-4.0.3.zip
unzip redmine-4.0.3.zip
mv redmine-4.0.3 /var/lib/redmine
cp /var/lib/redmine/config/database.yml.example /var/lib/redmine/config/database.yml

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

production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: redmine
  password: "hogehgoe"
  encoding: utf8
cp /var/lib/redmine/config/configuration.yml.example /var/lib/redmine/config/configuration.yml

/var/lib/redmine/config/configuration.yml

cd /var/lib/redmine/
bundle install --without development test --path vendor/bundle
bundle exec rake generate_secret_token
mkdir -p app/assets/config

app/assets/config/manifest.js

//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production REDMINE_LANG=ja bundle exec rake redmine:load_default_data
gem install passenger
passenger-install-apache2-module --auto --languages ruby
passenger-install-apache2-module --snippet

出力結果を控える

   LoadModule passenger_module /usr/local/lib/ruby/gems/2.6.0/gems/passenger-6.0.4/buildout/apache2/mod_passenger.so
   <IfModule mod_passenger.c>
     PassengerRoot /usr/local/lib/ruby/gems/2.6.0/gems/passenger-6.0.4
     PassengerDefaultRuby /usr/local/bin/ruby
   </IfModule>

/etc/httpd/conf.d/redmine.conf

<Directory "/var/lib/redmine/public">
  Require all granted
</Directory>

   LoadModule passenger_module /usr/local/lib/ruby/gems/2.6.0/gems/passenger-6.0.4/buildout/apache2/mod_passenger.so
   <IfModule mod_passenger.c>
     PassengerRoot /usr/local/lib/ruby/gems/2.6.0/gems/passenger-6.0.4
     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"

/etc/httpd/conf/httpd.conf

DocumentRoot "/var/lib/redmine/public"

chown -R apache:apache /var/lib/redmine
systemctl restart httpd
systemctl enable httpd
systemctl status httpd