概要
CentOS6 に Redmine3 をインストールする。
内容
必要なものを yum でインストー ル
# yum install gcc gcc-c++ \ httpd httpd-devel \ mysql-server mysql-devel \ openssl-devel \ readline-devel \ zlib-devel \ curl-devel
epel リポジトリ追加 & 必要なものを yum でインストー ル
# yum install epel-release # yum install --enablerepo=epel libyaml libyaml-devel nodejs npm
Ruby インストール
# cd /usr/local/src/ # wget https://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p648.tar.gz # tar zxvf ruby-2.0.0-p648.tar.gz # cd ruby-2.0.0-p648 # ./configure --disable-install-doc # make # make install # ruby -v ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]
gem を最新版に更新
# gem -v 2.0.14.1 # gem update --system --no-rdoc --no-ri # gem -v 2.6.6
# gem install bundler --no-rdoc --no-ri # gem install daemon_controller rack passenger --no-rdoc --no-ri # gem list *** LOCAL GEMS *** bigdecimal (default: 1.2.0) bundler (1.12.5) daemon_controller (1.2.0) io-console (default: 0.4.2) json (default: 1.7.7) minitest (default: 4.3.2) passenger (5.0.29) psych (default: 2.0.0) rack (1.6.4) rake (default: 0.9.6) rdoc (default: 4.0.0) rubygems-update (2.6.6) test-unit (default: 2.0.0.0)
MySQL 設定
# cp -p /etc/my.cnf /etc/my.cnf.org # vi /etc/my.cnf
my.cnf 内容
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 character-set-server=utf8 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid [mysql] default-character-set=utf8
MySQL 初期設定
起動 # service mysqld start 自動起動設定 # chkconfig mysqld on セキュリティ設定(rootパスワード他) # mysql_secure_installation DB、ユーザー作成 # mysql -u root -p mysql> create database redmine_db default character set utf8; mysql> grant all on redmine_db.* to redmine_admin@localhost identified by 'DB-no-PassWordDaYo'; mysql> flush privileges; mysql> exit
Redmine インストール
# cd /usr/local/src/ # wget http://www.redmine.org/releases/redmine-3.3.0.tar.gz # tar zxvf redmine-3.3.0.tar.gz # mv redmine-3.3.0 /usr/local/ # chown -R apache:apache /usr/local/redmine-3.3.0 # cd /usr/local # ln -s redmine-3.3.0 redmine # cd /usr/local/redmine/config # cp -p database.yml.example database.yml # vi database.yml
database.yml
production: adapter: mysql2 database: redmine_db host: localhost username: redmine_admin password: "DB-no-PassWordDaYo" encoding: utf8
# cd /usr/local/redmine/ # bundle install --without development test rmagick --path vendor/bundle # bundle exec rake generate_secret_token # RAILS_ENV=production bundle exec rake db:migrate <pre> === passenger 設定=== <pre> # passenger-install-apache2-module # ls /usr/local/lib/ruby/gems/2.0.0/gems/passenger-5.0.29/buildout/apache2/mod_passenger.so # vi /etc/httpd/conf.d/passenger.conf <pre> ==== /etc/httpd/conf.d/passenger.conf ==== <pre> LoadModule passenger_module /usr/local/lib/ruby/gems/2.0.0/gems/passenger-5.0.29/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/local/lib/ruby/gems/2.0.0/gems/passenger-5.0.29 PassengerDefaultRuby /usr/local/bin/ruby </IfModule> # Passengerが追加するHTTPヘッダを削除するための設定(任意)。 Header always unset "X-Powered-By" Header always unset "X-Rack-Cache" Header always unset "X-Content-Digest" Header always unset "X-Runtime" PassengerMaxPoolSize 20 PassengerMaxInstancesPerApp 4 PassengerPoolIdleTime 3600 PassengerHighPerformance on PassengerStatThrottleRate 10 PassengerSpawnMethod smart RailsAppSpawnerIdleTime 86400 PassengerMaxPreloaderIdleTime 0 # DocumentRootのサブディレクトリで実行する設定 RackBaseURI /redmine
# ln -s /usr/local/redmine/public /var/www/html/redmine # chown -R apache:apache /var/www/html/redmine
httpd 設定
httpdサービス自動起動有効化 # chkconfig httpd on httpdサービス起動 # service httpd configtest # service httpd start
以上で、
にアクセスできるようになっているはず。
初期設定は以下を参照。