はじめに
プロジェクト管理ソフトの王道であるRedmineのインストール方法を紹介。
あらかじめインストールが必要なもの
必要なライブラリを入れる
readline
bash
cd /usr/local/src
wget ftp://ftp.gnu.org/gnu/readline/readline-6.3.tar.gz
tar xvzf readline-6.3.tar.gz
cd readline-6.3
./configure
make
make install
yaml
bash
cd /usr/local/src
wget http://pyyaml.org/download/libyaml/yaml-0.1.7.tar.gz
tar xvzf yaml-0.1.7.tar.gz
cd yaml-0.1.7
./configure
make
make installl
libffi
cd /usr/local/src
wget ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz
tar xvzf libffi-3.2.1.tar.gz
cd libffi-3.2.1
./configure
./configure --libdir=/usr/local/lib --includedir=/usr/local/include
make
make install
ImageMagicに必要なライブラリを入れる
# JPEG
cd /usr/local/src/phpmodule
cd jpeg-9b
./configure --enable-shared
make
make install
# libtiff
cd /usr/local/src/phpmodule
cd tiff-4.0.7
./configure
make
make install
# libPNG
cd /usr/local/src/phpmodule
cd libpng-1.6.28
cp scripts/makefile.linux Makefile
make
make install
# JPEG
cd /usr/local/src/phpmodule
cd jpeg-9b
./configure --enable-shared
make
make install
# libtiff
cd /usr/local/src/phpmodule
cd tiff-4.0.7
./configure
make
make install
# libPNG
cd /usr/local/src/phpmodule
cd libpng-1.6.28
cp scripts/makefile.linux Makefile
make
make install
ImageMagic
cd /usr/local/src
wget https://www.imagemagick.org/download/ImageMagick-6.9.7-9.tar.gz
tar xvzf ImageMagick-6.9.7-9.tar.gz
cd ImageMagick-6.9.7-9
./configure
make
make install
./configure時にJPEG,Magic++,TIFF,PNGは、YES担っているかを確認します。
Install documentation: yes
Delegate Library Configuration:
BZLIB --with-bzlib=yes no
Autotrace --with-autotrace=no no
DJVU --with-djvu=yes no
DPS --with-dps=yes no
FFTW --with-fftw=yes no
FLIF --with-flif=yes no
FlashPIX --with-fpx=yes no
FontConfig --with-fontconfig=yes no
FreeType --with-freetype=yes no
Ghostscript lib --with-gslib=no no
Graphviz --with-gvc=yes no
JBIG --with-jbig=yes no
JPEG v1 --with-jpeg=yes yes
LCMS --with-lcms=yes no
LQR --with-lqr=yes no
LTDL --with-ltdl=yes no
LZMA --with-lzma=yes no
Magick++ --with-magick-plus-plus=yes yes
OpenEXR --with-openexr=yes no
OpenJP2 --with-openjp2=yes no
PANGO --with-pango=yes no
PERL --with-perl=no no
PNG --with-png=yes yes
RAQM --with-raqm=yes no
RSVG --with-rsvg=no no
TIFF --with-tiff=yes yes
WEBP --with-webp=yes no
WMF --with-wmf=yes no
X11 --with-x= yes
XML --with-xml=yes no
ZLIB --with-zlib=yes no
curl
cd /usr/local/src
wget https://curl.haxx.se/download/curl-7.52.1.tar.gz
tar xvzf curl-7.52.1.tar.gz
# curl
cd /usr/local/src/phpmodule
cd curl-7.52.1
# OpenSSLの場所を明示
CPPFLAGS="-I/usr/local/ssl/include" LDFLAGS="-L/usr/local/ssl/lib"
./configure \
--enable-http \
--enable-ftp \
--enable-file \
--enable-proxy \
--enable-cookies \
--with-zlib=/usr/local \
--with-ssl=/usr/local/ssl \
--with-libssh2=/usr/local
make
make install
ncurses
cd /usr/local/src
wget https://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz
tar xvzf ncurses-6.0.tar.gz
cd ncurses-6.0
./configure --with-shared
make
make install
rubyをインストール
wget https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.0.tar.gz
tar xvzf ruby-2.4.0.tar.gz
cd ruby-2.4.0
./configure
make
make install
rubyライブラリをインストール
gem install bundler --no-rdoc --no-ri
redmineをインストール
cd /usr/local/src
wget http://www.redmine.org/releases/redmine-3.3.2.tar.gz
tar xvzf redmine-3.3.2.tar.gz
cd redmine-3.3.2
cp config/database.yml.example config/database.yml
vi config/database.yml
confを書き換える
production:
adapter: postgresql
database: redmine
host: localhost
username: redmine
password: "redmine"
encoding: utf8
設定ファイルを変更する
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
cp -rf ./* /docs/labosv/redmine/
cd /docs/labosv/redmine/
必要バイナリをインストールする
rmagicをインストール
gem install rmagick -v '2.16.0'
その他必要なモジュールの準備
vi Gemfile
Ruby4.2だと問題が出るので最新版をGitHubから取得するため以下を書き換える。
# gem "rails", "4.2.7.1"
gem 'rails', github: 'rails/rails', branch: '4-2-stable'
インストールする
bundle install --without development test --path vendor/bundle
# SEC Token
bundle exec rake generate_secret_token
DB Install
# スキーマを利用するユーザーがオーナーになっていないとエラーになる
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production REDMINE_LANG=ja bundle exec rake redmine:load_default_data
Passengerをインストール
# Passenger install
gem install passenger --no-rdoc --no-ri
Apacheの設定を行う
# PTHを設定しないと、yum でhttpを入れるとおこられる。
export APXS2=/usr/local/apache2/bin/apxs
export PATH=/usr/local/apache2/bin:$PATH
passenger-install-apache2-module --auto
# Apache設定内容を確認
passenger-install-apache2-module --snippet
httpd.confを編集する
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /docs/labosv/redmine-3.3.2/public
ServerName xxx.example.com
ServerAlias www.dummy-host.example.com
ErrorLog logs/labosv-error_log
CustomLog logs/labosv-access_log combined
PassengerLogFile logs/labosv-passenger_log
PassengerLogLevel 5
PassengerEnabled on
Header always unset "X-Powered-By"
Header always unset "X-Runtime"
PassengerMaxPoolSize 20
PassengerMaxInstancesPerApp 4
PassengerPoolIdleTime 864000
PassengerHighPerformance on
PassengerStatThrottleRate 10
PassengerSpawnMethod smart
PassengerFriendlyErrorPages off
PassengerMaxPreloaderIdleTime 0
<Directory /docs/labosv/redmine-3.3.2 >
AllowOverride all
Options -MultiViews
</Directory>
Apacheを起動する
systemctl httpd start
Passenger起動
Passengerは、Apacheから自動的に起動されるので起動は必要ないが、単独でっ起動する場合は以下のコマンドで起動
passenger start --environment production
参考