CentOSにRedmineをとりあえずインストールしてみる

VirtualBoxにCentOSをとりあえずインストール
の続き

以下の手順を参考に、VirtualBoxCentOSにRendmineをとりあえずインストールしてみる。

Redmine 2.5をCentOS 6.5にインストールする手順 | Redmine.JP Blog
http://blog.redmine.jp/articles/2_5/installation_centos/

まず、rootになる。

$ su -

後は、以下をコピペで実行すればOK。(自分の環境では約25分ほどかかった)

(ただ、データベースのユーザーのパスワードが、下記だと「123456」(2箇所)なっているので、コピペする際は適当なパスワードに変えてください。)

rpm -ivh http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

yum -y groupinstall "Development Tools"
yum -y install openssl-devel readline-devel zlib-devel curl-devel libyaml-devel
yum -y install mysql-server mysql-devel
yum -y install httpd httpd-devel
yum -y install ImageMagick ImageMagick-devel ipa-pgothic-fonts

cd /tmp
curl -O http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz
tar zxvf ruby-2.0.0-p451.tar.gz 
cd ruby-2.0.0-p451
./configure --disable-install-doc
make
make install
cd ..

gem install bundler --no-rdoc --no-ri

echo -e "\n[mysqld]\ncharacter-set-server=utf8\n\n[mysql]\ndefault-character-set=utf8\n" >> /etc/my.cnf
service mysqld start
chkconfig mysqld on

mysql -uroot
create database db_redmine default character set utf8;
grant all on db_redmine.* to user_redmine@localhost identified by '123456';
flush privileges;
exit;

curl -O http://www.redmine.org/releases/redmine-2.5.0.tar.gz
tar xvf redmine-2.5.0.tar.gz
mv redmine-2.5.0 /var/lib/redmine

cd /var/lib/redmine
echo -e "production:\n  adapter: mysql2\n  encoding: utf8\n  database: db_redmine\n  host: localhost\n  username: user_redmine\n  password: 123456" > config/database.yml

bundle install --without development test

bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate

gem install passenger --no-rdoc --no-ri
passenger-install-apache2-module --auto
passenger-install-apache2-module --snippet > /etc/httpd/conf.d/passenger.conf

chown -R apache:apache /var/lib/redmine

echo -e "\nNameVirtualHost *:80\n<VirtualHost *:80>\n    ServerName www.example.jp\n    DocumentRoot /var/lib/redmine/public\n</VirtualHost>" >> /etc/httpd/conf/httpd.conf

service httpd start
chkconfig httpd on

以上で、
http://サーバーのIPアドレス/
にアクセスすると、Redmineのページが表示される。
(ただ、メールの設定などしてないので、ちゃんと使うには色々設定する必要があるはず。)