redhat部署passenger

$ gem install passenger

$ sudo passenger-install-apache2-module

Installation instructions for required software

* To install Apache 2 development headers:
Please run yum install httpd-devel as root.

* To install Apache Portable Runtime (APR) development headers:
Please run yum install apr-devel as root.

* To install Apache Portable Runtime Utility (APU) development headers:
Please run yum install apr-util-devel as root.

安装上述三个库以后重新执行

$ sudo passenger-install-apache2-module

显示一些编译信息。。。

The Apache 2 module was successfully installed.

Please edit your Apache configuration file, and add these lines:

LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.17
PassengerRuby /usr/local/bin/ruby

After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!

上述内容添加到/etc/httpd/conf/httpd.conf

然后添加一个Rails应用

<VirtualHost *:80>
    ServerName www.loganalysis.com
    DocumentRoot /home/admin/workspace/LogAnalysis_Online/public
    <Directory /home/admin/workspace/LogAnalysis_Online/public>
        AllowOverride all
        Options -MultiViews
    </Directory>
</VirtualHost>

 

重启apache

$ sudo /etc/init.d/httpd restart

如果出现没有 '/' 访问权限的问题,则修改/etc/httpd/conf/httpd.conf

User apache
Group apache

修改为

User admin
Group admin

 

如果在Apache配置中设置RailsEnv development,Rails将在每个请求到达以后自动reload应用

转载于:https://www.cnblogs.com/scige/archive/2012/10/12/2721050.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值