Install Passenger on Ubuntu

本文介绍如何使用Phusion Passenger在Ubuntu上快速部署Rails应用。通过运行预置脚本安装Passenger,并设置虚拟主机配置来启动Rails应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Phusion Passenger is one of the easiest Rails and Rack environments to set up and configure with Apache2. With my bootstrapping scripts, the ability to establish a Virtual machine image and have a working Rails application on it in minutes is a reality. Here is how I do it.

Bootstrap Passenger

Begin by Bootstrapping Ubuntu.

The next step is to run the script for installing Passenger. The standard passenger install against the standard Ruby 1.8.7 package managed libraries are installed with the following:

(assuming you’ve downloaded the bootstrap scripts and are in the ~/bootstrap-scripts/ubuntu/intrepid folder already, execute the following script:

./bootstrap-passenger-std.sh

Passenger’s install prompts you two or three times. Simply press and ignore the additional configuration instructions (the bootstrap script carries out these instructions for you).

Set up a demo Rails project

cd /var/www
sudo mkdir rails
cd rails
sudo rails demo
cd ..
chown -R www-data:www-data rails

Set up a Virtual Host Entry

Apache2 on Ubuntu makes it fairly straightforward to set up a provider for the Rails application, simply create the following in /etc/apache2/sites-available/demo:

<VirtualHost *:80>
  ServerName localhost
  DocumentRoot /var/www/rails/demo/public
</VirtualHost>

And then enable the site:

sudo a2ensite demo
sudo /etc/init.d/apache2 reload

End Result

If all goes well, you should then be able to browse to http://localhost and see the rails greet page. Your system will look something like this:

OS: 2.6.27-7-server x86_64 GNU/Linux
Apache: Server version: Apache/2.2.9 (Ubuntu)
Passenger: 2.0.6
Ruby: ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
Rubygems: 1.3.1
gems:
 - actionmailer (2.2.2)
 - actionpack (2.2.2)
 - activerecord (2.2.2)
 - activeresource (2.2.2)
 - activesupport (2.2.2)
 - fastthread (1.0.1)
 - passenger (2.0.6)
 - plist (3.0.0)
 - rack (0.9.1)
 - rails (2.2.2)
 - rake (0.8.3)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值