小例子可以部署在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
*