Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

webrick 는 개발용 웹서버라 production 환경에서는 적합하지 않다. apache 나 NginX 같은 Web Server에서 rails app 구동할 예정이면 fcgi 보다는 Phusion Passenger 같은 전문 rails deployer를 설치해야 한다.

gem 으로 설치

compile 해서 설치하므로  gcc-c++패키지가 설치되어 있어야 한다.
gem install passenger
passenger-install-apache2-module

 

yum 으로 설치

passenger repository 인 http://passenger.stealthymonkeys.com/ 를 통해 설치

rpm --import http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc
yum install http://passenger.stealthymonkeys.com/rhel/6/passenger-release.noarch.rpm
yum install mod_passenger

 

설정

설정 파일은 /etc/httpd/conf.d/passenger.conf  에 위치하므로 에디터로 설정을 수정한후에 apache httpd 를 재구동하면 된다.

 

SELinux 문제 해결

passenger가 설치된 경로를 SELinux policy 때문에 아파치 httpd가 읽지 못 해서 제대로 구동되지 않을 수가 있다. /var/log/audit/audit.log 에 다음과 같은 내용이 있다면 SELinux에 맞게 type enforcement 를 설정해 줘야 한다.

type=AVC msg=audit(1394037185.556:72502): avc:  denied  { chown } for  pid=24128 comm="PassengerWatchd" capability=0  scontext=unconfined_u:system_r:httpd_sys_script_t:s0 tcontext=unconfined_u:system_r:httpd_sys_script_t:s0 tclass=capability        Was caused by:
                Missing type enforcement (TE) allow rule.
                You can use audit2allow to generate a loadable module to allow this access.

 

  1. passenger 설치 루트 폴더를 알아낸다.

    > passenger-config --root             
    /usr/lib/ruby/gems/1.8/gems/passenger-3.0.21
  2. 설치 루트에 httpd 가 읽을 수 있게 label 을 설정한다.

    chcon -R -h -t httpd_sys_content_t /usr/lib/ruby/gems/1.8/gems/passenger-3.0.21
  3. httpd 재구동

 

 

  • No labels