Linux Deploy Rails3 with Ruby1.9.2 (4) Configure the rails in Apache2

Linux Deploy Rails3 with Ruby1.9.2 (4) Configure the rails in Apache2

Change the configuration of apache2
> Vi httpd.conf
LoadModule passenger_module / home/luohua/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9/gems/passenger-3.0.8/ext/apache2/mod_passenger.so
PassengerRoot / home/luohua/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9/gems/passenger-3.0.8
PassengerRuby / home/luohua/.rvm/rubies/ruby-1.9.2-p290

try to restart the apache server
> Bin / apachel restart

error messages:
httpd: Syntax error on line 423 of / opt / tools / httpd / conf / httpd.conf: API module structure 'passenger_module' in file / home/luohua/.rvm/rubies/ruby-1.9.2-p290/lib/ruby / gems/1.9/gems/passenger-3.0.8/ext/apache2/mod_passenger.so is garbled - expected signature 41503232 but saw 41503230 - perhaps this is not an Apache module DSO, or was compiled for a different Apache version?

solutions:
That is because I have 2 version of apache2 on my server. I will use the one who compiled passenger.
The compile passenger information:
* Apache 2 ... found at / usr / bin / httpd
* Apache 2 development headers ... found at / usr / sbin / apxs
* Apache Portable Runtime (APR) development headers ... found at / usr / bin / apr-config
* Apache Portable Runtime Utility (APU) development headers ... found at / usr / bin / apu-config

> Sudo mv / usr / sbin / httpd / usr / sbin / httpd.bak
> Sudo ln-s / opt / tools / httpd / bin / httpd / usr / bin / httpd
> Sudo mv / usr / sbin / apxs / usr / sbin / apxs.bak
> Sudo ln-s / opt / tools / httpd / bin / apxs / usr / sbin / apxs

find the version of apache
> Bin / apachectl-V | grep SERVER_CONFIG_FILE

located the APXS2
> Export APXS2 = / opt / tools / httpd / bin / apxs

try to restart the apache again
> Bin / apachel restart

error message:
[Wed Aug 31 14:47:23 2011] [notice] SIGHUP received. Attempting to restart
*** Passenger ERROR (ext / common / ApplicationPool / .. / SpawnManager.h: 220):
Could not start the spawn server: / home/luohua/.rvm/rubies/ruby-1.9.2-p290: Permission denied (13)
[Pid = 14425 thr = 3086257024 file = ext/apache2/HelperAgent.cpp: 354 time = 2011-08-31 14:47:23.906]: Could not start the spawn server: write () failed: Broken pipe (32)
in 'Passenger:: SpawnManager:: SpawnManager (const std:: string &, const boost:: shared_ptr <Passenger::ServerInstanceDir::Generation> &, const Passenger:: AccountsDatabasePtr &, const std:: string &, const Passenger:: AnalyticsLoggerPtr &, int, const std:: string &) '(SpawnManager.h: 540)
in 'Passenger:: ApplicationPool:: Pool:: Pool (const std:: string &, const boost:: shared_ptr <Passenger::ServerInstanceDir::Generation> &, const Passenger:: AccountsDatabasePtr &, const std:: string &, const Passenger: : AnalyticsLoggerPtr &, int, const std:: string &) '(Pool.h: 1078)
in 'Server:: Server (Passenger:: FileDescriptor, pid_t, const std:: string &, bool, const std:: string &, const std:: string &, const std:: string &, const std:: string &, unsigned int, unsigned int, unsigned int, unsigned int, const Passenger:: VariantMap &) '(HelperAgent.cpp: 241)
in 'int main (int, char **)' (HelperAgent.cpp: 344)
[Wed Aug 31 14:47:23 2011] [error] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger watchdog because it encountered the following error during startup: Unable to start the Phusion Passenger helper agent: it seems to have crashed during startup for an unknown reason, with exit code 1
[Wed Aug 31 14:47:23 2011] [notice] Apache/2.2.19 (Unix) Phusion_Passenger/3.0.8 configured - resuming normal operations

solutions:
> Sudo chmod a + x-R / home/luohua/.rvm/rubies/ruby-1.9.2-p290
or
> Sudo chmod 777-R / home/luohua/.rvm/rubies/ruby-1.9.2-p290

add this to my httpd.conf
PassengerRuby / usr / bin / ruby
PassengerDefaultUser root

link the ruby ​​to / usr / bin
> Sudo ln-s ~ / .rvm/rubies/ruby-1.9.2-p290/bin/ruby / usr / bin / ruby

Add one more Virtual host and visit our rails application
<VirtualHost *:80>
ServerName www.sillycat.com
DocumentRoot / opt / work / projectname / public
<Directory /opt/work/projectname/public>
Allow from all
Options-MultiViews
</ Directory>
</ VirtualHost>

I comments the following lines in httpd.conf:
# <Directory />
# Options FollowSymLinks
# AllowOverride None
# Order deny, allow
# Deny from all
# </ Directory>

After all these done, I can visit http://www.sillycat.com and get the pages.

That is not good way for rails, because I have some other applications on apache, and I do not want this application take the ROOT
content path.

So I will make all the static things in htdoc directory / opt / tools / httpd / htdocs
<VirtualHost *:80>
ServerName ud1129.chinaw3.com
DocumentRoot / opt / tools / httpd / htdocs
<Directory /opt/tools/httpd/htdocs>
Allow from all
</ Directory>
</ VirtualHost>

link my project to the htdocs directory
> Sudo ln-s / opt / work / projectname / public / opt / tools / httpd / htdocs / projectname

<VirtualHost *:80>
ServerName ud1129.chinaw3.com
DocumentRoot / opt / tools / httpd / htdocs
<Directory /opt/tools/httpd/htdocs>
Allow from all
</ Directory>

RailsBaseURI / projectname
<Directory /opt/tools/httpd/htdocs/projectname>
Options-MultiViews
</ Directory>
</ VirtualHost>

Tips: In this way, wa can make multi rails applications.
<VirtualHost *:80>
....
RailsBaseURI / app1
RailsBaseURI / app2
RailsBaseURI / app3
</ VirtualHost>

copy all the static things to htdocs / asset directory
> Sudo cp / opt / work / projectname / app / assets / images / opt / tools / httpd / htdocs / assets
> Sudo cp / opt / work / projectname / app / assets / javascripts / opt / tools / httpd / htdocs / assets
> Sudo cp / opt / work / projectname / app / assets / stylesheets / opt / tools / httpd / htdocs / assets

Ok, done, visit http://www.sillycat.com/projectname

references:
http://serdaryildirim.net/ruby-on-rails/installing-passenger.html
http://stackoverflow.com/questions/4946426/getting-rails-3-and-passenger-to-work-on-centos-5-4-apache-error
http://www.modrails.com/documentation/Users% 20guide% 20Apache.html

分类:OS 时间:2011-09-03 人气:136
分享到:
blog comments powered by Disqus

相关文章

  • Hibernate + Spring error message and processing development 2010-09-09

    Error message: log4j: WARN No appenders could be found for logger Solution: Copy of the log4j.properties into the file of the src and bin directory project Error message: org.hibernate.hql.ast.QuerySyntaxException: is not mapped Solution: There are t

  • Modify the php.ini in order to achieve an error message screen 2011-09-04

    That is because the error display turned off in php.ini, the error written in the document, which is the result of artificial, display_errors = on just fine. But down security points without an error, the proposed debugging turned on, then turn off t

  • Apache will not start, error message: No space left on device ...... 2010-04-24

    Error message: [Wed Mar 11 15:57:46 2009] [crit] (28) No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed [Wed Mar 11 15:59:22 2009] [notice] suEXEC mechanism enabled (wrapper: / usr / sbin / suexec) [Wed Mar ...

  • ROR function deployment process using debug error message appears when a large number of 2010-05-11

    Developed on rails in windows application, then all the way to unix on. Installation of rails in the environment when the reference robbin manner, almost no major problems. But the deployment of a problem after the operation: whether using mongrel or ...

  • Installing starling with Gem install error ERROR: http://gems.rubyforge.org/ does not appear to be a rep 2011-06-08

    starling is a ruby ​​to write open source message queue server, concrete, and installation can be found: http://www.ooso.net/archives/506 Today is a time of server installation starling the following exception. Simply the next solution. Executive gem

  • ORACLE query appears "Ora-01791 is not a Selected Expression" error message solution (reprint) 2010-03-09

    Even writing a sales query function module, but when tested by bar code / code / sort the Treasury when the conditions are not wrong, just press the date when the investigation would have "Ora-01791 is not a Selected Expression" error messa ...

  • hibernate + mysql + ecliple first run error message 2010-04-07

    UserInfo class: UserInfo.hbm.xml information: HibernateTest main categories of information: Hibbernate.cfg.xml configuration XML mapping information: Run error message: log4j: WARN No appenders could be found for logger (org.hibernate.cfg.Environment ...

  • Action to remove the residual Struts2 validation error message 2010-04-29

    Recently wrote a category management page, the category list and add the classification of the form placed in a page, and Action in the same set list () and add () methods are responsible for the classification list and add on Add Category The action ...

  • DB2 Error Message Summary 2010-06-01

    SQLCODE SQLSTATE Help 000 00000 SQL statement completed successfully 01xxx SQL statement completed successfully, but warning +012 01 545 columns were not qualified to be interpreted as a reference to the relationship between +098 01 568 dynamic SQL statem

  • ORACLE error message 2010-06-12

    00000,0, " Normal, complete success " 00001,0, " There are duplicate key index " 00017,0, " Request for a dialogue to set up accident " 00018,0, " Exceed the maximum number of sessions " 00019,0, " Exceed the maximum permitted number of dialogue " 00020,0

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.253 (s). 14 q(s)