Translate

2014年11月27日木曜日

CentOS7上のRedmine2.6.0にXLS Exportプラグインをインストールする



AWSとかの上でRedmine運用する際
SELINUXは有効にしたまま使いたくなるだろうとおもい、
CentOS7最小構成インストールしたサーバ上に
/etc/sysconfig/selinux
SELINUX=enforcing
にしたままで
Redmine2.6.0をインストールした。
Redmine以外のパッケージはすべてyum(かgem、bundle install)でインストールした。

Redmineは/opt/redmine以下にインストールした。

Redmineはapache(+passenger+ruby)で動作するWebアプリケーション
なので
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --reload

だけでなく
systemctl stop httpd.service
chown -R apache:apache /opt/redmine
chcon -R -t httpd_sys_content_t /opt/redmine
chcon -R -t httpd_sys_rw_content_t /opt/redmine
systemctl start httpd.service

と、アプリの入っている/opt/redmineに対して/var/www/html同様のルールをはらなくてはならない


chownしているのは、rootで操作しているためだ。
yumで導入したhttpdapacheアカウントで動作するので
rootで導入操作した後オーナを変更している。


で、プラグインをインストールする際も
この面倒な操作が必要になる。

たとえばXLS Exportをインストールする場合は


/rootにプラグインredmine_plugin_views_revisions_v001.zipredmine_xls_export-0.2.1.t6.zipをダウンロードしておいた状態で
cd /root/
unzip redmine_plugin_views_revisions_v001.zip
mv ./redmine_plugin_views_revisions /opt/redmine/plugins/
unzip redmine_xls_export-0.2.1.t6.zip
mv ./redmine_xls_export-0.2.1.t6 /opt/redmine/plugins/redmine_xls_export
cd /opt/redmine
bundle install
rake redmine:plugins:migrate RAILS_ENV=production
rake redmine:plugins:process_version_change RAILS_ENV=production
systemctl stop httpd.service
cd /opt
chown -R apache:apache ./redmine
chcon -R -t httpd_sys_content_t /opt/redmine
chcon -R -t httpd_sys_rw_content_t /opt/redmine
systemctl start httpd.service

としないと新規導入した/opt/redmine以下のファイルにアクセスできず
config.ruがどうのこうのという白い画面が出てしまう..


SELINUX=disabledにしないと、超めんどくさい..

既存アプリケーションをK8s上でコンテナ化して動かす場合の設計注意事項メモ

既存アプリをK8sなどのコンテナにして動かすには、どこを注意すればいいか..ちょっと調べたときの注意事項をメモにした。   1. The Twelve Factors (日本語訳からの転記) コードベース   バージョン管理されている1つのコードベースと複数のデプロイ 依存関係 ...