パッケージのインストール
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]
4character-set-server=utf8
5......
/etc/my.cnf.d/mysql-clients.cnf
......
1......
2[mysql]
3default-character-set=utf8
4......
MariaDBの起動とユーザ/テーブルの作成
# systemctl start mariadb
1# systemctl start mariadb
2# systemctl status mariadb
3# systemctl enable mariadb
4Created 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
7MariaDB [(none)]> create database redmine default character set utf8;
8MariaDB [(none)]> grant all on redmine.* to redmine@localhost identified by '********';
9MariaDB [(none)]> flush privileges;
10MariaDB [(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:
1production:
2 adapter: mysql2
3 database: redmine
4 host: localhost
5 username: redmine
6 password: ********
7 encoding: utf8
config/configuration.yml
production:
1production:
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
2Don'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
3machine.
4Fetching gem metadata from https://rubygems.org/.........
5Resolving dependencies...
6Installing rake 10.4.2
7Installing i18n 0.6.11
8Installing multi_json 1.10.1
9Installing activesupport 3.2.21
10Installing builder 3.0.4
11Installing activemodel 3.2.21
12Installing erubis 2.7.0
13Installing journey 1.0.4
14Installing rack 1.4.5
15Installing rack-cache 1.2
16Installing rack-test 0.6.3
17Installing hike 1.2.3
18Installing tilt 1.4.1
19Installing sprockets 2.2.3
20Installing actionpack 3.2.21
21Installing mime-types 1.25.1
22Installing polyglot 0.3.5
23Installing treetop 1.4.15
24Installing mail 2.5.4
25Installing actionmailer 3.2.21
26Installing arel 3.0.3
27Installing tzinfo 0.3.43
28Installing activerecord 3.2.21
29Installing activeresource 3.2.21
30Using bundler 1.7.6
31Installing mini_portile 0.6.2
32Installing nokogiri 1.6.6.2
33Installing xpath 2.0.0
34Installing capybara 2.4.4
35Installing ffi 1.9.6
36Installing childprocess 0.5.5
37Installing coderay 1.1.0
38Installing rack-ssl 1.3.4
39Installing json 1.8.2
40Installing rdoc 3.12.2
41Installing thor 0.19.1
42Installing railties 3.2.21
43Installing jquery-rails 3.1.2
44Installing metaclass 0.0.4
45Installing mocha 1.0.0
46Installing mysql2 0.3.17
47Installing net-ldap 0.3.1
48Installing ruby-openid 2.3.0
49Installing rack-openid 1.4.2
50Installing rails 3.2.21
51Installing rbpdf 1.18.5
52Installing redcarpet 2.3.0
53Installing request_store 1.0.5
54Installing rmagick 2.13.4
55Installing rubyzip 1.1.7
56Installing websocket 1.2.1
57Installing selenium-webdriver 2.44.0
58Installing shoulda-context 1.0.2
59Installing shoulda-matchers 1.4.1
60Installing shoulda 3.3.2
61Installing yard 0.8.7.6
62Your bundle is complete!
63Use `bundle show [gemname]` to see where a bundled gem is installed.
64Post-install message from rmagick:
65Please 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
3httpd_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
4Created 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 件のコメント:
コメントを投稿