- 浏览: 832633 次
- 性别:
- 来自: 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 1379Rails 3,目前流行Web开发框架Rails的一个升级版 ... -
MerbAdmin:Merb数据管理好帮手
2010-01-11 09:43 886Merb中要加入类似Django的Admin功能早有传闻,如今 ... -
rails cms
2009-12-28 20:29 1642Rails CMS alternatives ======= ... -
Generating Thousands of PDFs on EC2 with Ruby
2009-12-24 18:01 999The Problem For about two mont ... -
Shrink your JavaScript with the Google Compiler Rails Plugin
2009-11-16 11:27 901Like it or not, JavaScript has ... -
Thank you, Rails
2009-11-06 18:21 547It’s fashionable, or perhaps in ... -
Top 50 Ruby on Rails Websites
2009-10-31 15:18 918We’re big fans of Ruby on Rails ... -
Let a human test your app, not (just) unit tests
2009-10-31 09:26 825I’m a big believer in unit test ... -
Heroku Gets Add-Ons: Serious Ruby Webapp Hosting Made Easy
2009-10-30 07:37 889Heroku is a Ruby webapp hosti ... -
Rails + Google Analytics = easy goal tracking
2009-10-29 20:38 869Google Analytics is an indis ... -
Integrating Flickr into your rails website
2009-10-29 20:37 1036In this post I’m going to show ... -
Ruby on Rails Roadshow in Austin Thursday
2009-10-29 14:25 787Justin Britten founded Prefine ... -
Ruby on Rails and the importance of being stupid
2009-10-21 08:13 778A tale of two servers… Server ... -
How a 1-Engineer Rails Site Scaled to 10 Million Requests Per Day
2009-10-20 14:49 742Ravelry is an online knitting ... -
Installing Rails on CentOS 5
2009-10-20 14:24 1163Note: Since this post origina ... -
CentOS配置lighttpd和rails
2009-10-20 14:22 1105lighttpd版本:1.4.18 fastcgi版本: ... -
Cells:将组件开发带入Ruby2.3
2009-10-20 09:17 1087cells "将使得面向组 ... -
High Quality Ruby on Rails Example Applications
2009-10-15 16:34 1436Sometimes to best way to get ... -
Install Passenger on Ubuntu
2009-10-07 10:17 776Phusion Passenger is one of the ... -
Installing Ruby on Rails with Apache on Ubuntu 9.04 (Jaunty)
2009-10-07 10:00 989Installing Passenger and Depe ...
相关推荐
Ubuntu系统ruby on rails安装 Ubuntu系统ruby on rails安装 Ubuntu系统ruby on rails安装 Ubuntu系统ruby on rails安装 Ubuntu系统ruby on rails安装 Ubuntu系统ruby on rails安装 Ubuntu系统ruby on rails安装 ...
《Ruby on Rails Tutorial》中文版(原书第2版,涵盖 Rails 4) Ruby 是一门很美的计算机语言,其设计原则就是“让编程人员快乐”。David Heinemeier Hansson 就是看重了这一点,才在开发 Rails 框架时选择了 Ruby...
Ruby On Rails中文教材(PDF)
Ruby on Rails Guides v2 - Ruby on Rails 4.2.5
ruby on rails社区网站开发源码
Ruby on Rails Web开发学习实录 内容简介: 在目前的主流web开发技术中,基于ruby语言的rails框架是做网站开发速度最快的工具。它可以达到j2ee框架开发速度的5~10倍,并且代码量也非常少。另外由于代码量的大幅度...
ruby on rails对mongodb的操作ruby on rails对mongodb的操作ruby on rails对mongodb的操作ruby on rails对mongodb的操作
本书教您如何使用Ruby on Rails开发和部署真正的,具有工业实力的Web应用程序,Ruby on Rails是为诸如Twitter,Hulu,GitHub和Yellow Pages等顶级网站提供支持的开源Web框架。
本书的目标是成为对“如果想学习使用 Ruby on Rails 进行 Web 开发,我应该从哪儿开始?”这一问题的最好答案。学习完本书的内容之后,你将具备使用 Rails 进行开发和部署 Web 程序的技能。同时你还能够通过一些进阶...
Ruby On Rails 框架自它提出之日起就受到广泛关注,在“不要重复自己”,“约定优于配置”等思想的指导下,Rails 带给 Web 开发者的是极高的开发效率。 ActiveRecord 的灵活让你再也不用配置繁琐的 Hibernate 即可...
ruby on rails 教程源码,配合原书使用
Ruby On Rails 官方教程,这本书讲解如何使用 Ruby on Rails 框架开发应用,以及如何把应用部署到生成环境。本书使用 Rails 默认的开发工具栈开发了一个完整的社交应用(类似 Twitter)。读完本书后你将掌握如何使用...
该资源包包括在Linux安装Ruby on Rails所需的包,以及安装步骤文档
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 开发环境包(ruby1.8.7,rails2.2.3)
Ruby on Rails中文指南
最新Ruby on Rails中文版介绍,欢迎大家共同学习此最新的技术!随着Ruby和Rails版本的不断升级,这些知识也在不断的更新,谢谢的支持!
ruby on rails api方便查阅