gpt4 book ai didi

ruby-on-rails - apache + passenger 只是在公共(public)目录中列出文件

转载 作者:太空宇宙 更新时间:2023-11-03 17:22:05 25 4
gpt4 key购买 nike

<VirtualHost *:80>
# ... server name/aliases and such.

DocumentRoot /var/www/html
RackEnv staging
RackBaseURI /extapp/forms

<Directory /var/www/html/extapp/forms>
Options -MultiViews
PassengerRuby /home/pstn/.rbenv/versions/2.1.2/bin/ruby
</Directory>

</VirtualHost>

/var/www/html/extapp/forms 是链接到 Rails 4 应用程序的 public 文件夹的符号链接(symbolic link),目录树的所有权限都是正确的(右+右)。

乘客靴,根据日志中的条目:

[ 2014-09-08 14:07:17.5896 21559/7f8d77305720 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!

但是,当我访问适当的路径时,我得到的只是驻留在 public 文件夹中的文件的目录列表(即 robots.txt 等)

最佳答案

试试这个

<Directory /var/www/html/extapp/forms>
Options -MultiViews
PassengerRuby /home/posten/.rbenv/versions/2.1.2/bin/ruby
PassengerResolveSymlinksInDocumentRoot on
</Directory>

然后重启服务器。

我的服务器配置是

<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerName mysite
RailsEnv development
DocumentRoot /var/www/mysite/public
<Directory /var/www/mysite/public>
Allow from all
Options -MultiViews
PassengerResolveSymlinksInDocumentRoot on
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/ruby-error.log
CustomLog ${APACHE_LOG_DIR}/ruby-access.log combined

# For most configuration files from conf-available/, which are

</VirtualHost>

关于ruby-on-rails - apache + passenger 只是在公共(public)目录中列出文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25723983/

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