Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
joruri-gw/doc/INSTALL.txt
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
355 lines (239 sloc)
11.9 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Joruri Gw 3.2.5 インストールマニュアル 2019.08.27 | |
| ********************************************************************** | |
| 1 想定環境 | |
| ********************************************************************** | |
| [システム] | |
| OS : CentOS 7.2 x86_64, CentOS 6.8 x86_64 | |
| Webサーバー : Apache 2.4, Apache 2.2 | |
| DBシステム : MySQL 5.6 | |
| Ruby : 2.3.7 | |
| Rails : 4.2 | |
| キャッシュ : memcached 1.4.20 | |
| [ネットワーク関連設定] | |
| IPアドレス : 192.168.0.2 | |
| ドメイン : 192.168.0.2 | |
| ※DECOアイコンについて | |
| メニュー内、「DECO Drive」アイコンについては、別プロジェクトの為、 | |
| リンクのみとなっております。 | |
| ********************************************************************** | |
| 2 CentOS のインストール | |
| ********************************************************************** | |
| CentOSをインストールします。 | |
| ※インストール完了後、ご利用になられる環境に合わせて適切なセキュリティ設定をお願いします。 | |
| CentOSに関するセキュリティ設定については、本マニュアルの範囲外となります。 | |
| rootユーザーに変更します。 | |
| $ su - | |
| ********************************************************************** | |
| 3 事前準備 | |
| ********************************************************************** | |
| Joruriユーザを作成します。 | |
| # useradd -m joruri # ユーザの作成 | |
| # passwd joruri # パスワードの設定 ※ パスワードは適宜変更してください。 | |
| RPMパッケージを最新にします。 | |
| # yum -y update | |
| Joruri Gw の実行に必要なパッケージをインストールします。 | |
| # yum -y install wget make gcc-c++ httpd httpd-devel memcached \ | |
| libjpeg-devel libpng-devel git \ | |
| ImageMagick ImageMagick-devel curl-devel libevent libevent-devel openssl openssl-devel | |
| MySQLをインストールします。 | |
| # yum -y install http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm | |
| # yum -y install mysql-community-server mysql-devel | |
| Joruri Gwソースコードを設置します。 | |
| # mkdir /var/share | |
| # git clone https://github.com/joruri/joruri-gw.git /var/share/jorurigw | |
| # chown -R joruri:joruri /var/share/jorurigw | |
| # cp /var/share/jorurigw/config/original/* /var/share/jorurigw/config/ | |
| ********************************************************************** | |
| 4 Apache の設定 | |
| ********************************************************************** | |
| Apacheの設定ファイルを編集します。 | |
| # vi /etc/httpd/conf/httpd.conf | |
| ----------------------------------------------------------------------- | |
| ServerName 192.168.0.2 | |
| ----------------------------------------------------------------------- | |
| 設定ファイルにエラーがないことを確認し、Apacheを起動します。 | |
| # /sbin/service httpd configtest | |
| # /sbin/service httpd start <- CentOS 6 | |
| # systemctl start httpd <- CentOS 7 | |
| 自動起動に設定します。 | |
| # chkconfig httpd on <- CentOS 6 | |
| # systemctl enable httpd <- CentOS 7 | |
| ********************************************************************** | |
| 5 MySQL の設定 | |
| ********************************************************************** | |
| MySQLの設定を行います。 | |
| 文字エンコーディングの標準を UTF-8 に設定します。 | |
| # vi /etc/my.cnf | |
| ----------------------------------------------------------------------- | |
| [mysqld] | |
| character-set-server=utf8 | |
| [client] | |
| default-character-set = utf8 | |
| ----------------------------------------------------------------------- | |
| ## [mysqld]に設定を追加、[client]と設定を追加。 | |
| MySQLを起動します。 | |
| # /usr/bin/mysql_install_db --user=mysql | |
| # /sbin/service mysqld start <- CentOS 6 | |
| # systemctl start mysqld <- CentOS 7 | |
| 自動起動に設定します。 | |
| # chkconfig mysqld on <- CentOS 6 | |
| # systemctl enable mysqld <- CentOS 7 | |
| rootユーザのパスワードを設定します。 | |
| # /usr/bin/mysqladmin -u root password "pass" | |
| joruriユーザを作成します。 | |
| # /usr/bin/mysql -u root -p -e "grant all on *.* to joruri@localhost IDENTIFIED BY 'pass'" | |
| ********************************************************************** | |
| 6 memcached の設定 | |
| ********************************************************************** | |
| memcachedを起動します。 | |
| # /sbin/service memcached start <- CentOS 6 | |
| # systemctl start memcached <- CentOS 7 | |
| 自動起動に設定します。 | |
| # chkconfig memcached on <- CentOS 6 | |
| # systemctl enable memcached <- CentOS 7 | |
| ********************************************************************** | |
| 7 Ruby on Rails のインストール | |
| ********************************************************************** | |
| ====================================================================== | |
| 7.1 rbenvのインストール | |
| ====================================================================== | |
| 必要なライブラリをインストールします。 | |
| # yum install libffi libffi-devel zlib zlib-devel openssl openssl-devel readline-devel bzip2 libyaml libyaml-devel | |
| rbenvをインストールします。 | |
| # git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
| # git clone git://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build | |
| rbenvの環境設定を行います。 | |
| # echo 'export RBENV_ROOT="/usr/local/rbenv"' >> /etc/profile.d/rbenv.sh | |
| # echo 'export PATH="${RBENV_ROOT}/bin:${PATH}"' >> /etc/profile.d/rbenv.sh | |
| # echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh | |
| # cat /etc/profile.d/rbenv.sh # 確認 | |
| # source /etc/profile.d/rbenv.sh # 問題なければ再読み込み | |
| # rbenv --version # rbenvのバージョン確認 | |
| # su joruri | |
| $ source /etc/profile.d/rbenv.sh # 一般ユーザで使えるように反映させます | |
| $ rbenv --version # 一般ユーザでバージョンが確認 | |
| $ exit # root戻ります | |
| ====================================================================== | |
| 7.2 Ruby のインストール | |
| ====================================================================== | |
| yamlライブラリをインストールします。 | |
| # cd /usr/local/src/ | |
| # wget http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz | |
| # tar -zxvf yaml-0.1.6.tar.gz | |
| # cd yaml-0.1.6 | |
| # ./configure | |
| # make | |
| # make install | |
| Rubyをインストールします。 | |
| # rbenv install 2.3.7 | |
| # rbenv global 2.3.7 | |
| # rbenv rehash | |
| # ruby -v | |
| # gem update --system | |
| # gem install bundler | |
| ====================================================================== | |
| 7.2 Phusion Passenger のインストール | |
| ====================================================================== | |
| Phusion Passengerをインストールします。 | |
| # gem install passenger -v 5.1.12 | |
| # passenger-install-apache2-module | |
| ( 画面の内容を確認して Enterキーを押してください。 ) | |
| Phusion Passengerがインストールされていることを確認します。 | |
| # passenger -v | |
| Phusion Passengerの動作環境を設定します。 | |
| # cp /var/share/jorurigw/config/samples/passenger.conf /etc/httpd/conf.d/passenger.conf | |
| ====================================================================== | |
| 7.3 gemライブラリ のインストール | |
| ====================================================================== | |
| Joruri Gw に必要なライブラリをインストールします。 | |
| # su - joruri | |
| $ cd /var/share/jorurigw | |
| $ bundle install --path vendor/bundle --without development test | |
| ネットワーク経由でファイルのダウンロードとインストールが行われます。 | |
| 正しく完了すれば次のようなメッセージが表示されます。 | |
| =>Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. | |
| ********************************************************************** | |
| 8 Joruri Gw のインストール | |
| ********************************************************************** | |
| Joruriユーザに変更します。 | |
| # su - joruri | |
| $ cd /var/share/jorurigw | |
| ====================================================================== | |
| 8.1 設定ファイル | |
| ====================================================================== | |
| 環境に応じて設定ファイルを編集します。 | |
| DB接続情報 | |
| $ vi config/database.yml | |
| LDAP接続情報 | |
| $ vi config/ldap.yml | |
| ※LDAPに関する設定は、ダウンロードページより補足資料をご参照下さい。 | |
| https://joruri.org/download/jorurigw/ 【LDAP関連補足資料】LDAP_LDIF.zip | |
| SMTP接続情報 | |
| $ vi config/smtp.yml | |
| ※連絡メモの「携帯等メール転送設定」などメール機能を利用する場合はSMTPの設定が必要です。 | |
| ====================================================================== | |
| 8.2 データベースの作成 | |
| ====================================================================== | |
| ※作業の途中でmysqlに設定したrootユーザのパスワードを聞かれますのでご用意ください。 | |
| データベースを作成します。 | |
| $ cd /var/share/jorurigw | |
| $ bundle exec rake db:setup RAILS_ENV=production | |
| 初期データを登録します。 | |
| $ bundle exec rake db:seed:demo RAILS_ENV=production | |
| ====================================================================== | |
| 8.3 assetのコンパイル | |
| ====================================================================== | |
| assetをコンパイルします。 | |
| $ bundle exec rake assets:precompile RAILS_ENV=production | |
| ====================================================================== | |
| 8.4 定期実行処理の設定 | |
| ====================================================================== | |
| cronによる定期実行処理を設定します。 | |
| $ bundle exec whenever --update-crontab | |
| 定期実行処理の内容を確認します。 | |
| $ crontab -l | |
| ※以下のコメントで囲まれた部分が設定内容となります。 | |
| ----------------------------------------------------------------------- | |
| # Begin Whenever generated tasks ... | |
| (この部分に定期実行処理が設定されます) | |
| # End Whenever generated tasks ... | |
| ----------------------------------------------------------------------- | |
| ====================================================================== | |
| 9.5 delayed_job の起動 | |
| ====================================================================== | |
| delayed_job を起動します。 | |
| $ bundle exec rake delayed_job:start RAILS_ENV=production | |
| ====================================================================== | |
| 8.6 VirtualHost の反映 | |
| ====================================================================== | |
| Apacheに設定を追加します。 | |
| $ su - | |
| # vi /etc/httpd/conf.d/vhosts.conf | |
| ※ 下記設定は誰でもアクセスできるようにしています。IP制限等を掛ける場合は適宜設定してください。 | |
| ----------------------------------------------------------------------- | |
| # apache 2.4 | |
| <IfModule mod_authz_core.c> | |
| <Directory /> | |
| Require all granted | |
| </Directory> | |
| </IfModule> | |
| <VirtualHost *:80> | |
| ServerName default | |
| DocumentRoot /var/share/jorurigw/public | |
| Alias /_common/ "/var/share/jorurigw/public/_common/" | |
| setenv LANG ja_JP.UTF-8 | |
| RackEnv production | |
| </VirtualHost> | |
| ----------------------------------------------------------------------- | |
| #PHPを同じ環境で動かす場合は、以下の記述を追加します。 | |
| ----------------------------------------------------------------------- | |
| <Directory "/var/share/jorurigw/public"> | |
| php_admin_flag engine off | |
| </Directory> | |
| ----------------------------------------------------------------------- | |
| Apache を再起動します。 | |
| # /sbin/service httpd configtest <- CentOS 6 | |
| # /sbin/service httpd restart <- CentOS 6 | |
| # /sbin/service httpd configtest <- CentOS 7 | |
| # systemctl restart httpd <- CentOS 7 | |
| 以上でJoruri Gwのインストールが完了です。 |