- 浏览: 2542517 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
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
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
发表评论
-
Docker(4)Docker on Raspberry
2015-07-15 13:25 1098Docker(4)Docker on Raspberry I ... -
VirtualBox Network
2015-06-10 11:48 774VirtualBox Network Last one ye ... -
Debian System(1)Java and NodeJS Env
2015-03-29 06:27 1026Debian System(1)Java and NodeJS ... -
VirtualBox Importing OVA
2014-05-14 03:35 1222VirtualBox Importing OVAJust im ... -
Data Import Process
2012-09-05 11:21 1254Data Import Process 1. prepare ... -
Artifactory on Linux(1)
2011-12-13 22:41 1382Artifactory on Linux(1) Downlo ... -
Hudson/Jenkins Installation on Redhat4
2011-12-13 22:40 1350Hudson/Jenkins Installation on ... -
Archiva In Linux(1)
2011-12-13 13:56 1574Archiva In Linux(1) 1. install ... -
kingate(1)Install on redhat4
2011-11-02 23:02 1344kingate(1)Install on redhat4 1 ... -
JBOSS Performance Tuning
2011-09-22 16:20 1824JBOSS Performance Tuning 2. JV ... -
Linux Deploy Rails3 with Ruby1.9.2(5)Fix the Error Messages
2011-09-03 11:12 750Linux Deploy Rails3 with Ruby1. ... -
Yum Problem after Python Upgrade
2011-08-23 17:09 4122Yum Problem after Python Upgrad ... -
Linux Deploy Rails3 with Ruby1.9.2(3)
2011-08-23 14:27 2205Linux Deploy Rails3 with Ruby1. ... -
Linux Deploy Rails3 with Ruby1.9.2(2)
2011-08-21 17:00 1669Linux Deploy Rails3 with Ruby1. ... -
Deploy Rails with Ruby1.9.2 on Redhat4(1)
2011-08-21 10:37 2213Deploy Rails with Ruby1.9.2 on ... -
Yum on Linux System
2011-08-20 14:00 1241Yum on Linux System download t ... -
Understand the Linux Version
2011-08-20 10:35 1426Understand the Linux Version 1 ... -
Linux Commands(I) scp
2011-06-21 23:54 1266Linux Commands(I) scp 1. scp i ... -
Linux Server Deployment(II)apache and SSH-CVS
2011-06-08 22:04 1611Linux Server Deployment(II)apac ... -
Linux Server Deployment(I)cvs and iptables
2011-06-08 22:03 1698Linux Server Deployment(I)cvs a ...
相关推荐
安卓平台虚拟机,最新版下载地址:...linuxdeploy-2.6.0-259.apk 为目前最新版(2020-02-01更新),最低支持Android 5.0。Android 4.4 支持版本:https://download.csdn.net/download/zhyjie100/12254490。
Linux Deploy是一款专为Android设备设计的应用程序,它允许用户在Android设备上部署并运行Linux发行版,无需root权限。这个工具对于开发者、系统管理员或对Linux感兴趣的用户来说,是一个非常实用的工具,因为它使得...
linuxdeploy
Ruby on Rails (often shortened as Rails) is a server-side web application framework written in Ruby under the MIT License. It uses Model-View-Controller (MVC) architecture and emphasizes convention ...
Applications of the new system are run in a chroot environment and working together with the Android platform. All changes made on the device are reversible, i.e. the application and components can ...
Linuxdeploy是Linux系统中用于构建AppImage的工具,它能够帮助开发者将应用程序及其依赖打包成一个可执行的文件,使得用户无需安装即可运行。这里提到的`linuxdeploy-2.5.1-257.apk`和`linuxdeploy-2.6.0-259.apk`...
linux下的程序,打包为.AppImage
可用于手机安装Linux环境 供无法使用Play商店小伙伴下载
【Linux Deploy 安装与使用详解】 Linux Deploy是一款在Android设备上部署Linux系统的应用程序,它允许用户在手机或平板电脑上运行Linux发行版,如CentOS7。在32位的Linux系统上安装宝塔面板,可以实现轻量级的...
2. **安装依赖**:在Android设备上运行Linuxdeploy可能需要一些额外的工具,如Termux——一个Android上的终端模拟器和Linux环境。Termux提供了包管理器,用于安装像bash、wget、curl等命令行工具,这些都是安装Linux...
Android-linuxdeploy.zip,在android上安装并运行gnu/linux,安卓系统是谷歌在2008年设计和制造的。操作系统主要写在爪哇,C和C 的核心组件。它是在linux内核之上构建的,具有安全性优势。
Rails 经典开发参考书, Ruby on rails 系近年来在西方日渐盛行的一套网页开发工具,其高度集成化时开发时间大大缩短.
based guide, where each chapter focuses on the complete implementation of a real-world scenario, the commonly occurring challenges in each scenario has also discussed, along with tips and tricks and ...
install-linuxdeploy-action 在Github Actions工作流程上安装LinuxDeploy的操作。 请参阅LinuxDeploy主页上的linuxdeploy实用程序详细信息。 该操作可以处理LinuxDeploy的插件。 您可以指定插件和要安装的目标目录...
标题 "rails web server deploy guide" 暗示了本文将关注如何部署Rails应用程序到Web服务器。Rails是Ruby on Rails的简称,是一个流行的开源Web开发框架,用于构建动态、数据驱动的网站。部署Rails应用通常涉及将...
1.2020年6月4日09:27:41 积分调整1 ...linuxdeploy2.02-223.备份的离线镜像。可直接导入 kali-armhf aarch64 这个好像是32位的 如果需要安装jdk,直达https://download.csdn.net/download/zl20110000/11173517
This book is for beginning programmers, programmers new to Ruby, and web developers interested in learning and knowing the foundations of the Ruby programming language. Table of Contents Part 1: ...
描述中提到,这个JDK可以用于"linuxdeploy"工具,这是一个用于构建和部署Linux应用程序容器的工具,特别适合于在aarch64架构的ARM设备上,比如手机。"已验证centos7 aarch64可用"意味着这个JDK已经在CentOS 7的64位...