shitou's blog 
Home About Feed | 十人族 MIX BOY 塌客

Tags "架构"

13
Feb

Debian中ruby on rails运行环境的搭建 by shitou

0

很久之前的笔记了,现在整理出来, 这里采用的是Apache + Mongrel Cluster, 其实shitou个人还是喜欢Lighttpd + FastCGI搭配的说,因为其他原因只能现在跑这样的环境啦- -||


软件:

ruby-1.8.7-p72.tar.gz

rubygems-1.3.0.tgz

ruby-zlib-0.6.0.tar.gz

mysql-ruby-2.8.tar.gz

 

安装:

安装ruby

#apt-get install gcc libc6-dev make tmake autogen automake \

build-essential indent intltool

#tar zxvf ruby-1.8.7-p72.tar.gz

#cd ruby-1.8.7-p72

##开启最后一行的zlib支持

#vi ext/Setup

#./configure --prefix=/usr/local/ruby

#make; make install

##把/usr/local/ruby/bin加入环境变量PATH中, 并写入文件/root/.profile中

#apt-get install zlib1g-dev

#cd ext/zlib

#ruby extconf.rb;

#make; make install

 

 

安装rubygems

#tar zxvf rubygems-1.3.0.tgz

#cd rubygems-1.3.0

#ruby setup.rb

 

安装rails

#gem install rails –version 2.0.2

 

支持rails console

#apt-get install libreadline5-dev

#cd ruby-1.8.7-p72/ext/readline

#ruby extconf.rb

#make; make install

 

在不安装SSL的话rails应用启动会报错

#apt-get install libssl-dev

#cd ruby-1.8.7-p72/ext/openssl

#ruby extconf.rb

#make; make install

 

安装mysql

#apt-get install mysql-server mysql-client libmysqlclient15-dev

 

安装ruby的mysql的C接口

#tar zxvf mysql-ruby-2.8.tar.gz

#cd mysql-ruby-2.8

#ruby extconf.rb –with-mysql-include=/usr/include/mysql –with-mysql-lib=/usr/lib

#make; make install

 

安装mongrel

#gem install mongrel mongrel_cluster

 

Apache, PHP的安装

#apt-get install apache2

#apt-get install php5 php5-mysql libapache2-mod-php5 php-pear

 

mongrel的配置

/railsapp/config/mongrel_cluster.yml:

cwd: /var/www/rails/cal_point
port: 3000
environment: production
group: www-data
user: www-data
address: 127.0.0.1
pid_file: log/mongrel.pid
servers: 3

 

Apache开启Proxy的相关模块, 配置

/etc/apache2/httpd.conf:

<Proxy balancer://myproxycluster>
    #loadfactor is the weight of the server, range 1-100, the bigger the stronger
    BalancerMember http://127.0.0.1:3000    loadfactor=10
    BalancerMember http://127.0.0.1:3001    loadfactor=10
    BalancerMember http://127.0.0.1:3002    loadfactor=10
</Proxy>

ProxyPass / balancer://myproxycluster/
ProxyPassReverse / balancer://myproxycluster/


启动mongrel cluster:

进去rails项目的根目录:

#mongrel_rails cluster::start

注意: 启动前要保正log文件夹的权限为Apache运行用户(在debian中一般是www-data)可写的

 

Tags: debian,架构

2009-02-13 16:48:23, 641 reviews

send to mailbox

Your email:

24
Oct

几篇rails架构的文章 by shitou

0

 找到两篇不错分析rails系统架构的文章, 太长了, 懒得翻译了, 把地址贴出来吧

 

 

Can Rails Scale? Absolutely!

 

The Rebuilding and Scaling of YellowPages.com



Tags: 架构

2008-10-24 11:40:37, 752 reviews

send to mailbox

Your email:

Tags

tenerer MooseFS gearman-ruby Gearman MongoDB MochiChat TCP U-ka saegusa IN db command Mai Kuraki Norah Jones log iPhoneException ACG Mac Safari objective-c CouchDB LVS AJAX debian 推荐 AMQP google mail bug gettext Erlang 北京 iptables 架构 tips mysql backup function 我看 postfix 监控 SEO cache Etag memcache thread 进程 线程 无锡 yield file column mixboy xml rss gems ruby shitou shell lighttpd 安全 csrf 公司 nginx linux 模块 apache webserver 朋友 大学 生活 尼古拉斯凯奇 movie 文件同步 笑笑 歌词 auto complete plugin rails music ubuntu blog

Category

  • iPhone[17]
  • Erlang[8]
  • google[9]
  • 生活[41]
  • 音乐[11]
  • 电影[11]
  • linux[24]
  • web server[6]
  • mail server[3]
  • cluster[1]
  • system manage[8]
  • ruby[18]
  • ruby on rails[27]
  • 开源[3]

Episode

  • MochiChat
  • iPhoneException
  • shell
  • thread
  • memcache

Recent Comments

  • cancer planeta famosas, minal http://zewero.cen...
  • moskowitz mofos, bedroom http://biiili.centerbl...
  • exploit 3pic, julien http://zewero.centerblog.n...
  • Thanks funny site jp imageboard bbs pthc cp :...
  • essence vidz, escalation http://liili.centerblo...
  • arab black singles, sleepwalking http://biiili....
  • Hello good day freeforum.tw pthc 557 valya pt...
  • upenn hand job, sanglah http://liili.centerblog...
  • Thanks funny site ukrainian nymphet rfd nymph...
  • Jonny was here nymphets land ckw topless nymp...

Popular Posts

  • 准备开始学习Erlang了(恶狼, 二郎..)
  • MySQL Innodb备份
  • Lighttpd配置参数
  • iPhone上的HelloWorld终于跑起来了
  • Etag和Expire

Recommended Posts

  • 再次被和谐-_-
  • 十人族: 上线了
  • MooseFS vs. NFS
  • Mochichat新版本上线
  • Gearman
  • MongoDB入门
  • find使用非业余研究
  • MochiChat: 一个基于erlang的web聊天室(beta)
  • /dev/shm和swap的区别
  • gen_tcp的packet参数
  • Beauty - Mai Kuraki
  • awk多维数组
  • We Lost Google.cn
  • Erlang TCP Server例子
  • Mai Kuraki -永远より ながく

Friends' blogs

  • levy
  • sphance
  • andreas

Login

   注册

留言 查看留言

留言

   取消

留言 查看留言


Statistics

  • 访问次数: 87197
  • 今天访问: 15
  • 日志: 187
  • 评论: 167
  • 音乐: 9
  • 用户: 485


 

just DO NOT support IE

close