主にLinuxサーバー設定記録をメモします



Redmine 2.2.3をCentOS 6系にインストールする手順


参考ページをそのまま実施してみて、自分なりのアレンジしたものをメモしておきます
参考URL:Redmine 2.2をCentOS6.3にインストールする手順

必要なパッケージのインストール

  • RubyとPassengerのビルドに必要なヘッダファイルなど
# yum groupinstall "Development Tools"
# yum install openssl-devel readline-devel zlib-devel curl-devel libyaml-devel wget
  • MySQLとヘッダファイル
# yum install mysql-server mysql-devel
  • Apacheとヘッダファイル
# yum install httpd httpd-devel
  • ImageMagickとヘッダファイル・日本語フォント
# yum install ImageMagick ImageMagick-devel
# yum install ipa-pgothic-fonts

Rubyのインストール

rbenvを参照

bundlerのインストール

# gem install bundler --no-rdoc --no-ri
# rbenv rehash

MySQLの設定

デフォルトキャラクタセットをutf8に設定
[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 # 追加する

# 任意設定
default-storage-engine=InnoDB
innodb_file_per_table
query-cache-size=16M

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[mysql]
default-character-set=utf8  # 追加する
MySQLの起動と自動起動の設定
# /etc/init.d/mysqld start
# chkconfig mysqld on
# chkconfig --list | grep mysqld
mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off
MySQL初期設定
rootユーザーのパスワード変更・匿名ユーザー削除を対話方式で行います
# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n]
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]
 ... Success!

Cleaning up...



All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!
MySQL設定の確認
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
+--------------------+
2 rows in set (0.00 sec)

mysql>
Redmine用データベースとユーザーの作成
mysql> create database redmine default character set utf8;
Query OK, 1 row affected (0.00 sec)

mysql> grant all on redmine.* to 'redmine'@'localhost' identified by 'xxxxxxxx';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit;
Bye

Redmineのインストール

最新版のダウンロード
モジュールの展開
# tar -xvzf redmine-2.2.3.tar.gz
モジュールの配置
# mv redmine-2.2.3 /var/lib/redmine
設定ファイルの準備
# cd /var/lib/redmine/
# cp -p config/database.yml.example config/database.yml
設定ファイルの編集
# vi config/database.yml
production:
  adapter: mysql2
  database: redmine
  username: redmine
  password: ********
  host: localhost
  encoding: utf8
# vi config/configuration.yml
 production:
   email_delivery:
     delivery_method: :smtp
     smtp_settings:
       address: "localhost"
       port: 25
  rmagick_font_path: /usr/share/fonts/ipa-pgothic/ipagp.ttf ← 190行目を修正する
Gemパッケージのインストール
# cd /var/lib/redmine
# bundle install --without development test postgresql sqlite
Redmineの初期設定とデータベースのテーブル作成
# bundle exec rake generate_secret_token
# RAILS_ENV=production bundle exec rake db:migrate

Passengerのインストール

# gem install passenger --no-rdoc --no-ri
# rbenv rehash

PassengerのApache用モジュールのインストール

# passenger-install-apache2-module

Apacheの設定

# passenger-install-apache2-module --snippet > /etc/httpd/conf.d/passenger.conf
# vi /etc/httpd/conf.d/passenger.conf
# Passengerの基本設定
# passsenger-install-apache2-module --snippetを実行して表示される結果

LoadModule passenger_module /usr/local/rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/passenger-3.0.19
PassengerRuby /usr/local/rbenv/versions/1.9.3-p385/bin/ruby

# 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"

# 必要に応じてPassengerのチューニングのための設定を追加。
#
PassengerMaxPoolSize 20
PassengerMaxInstancesPerApp 4
PassengerPoolIdleTime 3600
PassengerUseGlobalQueue on
PassengerHighPerformance on
PassengerStatThrottleRate 10
RailsSpawnMethod smart
RailsAppSpawnerIdleTime 86400
RailsFrameworkSpawnerIdleTime 0
Redmineモジュールの権限設定変更
# chown -R apache:apache /var/lib/redmine
Apacheの起動
# /etc/init.d/httpd start
/redmine以下でのアクセスに変更
# ln -s /var/lib/redmine/public /var/www/html/redmine
# echo "RailsBaseURI /redmine" >> /etc/httpd/conf.d/passenger.conf
Apacheの再起動
# /etc/init.d/httpd restart

Menu

メニュー

アプリケーション

アプリケーション

その他

【メニュー編集】

管理人/副管理人のみ編集できます