Fedora 21にRedmineをインストール

2015/02/16

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

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

MariaDB(MySQL)の設定

/etc/my.cnf.d/server.cnf
...... # this is only for the mysqld standalone daemon [mysqld] character-set-server=utf8 ......
/etc/my.cnf.d/mysql-clients.cnf
...... [mysql] default-character-set=utf8 ......

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

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

Redmineのインストール

# svn co http://svn.redmine.org/redmine/branches/2.5-stable /usr/share/redmine # cd /usr/share/redmine
config/database.yml
production: adapter: mysql2 database: redmine host: localhost username: redmine password: ******** encoding: utf8
config/configuration.yml
production: email_delivery: delivery_method: :smtp smtp_settings: address: "localhost" port: 25 domain: 'example.com' rmagick_font_path: /usr/share/fonts/ipa-pgothic/ipagp.ttf

Gemのインストール

# bundle config build.nokogiri --use-system-libraries# bundle install 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 machine. Fetching gem metadata from https://rubygems.org/......... Resolving dependencies... Installing rake 10.4.2 Installing i18n 0.6.11 Installing multi_json 1.10.1 Installing activesupport 3.2.21 Installing builder 3.0.4 Installing activemodel 3.2.21 Installing erubis 2.7.0 Installing journey 1.0.4 Installing rack 1.4.5 Installing rack-cache 1.2 Installing rack-test 0.6.3 Installing hike 1.2.3 Installing tilt 1.4.1 Installing sprockets 2.2.3 Installing actionpack 3.2.21 Installing mime-types 1.25.1 Installing polyglot 0.3.5 Installing treetop 1.4.15 Installing mail 2.5.4 Installing actionmailer 3.2.21 Installing arel 3.0.3 Installing tzinfo 0.3.43 Installing activerecord 3.2.21 Installing activeresource 3.2.21 Using bundler 1.7.6 Installing mini_portile 0.6.2 Installing nokogiri 1.6.6.2 Installing xpath 2.0.0 Installing capybara 2.4.4 Installing ffi 1.9.6 Installing childprocess 0.5.5 Installing coderay 1.1.0 Installing rack-ssl 1.3.4 Installing json 1.8.2 Installing rdoc 3.12.2 Installing thor 0.19.1 Installing railties 3.2.21 Installing jquery-rails 3.1.2 Installing metaclass 0.0.4 Installing mocha 1.0.0 Installing mysql2 0.3.17 Installing net-ldap 0.3.1 Installing ruby-openid 2.3.0 Installing rack-openid 1.4.2 Installing rails 3.2.21 Installing rbpdf 1.18.5 Installing redcarpet 2.3.0 Installing request_store 1.0.5 Installing rmagick 2.13.4 Installing rubyzip 1.1.7 Installing websocket 1.2.1 Installing selenium-webdriver 2.44.0 Installing shoulda-context 1.0.2 Installing shoulda-matchers 1.4.1 Installing shoulda 3.3.2 Installing yard 0.8.7.6 Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. Post-install message from rmagick: 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 # 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 # getsebool httpd_run_stickshift httpd_run_stickshift --> on # semanage fcontext -a -s system_u -t httpd_sys_content_t "/usr/share/redmine(.*/)?(.*)" # restorecon -R -F /usr/share/redmine/ # chown -R apache:apache /usr/share/redmine

httpd設定

/etc/httpd/conf.d/redmine.conf
# # Redmine is flexible project management web application. # <virtualhost *:80> ServerName redmine.example.com DocumentRoot /usr/share/redmine/public <directory /usr/share/redmine/public/> <ifmodule mod_authz_core.c> # Apache 2.4 Require ip 192.168.1.0/24 Require ip 127.0.0.1 </IfModule> <ifmodule !mod_authz_core.c> # Apache 2.2 Order Deny,Allow Allow from 192.168.1.0/24 Allow from 127.0.0.1 </IfModule> #Uncomment the next line if using with SSL/TLS #php_flag session.cookie_secure on AllowOverride All </Directory> </VirtualHost> # systemctl start httpd.service # systemctl status httpd.service # systemctl enable httpd.service Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service. # firewall-cmd --add-service=http --zone=FedoraServer # firewall-cmd --add-service=http --zone=FedoraServer --permanent
さて、これで起動できるわけだが、[管理]メニューにアクセスするとエラーになる。しかし、1度setenforce 0してからアクセスすると、エラーがでなくなる。SELinuxが関係しているのは間違いなさそうだが、ざっと見動いてるのでもういいや(゚∀゚)

0 件のコメント:

コメントを投稿