CentOS7.2にALB2 w/ Passenger

2016/02/27 4:49 に 森山誠二郎 が投稿
1. build-rubyでruby 2.2.4インストール
  参考:rubyを非rootでinstallする
  yum groupinstall "Development Tools"した
       yum install -y openssl-devel readline-devel zlib-develの必要があった
       CONFIGURE_OPTS=--enable-shared ruby-build 2.2.4 /opt/rubies/2.2.4

2. mysql(mariadb)インストール
    参考:MariaDBのインストール
    yum install mariadb-server

3. ALB2でbundle install
 まず、gem install bundle
     yum install cairo-devel sqlite-devel mysql-devel libicu-devel
     bundle install

4. Passengerの公式ドキュメントにしたがって、passsenger、apacheをインストールし、ALB2をdeploy
     注意点:
     1。Gemfileに以下を記述
          gem "passenger", ">= 5.0.25", require: "phusion_passenger/rack_handler"
     2。bundle installする時
        bundle install --deployment --without development test
    以下が  /etc/httpd/conf.d/alb.conf
<VirtualHost *:8180>
    ServerName alb.anagix.com

    # Tell Apache and Passenger where your app's 'public' directory is
    DocumentRoot /home/moriyama/work/alb2/public

    PassengerRuby /opt/rubies/2.2.4/bin/ruby

    # Relax Apache security settings
    <Directory /home/moriyama/work/alb2/public>
      Allow from all
      Options -MultiViews
      # Uncomment this if you're on Apache >= 2.4:
      Require all granted
    </Directory>
</VirtualHost>

Comments