小例子可以部署在rails自带的WEBrick上,逐渐往后走还得上Apache。
安装apache服务器
命令是sudo apt-get install apache2
安装passenger插件
安装完毕还不能立刻用,因为想运行rails应用的话,还要为apache服务器安装插件passenger。
passenger是一个gem包,安装命令是gem install passenger
passenger集成进Apache
执行命令passenger-install-apache2-module,进入安装程序。
abbuggy@abbuggy-ubuntu:~$ passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v3.0.18.
This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.
Here's what you can expect from the installation process:
1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
3. You'll learn how to deploy a Ruby on Rails application.
Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.
Press Enter to continue, or Ctrl-C to abort.
回车确定之后,会进行依赖关系的检查,有部分内容不通过没有关系,回车之后会提示如何解决。
Checking for required software...
* GNU C++ compiler... found at /usr/bin/g++
* Curl development headers with SSL support... found
* OpenSSL development headers... found
* Zlib development headers... found
* Ruby development headers... found
* OpenSSL support for Ruby... found
* RubyGems... found
* Rake... found a

该博客详细介绍了如何在Ubuntu 12.04 LTS系统中安装Apache服务器,并使用Passenger插件部署Rails应用程序。步骤包括安装Apache,接着安装Passenger gem,然后通过passenger-install-apache2-module命令进行集成。最后,博主在配置过程中遇到的问题是默认运行环境为production,解决办法是在Apache配置中添加RailsEnv development来切换到development环境。
最低0.47元/天 解锁文章
963

被折叠的 条评论
为什么被折叠?



