- 浏览: 849797 次
- 性别:
- 来自: 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
Apache
Run the following to install passenger, an apache module that adds support for running rails apps within apache:
sudo gem install passenger sudo passenger-install-apache2-module
Now you have to configure apache to point to the passenger module. Simply copy the following suggested code from the passenger-install-apache2-module
installation to the end of your Apache configuration file, which can be accessed by typing in the command sudo gedit /etc/apache2/apache2.conf
: (if you are using RubyGems 1.1):
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-1.0.3/ext/apache2/mod_passenger.so RailsSpawnServer /usr/lib/ruby/gems/1.8/gems/passenger-1.0.3/bin/passenger-spawn-server RailsRuby /usr/bin/ruby1.8
(if you are using RubyGems 1.2):
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3/ext/apache2/mod_passenger.so PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3 PassengerRuby /usr/bin/ruby1.8
(if you are using RubyGems 1.3.1):
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.6 PassengerRuby /usr/bin/ruby1.8
Now you should point apache to the location of your Ruby app. Create something like this in /etc/apache2/sites-available/ror.myhost.com
<VirtualHost *> ServerName ror.myhost.com DocumentRoot /home/myuser/www/mynewapp/public </VirtualHost>
Alternatively, you could run rails in a specific sub uri of your current host, e.g. localhost. First, make a symbolic link to your rails public folder from with var/www (or wherever you have the root of your apache www folder), e.g.:
ln -s /home/myuser/www/mynewapp/public /var/www/mynewapp
In case of localhost (which is the default host with a fresh ubuntu/apache install) edit default
in /etc/apache2/sites-available
and add:
RailsBaseURI /mynewapp
murb: I had to add RailsEnv development
as well to get around the 'no route found to match "/rails/info/properties" with {:method=>:get}' warning... (can someone elaborate on why?) apparently this is because /info/properties is buggy and no longer supported: http://www.ruby-forum.com/topic/161924 Save, and enable the rewrite module for apache, and register this site... and finally, restart apache.
sudo a2enmod rewrite sudo a2ensite ror.myhost.com sudo /etc/init.d/apache2 restart
Lighttpd
Edit lighttpd.conf, e.g.:
sudo kate /etc/lighttpd/lighttpd.conf
and here starts the tricky part, paste at the end of the file:
server.modules += ( "mod_fastcgi", "mod_rewrite" ) $HTTP["host"] == "localhost" { server.document-root = "/home/santiago/proyectos/beholder/public/" server.dir-listing = "disable" server.error-handler-404 = "/dispatch.fcgi" fastcgi.server = ( ".fcgi" => ( "localhost" => ( "min-procs" => 1, "max-procs" => 1, "socket" => "/tmp/ruby-beholder.socket", "bin-path" => "/home/santiago/proyectos/beholder/public/dispatch.fcgi", "bin-environment" => ( "RAILS_ENV" => "development" ) ) ) ) }
now run
sudo /etc/init.d/lighttpd restart
and you're set, go to http://localhost and you should see the rails index... click on the link "About your rails environment" and if you don't see a 404 or 500 error... then you're set (you should see either a rails error, or a rails message or something like that).
Known Problems
just in case you get a message like this:
kmin@metakmin:~/ruby_test$ gem -v 1.2.0 kmin@metakmin:~/ruby_test$ rails -v Rails 2.2.2 kmin@metakmin:~/ruby_test$ gem update --system Updating RubyGems Nothing to update kmin@metakmin:~/ruby_test$ script/server Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update --system` and try again. kmin@metakmin:~/ruby_test$
dont panic, just run:
sudo gem install rubygems-update sudo update_rubygems
发表评论
-
Ubuntu 10.04 新视觉设计、主题和Logo
2010-03-04 18:46 963根据官方wiki (屏幕截图)的介绍,Ubuntu ... -
Ubuntu自动备份软件包和制作本地源
2010-01-27 11:47 2519执行过sudo apt-get update &&am ... -
10 scripts to create your own Linux distribution
2010-01-25 15:20 1029Those familiar with Linux will ... -
Ubuntu下rhythmbox播放MP3乱码问题的解决
2010-01-19 18:03 2411在Ubuntu下,系统是使用的UTF-8字符集。而rhyt ... -
解决ubuntu 鼠标键盘的失效问题
2010-01-11 10:09 11069把主板的apic 禁用掉就可以了,如果你是多系统的话,这样可能 ... -
Windows 7 or Ubuntu 9.10 – battle of the operating systems
2009-11-06 08:08 996Operating systems have become l ... -
Hey Ubuntu, Stop Making Linux Look Bad
2009-11-06 08:07 879It’s the same old story. A new ... -
Ubuntu.com Suffers Intermittent Outages As Thousands Download Karmic Koala
2009-11-04 08:40 778(WEB HOST INDUSTRY REVIEW) -- T ... -
Xubuntu 9.10 Review and Commentary
2009-11-04 08:38 943With the recent release of Ub ... -
Ubuntu 9.10 - Almost Perfect
2009-11-03 09:48 723It’s been quite some time sin ... -
How to make Ubuntu extremely fast
2009-11-03 08:57 1649Old hardware? Want a faster boo ... -
5 things make Kubuntu 9.10 special
2009-11-03 08:50 862Kubutnu is the first distributi ... -
CentOS 5.4 vs. OpenSuSE 11.2 vs. Ubuntu 9.10 Benchmarks
2009-11-03 08:49 2944With the release of CentOS 5.4 ... -
many things to do after install ubuntu 9.10
2009-11-02 14:46 5583So you've just installed Ubuntu ... -
How to install Nvidia/ATI graphic cards drivers in Ubuntu 9.04
2009-11-01 23:49 1640Many a times users mess up thei ... -
How to install Ubuntu 9.10 without CD/DVD
2009-11-01 23:44 1299Ubuntu 9.10, Karmic Koala is ... -
Things to do after installing Ubuntu9.10 Karmic Koala
2009-11-01 22:44 1985Here are things i see are impor ... -
Ubuntu下安装MP3播放器Audacious
2009-11-01 08:02 2512在Ubuntu下安装软件就是简单方便,MP3你想不想听,那我们 ... -
The new Ubuntu Software Center
2009-10-31 08:25 1080You may remember my mention of ... -
Ubuntu 9.10 'Karmic Koala' released, could decide your OS fate
2009-10-30 09:51 689It's October 2009 which means s ...
相关推荐
gtfspy gtfspy是一个Python软件包,用于分析GTFS-格式中提供的公共交通时刻表数据。核心功能: 将一个或多个GTFS提要导入一个数据库中,以高效地查询数据。 使用开放式街道地图(OSM)数据,以PT站点之间的实际步行...
:passenger_ship: 装运它! :triangular_flag: 挑战性 :cut_of_meat:放样应用程序 :rosette: 代币供应商 :woman::laptop: 范例与教学 :admission_tickets: 简单的NFT 内置 :building_construction: 脚手架 :...
passenger_nginx_vhost_test 这是一个简单的食谱设计测试passenger_nginx_vhost其通过暴露LWRP passenger_nginx食谱。 要运行 ChefSpec 测试,只需运行: rspec -fd --color 要运行 ServerSpec 测试(通过 ...
Every passenger, please fasten your safety belt. - 答案:B. take off 解析:take off 意为“起飞”,用于描述飞机即将起飞的情况。 6. 题目:This math problem is very difficult, so I can’t ______it___...
self.passenger_number = passenger_number class Truck(Vehicle): def __init__(self, name, color, carrying_capacity): super().__init__(name, color) self.carrying_capacity = carrying_capacity # 输入...
Passenger: Here you are.** * **A. Can I have your ticket** * 正确答案。售票员向乘客索要车票。 * **B. Anything to declare** * 错误原因:这个问题通常用于海关检查时询问乘客是否有物品需要申报。 * **...
* table_passenger:passenger_id、passenger_name、passenger_tel、passenger_sex * table_ticket:fight_no、passenger_id、passenger_name、ticket_price、passenger_seat 3. 插入数据:使用INSERT INTO语句将...
这是一个用于部署Ruby on Rails应用程序、通过Haproxy和Phusion Passenger进行滚动升级的Haproxy 。 目前它假设您正在使用: CentOS 代理 Phusion 乘客独立 虚拟机 去做 工人搬运 Ubuntu 兼容性。 添加测试。 ...
苏比洛:passenger_ship:部署自动化代理Subilo 是一种工具,用于为在没有外部集成的机器上运行的应用程序设置持续部署,例如物联网设备和 VPS。这个怎么运作Subilo 代理是一个小型服务器,它驻留在应用程序的机器上并...
car_options #=> ["Fog Lights", "Airbag: Driver", "Power Windows", "Airbag: Passenger", "Rear Window Defroster", "Power Steering", "Tow Package", "Moonroof/Sunroof"]Faker :: Vehicle . car_type #=> ...
and t.table_name = 'F_PASSENGER_STOP' group by table_owner, table_name) b where a.table_owner = b.table_owner and a.table_name = b.table_name and a.partition_position = b.part_posi) loop v_part_...
FlowNav FlowNav是适用于Android的移动库,可帮助并提供一种更好的进行多模块导航的方法。 该库的主要目的是在您的项目具有多个模块且需要从一个功能导航到另一个功能而又不增加它们之间的依赖性的情况下提供帮助。...
完整的 Rails 托管堆栈包括: 用户、homedir 和链接到 vhost 文件夹/var/www/vhosts//rails with shared/config/database.yml Apache +Passenger 和配置来托管给定的虚拟主机。依赖关系该模块假设您已经使用 ...
$ det http://domain.tld[{ ' name ' : ' phusion-passenger ' , ' version ' : ' 4.0.10 ' }, { ' name ' : ' apache-mod_bwlimited ' , ' version ' : ' 1.4 ' }, { ' name ' : ' apache-mod_fcgid ' , ' version...
12306抢下铺代码<select name="passenger_1_seat_detail_select" style="display: block" id="passenger_1_seat_detail_select" onchange="setSeatDetail('1')"> 随机</option> 上铺</option> 中铺</option>...
### Ruby on Rails 环境搭建与 Passenger+Nginx 配置详解 #### 一、Ruby on Rails 开发环境搭建 在进行 Ruby on Rails 的开发之前,首先需要完成一系列的基础软件安装工作,包括但不限于 Ruby 语言环境、Rails ...
circuit要做的电路find_stages要做的电路prix_circuit返回针对特定电路要执行的read_step电路的价格电路的保留:Addition_reservation完成Addition_Group完成Identification_Passenger完成将乘客添加到数据库中预订...
电话簿 使用Angular,Express,MongoDB的电话簿示例。 配置 ... 快速开始: npm install && npm start Nginx乘客示例: server { listen 80 ;... server_name phone-book.ononos.tk;... passenger_env_va
passenger_enabled on; } ``` 注意,`passenger_ruby`的路径应指向你当前正在使用的Ruby版本。如果需要切换Rails版本,可以使用`rvm use 1.9.3@rails3`命令,然后再次确认`passenger_ruby`的正确路径,可以通过`...
check_passenger 该gem提供了Nagios检查命令,以监视正在运行的乘客进程及其使用的内存。 它可以在全局或每个应用程序的基础上报告数据,并在消耗量超过给定阈值时发出警告和警报。 安装 安装check_passenger的最...