- 浏览: 849274 次
- 性别:
- 来自: lanzhou
文章分类
最新评论
-
liu346435400:
楼主讲了实话啊,中国程序员的现状,也是只见中国程序员拼死拼活的 ...
中国的程序员为什么这么辛苦 -
qw8226718:
国内ASP.NET下功能比较完善,优化比较好的Spacebui ...
国内外开源sns源码大全 -
dotjar:
敢问兰州的大哥,Prism 现在在12.04LTS上可用么?我 ...
最佳 Ubuntu 下 WebQQ 聊天体验 -
coralsea:
兄弟,卫星通信不是这么简单的,单向接收卫星广播信号不需要太大的 ...
Google 上网 -
txin0814:
我成功安装chrome frame后 在IE地址栏前加上cf: ...
IE中使用Google Chrome Frame运行HTML 5
Install Required Packages
First, make sure you have the universe repository enabled in your /etc/apt/sources.list file. Your file should resemble the following:
File excerpt: /etc/apt/sources.list
## main & restricted repositories deb http://us.archive.ubuntu.com/ubuntu/ jaunty main restricted universe deb-src http://us.archive.ubuntu.com/ubuntu/ jaunty main restricted universe deb http://security.ubuntu.com/ubuntu jaunty-security main restricted universe deb-src http://security.ubuntu.com/ubuntu jaunty-security main restricted universe
If you added universe to the the items in your list, you'll need to update your repository database:
apt-get update
Issue the following command to install packages required for Ruby on Rails.
apt-get install wget build-essential ruby1.8 ruby1.8-dev irb1.8 rdoc1.8 zlib1g-dev \ libopenssl-ruby1.8 rubygems1.8 libopenssl-ruby libzlib-ruby libssl-dev
Create symbolic links to the installed version of Ruby:
ln -s /usr/bin/ruby1.8 /usr/bin/ruby ln -s /usr/bin/irb1.8 /usr/bin/irb
Install the rake gem:
gem install rake
Install Passenger and Nginx
Proceed to the Phusion Passenger site and locate the link for the current source code tarball. Download it as follows (substitute the link for the current version):
cd /root wget http://rubyforge.org/frs/download.php/59007/passenger-2.2.4.tar.gz cd /opt tar xzvf ~/passenger-2.2.4.tar.gz
Run the Phusion Passenger installer for Nginx:
cd passenger-2.2.4/bin ./passenger-install-nginx-module
You'll be greeted by the Phusion Passenger Nginx installer program. Press "Enter" to continue with the installation.
When prompted for the Nginx installation method, we recommend you choose "1" to allow the installer to automatically download, compile, and install Nginx for you. Unless you have specific needs that would necessitate passing custom options to Nginx at compile time, this is the safest way to proceed.
Please do not remove the Passenger files from opt after the install. They need to stay in place or your install will not function correctly.
Set up an Init Script for Nginx
Nginx is now installed in /opt/nginx, but we need a way of controlling it. Create a file called /etc/init.d/nginx and copy the following script contents into it:
File: /etc/init.d/nginx
#! /bin/sh ### BEGIN INIT INFO # Provides: nginx # Required-Start: $all # Required-Stop: $all # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts the nginx web server # Description: starts nginx using start-stop-daemon ### END INIT INFO PATH=/opt/nginx/sbin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/opt/nginx/sbin/nginx NAME=nginx DESC=nginx test -x $DAEMON || exit 0 # Include nginx defaults if available if [ -f /etc/default/nginx ] ; then . /etc/default/nginx fi set -e case "$1" in start) echo -n "Starting $DESC: " start-stop-daemon --start --quiet --pidfile /opt/nginx/logs/$NAME.pid \ --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --quiet --pidfile /opt/nginx/logs/$NAME.pid \ --exec $DAEMON echo "$NAME." ;; restart|force-reload) echo -n "Restarting $DESC: " start-stop-daemon --stop --quiet --pidfile \ /opt/nginx/logs/$NAME.pid --exec $DAEMON sleep 1 start-stop-daemon --start --quiet --pidfile \ /opt/nginx/logs/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; reload) echo -n "Reloading $DESC configuration: " start-stop-daemon --stop --signal HUP --quiet --pidfile /opt/nginx/logs/$NAME.pid \ --exec $DAEMON echo "$NAME." ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 exit 1 ;; esac exit 0
Run the following command to set system startup links:
chmod +x /etc/init.d/nginx /usr/sbin/update-rc.d -f nginx defaults
You can now start, stop, and restart Nginx just like any other server daemon. For example, to start the server, issue the following command:
/etc/init.d/nginx start
The configuration file for Nginx is located at /opt/nginx/conf/nginx.conf. This is the file you'll need to edit to add support for your Rails applications. A default server is already configured in this file, and it also contains examples for alternate virtual host and SSL configurations.
Install MySQL Support (optional)
If your application uses MySQL, install the database server by following our MySQL on Ubuntu 9.04 (Jaunty) guide. Once it's installed and configured properly, issue the following commands:
apt-get install libmysqlclient15-dev libmysql-ruby gem install mysql --no-rdoc --no-ri -- --with-mysql-dir=/usr/bin \ --with-mysql-lib=/usr/lib/mysql --with-mysql-include=/usr/include/mysql
Congratulations!
You've successfully configured your server to use Passenger for Nginx to serve Ruby on Rails applications. Enjoy!
发表评论
-
Rails 3 Beta版本月将出 Merb融合带来选择
2010-01-11 09:48 1418Rails 3,目前流行Web开发框架Rails的一个升级版 ... -
MerbAdmin:Merb数据管理好帮手
2010-01-11 09:43 905Merb中要加入类似Django的Admin功能早有传闻,如今 ... -
rails cms
2009-12-28 20:29 1667Rails CMS alternatives ======= ... -
Generating Thousands of PDFs on EC2 with Ruby
2009-12-24 18:01 1037The Problem For about two mont ... -
Shrink your JavaScript with the Google Compiler Rails Plugin
2009-11-16 11:27 931Like it or not, JavaScript has ... -
Thank you, Rails
2009-11-06 18:21 565It’s fashionable, or perhaps in ... -
Top 50 Ruby on Rails Websites
2009-10-31 15:18 943We’re big fans of Ruby on Rails ... -
Let a human test your app, not (just) unit tests
2009-10-31 09:26 852I’m a big believer in unit test ... -
Heroku Gets Add-Ons: Serious Ruby Webapp Hosting Made Easy
2009-10-30 07:37 911Heroku is a Ruby webapp hosti ... -
Rails + Google Analytics = easy goal tracking
2009-10-29 20:38 890Google Analytics is an indis ... -
Integrating Flickr into your rails website
2009-10-29 20:37 1065In this post I’m going to show ... -
Ruby on Rails Roadshow in Austin Thursday
2009-10-29 14:25 807Justin Britten founded Prefine ... -
Ruby on Rails and the importance of being stupid
2009-10-21 08:13 804A tale of two servers… Server ... -
How a 1-Engineer Rails Site Scaled to 10 Million Requests Per Day
2009-10-20 14:49 774Ravelry is an online knitting ... -
Installing Rails on CentOS 5
2009-10-20 14:24 1190Note: Since this post origina ... -
CentOS配置lighttpd和rails
2009-10-20 14:22 1121lighttpd版本:1.4.18 fastcgi版本: ... -
Cells:将组件开发带入Ruby2.3
2009-10-20 09:17 1116cells "将使得面向组 ... -
High Quality Ruby on Rails Example Applications
2009-10-15 16:34 1459Sometimes to best way to get ... -
Install Passenger on Ubuntu
2009-10-07 10:17 804Phusion Passenger is one of the ... -
Installing Ruby on Rails with Apache on Ubuntu 9.04 (Jaunty)
2009-10-07 10:00 1013Installing Passenger and Depe ...
相关推荐
《Ruby on Rails Tutorial》中文版(原书第2版,涵盖 Rails 4) Ruby 是一门很美的计算机语言,其设计原则就是“让编程人员快乐”。David Heinemeier Hansson 就是看重了这一点,才在开发 Rails 框架时选择了 Ruby...
### Ruby on Rails 101:深入理解与实践 #### 引言 《Ruby on Rails 101》是一本介绍Ruby on Rails(简称RoR或ROR)的基础书籍,旨在为初学者提供一个全面而深入的学习框架。本书由Peter Marklund编写,包含了五天...
9. **Install Ruby Rails Lighttpd MySQL on Ubuntu or FreeBSD - Huihoo Wiki - Open Source Wiki_files**: 这可能是上述文档的辅助文件,可能包含图片或其他资源,有助于理解安装过程。 安装Ruby on Rails的过程...
Ruby on Rails,简称Rails,是基于Ruby编程语言的一个开源Web应用程序框架,它遵循MVC(模型-视图-控制器)架构模式,旨在提高开发效率和代码的可读性。Rails以其“约定优于配置”(Convention over Configuration)...
本书教您如何使用Ruby on Rails开发和部署真正的,具有工业实力的Web应用程序,Ruby on Rails是为诸如Twitter,Hulu,GitHub和Yellow Pages等顶级网站提供支持的开源Web框架。
《Ruby on Rails 3 Tutorial》是一本专门为初学者设计的指南,旨在帮助读者快速掌握Ruby on Rails这一强大的Web开发框架。Ruby on Rails(简称Rails)是基于Ruby语言的一个开源框架,它采用MVC(Model-View-...
### Ruby on Rails Guides v2 - Ruby on Rails 4.2.5 #### 一、重要概念及基础假设 - **重要概念**:本指南旨在帮助读者深入理解Ruby on Rails(以下简称Rails)4.2.5版本的核心功能与最佳实践。 - **基础假设**:...
《Ruby on Rails for Dummies》是一本专门为初学者设计的Ruby on Rails教程,它旨在帮助新手快速理解并掌握这个强大的Web开发框架。Ruby on Rails(简称Rails)是基于Ruby编程语言构建的一个开源Web应用程序框架,它...
Ruby on Rails,简称Rails,是一款基于Ruby语言的开源Web应用框架,它遵循MVC(Model-View-Controller)架构模式,旨在简化Web应用程序的开发。Rails由David Heinemeier Hansson于2004年创建,它提倡“约定优于配置...
《Ruby on Rails入门权威经典》是一本专门为初学者设计的指南,旨在帮助读者全面掌握Ruby on Rails这一强大的Web开发框架。Ruby on Rails(简称Rails)是基于Ruby编程语言的开源框架,以其“DRY(Don't Repeat ...
Ruby on Rails,简称Rails,是由David Heinemeier Hansson基于Ruby语言开发的一个开源Web应用程序框架。这个框架遵循“约定优于配置”(Convention over Configuration)的原则,致力于简化Web应用的开发流程,提高...
Ruby On Rails 框架自它提出之日起就受到广泛关注,在“不要重复自己”,“约定优于配置”等思想的指导下,Rails 带给 Web 开发者的是极高的开发效率。 ActiveRecord 的灵活让你再也不用配置繁琐的 Hibernate 即可...
Ruby on Rails,简称Rails,是基于Ruby语言的一个开源Web应用程序框架,它遵循MVC(Model-View-Controller)架构模式,旨在使Web开发过程更加高效、简洁。本压缩包中的"Ruby on Rails入门经典代码"提供了新手学习...
Learn Web Development with Rails Clear EPUB version in English, Second Edition “The author is clearly an expert at the Ruby language and the Rails framework, but more than that, he is a working ...
### Ruby on Rails与Java框架对比分析 #### 一、引言 随着互联网技术的迅猛发展,Web开发领域也迎来了各种各样的开发框架和技术栈。在众多的开发框架中,Ruby on Rails (RoR) 和 Java 的相关框架尤其受到关注。本文...
Ruby on Rails,简称Rails,是基于Ruby语言的开源Web应用框架,它遵循MVC(Model-View-Controller)架构模式,旨在使开发过程更加简洁高效。这个“ruby on rails 教程源码”很可能是为了辅助学习者深入理解Rails的...
Ruby on Rails(简称Rails)是一种基于Ruby语言的开源Web应用程序框架,它遵循MVC(Model-View-Controller)架构模式,旨在简化Web开发过程并提高效率。在这个“ruby on rails在线考试系统”中,我们可以探讨以下几...
Ruby on Rails 4 Tutorial 是一本深受开发者欢迎的书籍,它详细介绍了如何使用Ruby on Rails这一强大的Web开发框架。Ruby on Rails(简称Rails)是基于Ruby语言的开源框架,以其“约定优于配置”(Convention over ...