Fedora 21にRedmineをインストール

2015/02/16

パッケージのインストール

SELinuxのためにpassengerはパッケージで入れる。libxml2-devel、libxslt-devel、ImageMagick-develは、gemのインストール痔に必要。
# yum groupinstall 'Development Tools'
1
# yum groupinstall 'Development Tools'
2
# yum install setroubleshoot-server setools-console
3
# yum install mariadb-server mariadb-devel
4
# yum install ruby-devel rubygem-bundler mod_passenger
5
# yum install libxml2-devel libxslt-devel ImageMagick-devel
6
# yum install ipa-pgothic-fonts
 

MariaDB(MySQL)の設定

/etc/my.cnf.d/server.cnf
......
1
......
2
# this is only for the mysqld standalone daemon
3
[mysqld]
4
character-set-server=utf8
5
......
 

/etc/my.cnf.d/mysql-clients.cnf
......
1
......
2
[mysql]
3
default-character-set=utf8
4
......
 

MariaDBの起動とユーザ/テーブルの作成

# systemctl start mariadb
1
# systemctl start mariadb
2
# systemctl status mariadb
3
# systemctl enable mariadb
4
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
5
# mysql_secure_installation
6
# mysql -u root -p
7
MariaDB [(none)]> create database redmine default character set utf8;
8
MariaDB [(none)]> grant all on redmine.* to redmine@localhost identified by '********';
9
MariaDB [(none)]> flush privileges;
10
MariaDB [(none)]> exit;
 

Redmineのインストール

# svn co http://svn.redmine.org/redmine/branches/2.5-stable /usr/share/redmine
1
# svn co http://svn.redmine.org/redmine/branches/2.5-stable /usr/share/redmine
2
# cd /usr/share/redmine
 

config/database.yml
production:
1
production:
2
  adapter: mysql2
3
  database: redmine
4
  host: localhost
5
  username: redmine
6
  password: ********
7
  encoding: utf8
 

config/configuration.yml
production:
1
production:
2
  email_delivery:
3
    delivery_method: :smtp
4
    smtp_settings:
5
      address: "localhost"
6
      port: 25
7
      domain: 'example.com'
8
 
9
  rmagick_font_path: /usr/share/fonts/ipa-pgothic/ipagp.ttf
 

Gemのインストール

# bundle config build.nokogiri --use-system-libraries# bundle install
1
# bundle config build.nokogiri --use-system-libraries# bundle install
2
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this
3
machine.
4
Fetching gem metadata from https://rubygems.org/.........
5
Resolving dependencies...
6
Installing rake 10.4.2
7
Installing i18n 0.6.11
8
Installing multi_json 1.10.1
9
Installing activesupport 3.2.21
10
Installing builder 3.0.4
11
Installing activemodel 3.2.21
12
Installing erubis 2.7.0
13
Installing journey 1.0.4
14
Installing rack 1.4.5
15
Installing rack-cache 1.2
16
Installing rack-test 0.6.3
17
Installing hike 1.2.3
18
Installing tilt 1.4.1
19
Installing sprockets 2.2.3
20
Installing actionpack 3.2.21
21
Installing mime-types 1.25.1
22
Installing polyglot 0.3.5
23
Installing treetop 1.4.15
24
Installing mail 2.5.4
25
Installing actionmailer 3.2.21
26
Installing arel 3.0.3
27
Installing tzinfo 0.3.43
28
Installing activerecord 3.2.21
29
Installing activeresource 3.2.21
30
Using bundler 1.7.6
31
Installing mini_portile 0.6.2
32
Installing nokogiri 1.6.6.2
33
Installing xpath 2.0.0
34
Installing capybara 2.4.4
35
Installing ffi 1.9.6
36
Installing childprocess 0.5.5
37
Installing coderay 1.1.0
38
Installing rack-ssl 1.3.4
39
Installing json 1.8.2
40
Installing rdoc 3.12.2
41
Installing thor 0.19.1
42
Installing railties 3.2.21
43
Installing jquery-rails 3.1.2
44
Installing metaclass 0.0.4
45
Installing mocha 1.0.0
46
Installing mysql2 0.3.17
47
Installing net-ldap 0.3.1
48
Installing ruby-openid 2.3.0
49
Installing rack-openid 1.4.2
50
Installing rails 3.2.21
51
Installing rbpdf 1.18.5
52
Installing redcarpet 2.3.0
53
Installing request_store 1.0.5
54
Installing rmagick 2.13.4
55
Installing rubyzip 1.1.7
56
Installing websocket 1.2.1
57
Installing selenium-webdriver 2.44.0
58
Installing shoulda-context 1.0.2
59
Installing shoulda-matchers 1.4.1
60
Installing shoulda 3.3.2
61
Installing yard 0.8.7.6
62
Your bundle is complete!
63
Use `bundle show [gemname]` to see where a bundled gem is installed.
64
Post-install message from rmagick:
65
Please report any bugs. See https://github.com/gemhome/rmagick/compare/RMagick_2-13-2...master and https://github.com/rmagick/rmagick/issues/18
 

Redmineの初期設定とデータベースのテーブル作成

# bundle exec rake generate_secret_token
1
# bundle exec rake generate_secret_token
2
# RAILS_ENV=production bundle exec rake db:migrate
 

SELinuxまわりの設定

RedmineをSELinuxが有効なCentOS上で動かすには - C#などの技術メモ
http://d.hatena.ne.jp/myoshino2011/20131230/1388416394
# setsebool httpd_run_stickshift 1
1
# setsebool httpd_run_stickshift 1
2
# getsebool httpd_run_stickshift
3
httpd_run_stickshift --> on
4
# semanage fcontext -a -s system_u -t httpd_sys_content_t "/usr/share/redmine(.*/)?(.*)"
5
# restorecon -R -F /usr/share/redmine/
6
# chown -R apache:apache /usr/share/redmine
 

httpd設定

/etc/httpd/conf.d/redmine.conf
#
1
#
2
# Redmine is flexible project management web application.
3
#
4
<virtualhost *:80>
5
    ServerName redmine.example.com
6
    DocumentRoot /usr/share/redmine/public
7
 
8
    <directory /usr/share/redmine/public/>
9
        <ifmodule mod_authz_core.c>
10
            # Apache 2.4
11
            Require ip 192.168.1.0/24
12
            Require ip 127.0.0.1
13
        </IfModule>
14
        <ifmodule !mod_authz_core.c>
15
            # Apache 2.2
16
            Order Deny,Allow
17
            Allow from 192.168.1.0/24
18
            Allow from 127.0.0.1
19
        </IfModule>
20
        #Uncomment the next line if using with SSL/TLS
21
        #php_flag session.cookie_secure on
22
        AllowOverride All
23
    </Directory>
24
</VirtualHost>
 
# systemctl start httpd.service
1
# systemctl start httpd.service
2
# systemctl status httpd.service
3
# systemctl enable httpd.service
4
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
5
# firewall-cmd --add-service=http --zone=FedoraServer
6
# firewall-cmd --add-service=http --zone=FedoraServer --permanent
 

さて、これで起動できるわけだが、[管理]メニューにアクセスするとエラーになる。しかし、1度setenforce 0してからアクセスすると、エラーがでなくなる。SELinuxが関係しているのは間違いなさそうだが、ざっと見動いてるのでもういいや(゚∀゚)

0 件のコメント:

コメントを投稿