gpt4 book ai didi

ruby-on-rails-3 - 在 centos 5.8 上为我的 rails 应用程序设置 Apache+passenger

转载 作者:行者123 更新时间:2023-12-04 19:38:57 24 4
gpt4 key购买 nike

我正在为我的 cent OS 服务器 5.8 上的 rails 应用程序设置虚拟主机而苦苦挣扎。
我已经安装了 apache,即 httpd。

然后使用 gem install passneger 安装 Passeneger .

安装工作正常。

然后使用 passenger-install-apache2-module 为乘客安装 apache 模块命令。

然后编辑/etc/httpd/conf/httpd.conf并添加以下行来设置我的虚拟主机

LoadModule passenger_module /usr/local/rvm/gems/ruby-1.8.7-p160/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-1.8.7-p160/gems/passenger-3.0.17
PassengerRuby /usr/local/rvm/wrappers/ruby-1.8.7-p160/ruby

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
RailsEnv development
DocumentRoot /var/www/college/public
ServerName dummy-host.example.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common

<directory /var/www/college/public>
AllowOverride all
Options -MultiViews
</directory>

</VirtualHost>

使用 # chown -R apache.apache * 将项目的所有者更改为 apache命令

现在我在我的应用程序“学院”中为“学生”创建了一个脚手架。
但是 public/index显示 rails environment details 的页面也不是 student 的索引页模型工作。请指导我究竟出了什么问题,因为我是这些服务器配置的新手。谢谢!

更新:
我从公共(public)目录中删除了索引页面并使用 home 方法创建了一个 Controller 页面。然后我设置了 root :to => 'pages#home'

现在当我查看 dummy-host.example.com-error_log 的日志时表明
Directory index forbidden by Options directive: /var/www/college/public/

当我从 /var/log/httpd/error_log 跟踪日志时表明
[notice] caught SIGTERM, shutting down
[notice] SELinux policy enabled; httpd running as context root:system_r:httpd_t:s0
[notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[error] *** Passenger could not be initialized because of this error: Cannot create FIFO file /tmp/passenger.3469/.guard: Permission denied (13)
[warn] module passenger_module is already loaded, skipping
[notice] Digest: generating secret for digest authentication ...
[notice] Digest: done
[error] *** Passenger could not be initialized because of this error: Cannot create FIFO file /tmp/passenger.3471/.guard: Permission denied (13)
[notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations

现在有人请告诉我出了什么问题?

更新2
现在我遵循下面提到的答案。现在出现以下错误
[notice] SELinux policy enabled; httpd running as context root:system_r:httpd_t:s0
[notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[error] *** Passenger could not be initialized because of this error: The Passenger spawn server script, '/usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.15/lib/phusion_passenger/passenger-spawn-server', does not exist. Please check whether the 'PassengerRoot' option is specified correctly.
[warn] module passenger_module is already loaded, skipping
[notice] Digest: generating secret for digest authentication ...
[notice] Digest: done
[error] *** Passenger could not be initialized because of this error: The Passenger spawn server script, '/usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.15/lib/phusion_passenger/passenger-spawn-server', does not exist. Please check whether the 'PassengerRoot' option is specified correctly.
[notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations

现在我的乘客安装成功了,那是什么问题?

最佳答案

你看到这个帖子了吗https://stackoverflow.com/a/2429590/621354 ?

我是 ubuntu 用户,但您的“apache”用户不是“www-data”?

关于ruby-on-rails-3 - 在 centos 5.8 上为我的 rails 应用程序设置 Apache+passenger,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12384466/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com