问题描述
限时送ChatGPT账号..可能是一个简单的调整问题,但我不知道出了什么问题.
probably a matter of simple adjustment but I have no idea whats going wrong.
我想要一个主机作为我的 rails 应用程序的服务器,该应用程序是使用 Capistrano 3.2.1 部署的.这是一台运行 Apache/2.2.15 的 Unix 机器,名为 eng-perf(公司内部机器,因此目前没有 www.address 语法).
I want a host to be a server for my rails application, which was deployed using Capistrano 3.2.1. This is a Unix machine running Apache/2.2.15, named eng-perf (corporate internal machine, so no www.address syntax at the moment).
我按照本指南进行了整个安装过程没有任何麻烦.我编辑了配置文件,使其看起来像这样:
I followed this guide and the entire installation process went without any trouble. I edited the configuration file so that it looks like this:
<VirtualHost *:80>
ServerName eng-perf
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /var/www/eng_performance/current/public/
<Directory /var/www/eng-performance/current/public/>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
#Require all granted
</Directory>
</VirtualHost>
这给了我这个错误:
未找到
在此服务器上找不到请求的 URL/.
The requested URL / was not found on this server.
接下来,我尝试按照指南创建虚拟应用程序 - as在这里解释,并将配置文件更改为:
Next, I tried following the guide by creating the dummies application- as explained here, and changed the configuration file to be:
<VirtualHost *:80>
ServerName eng-perf
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /var/www/rack_example/public/
<Directory /var/www/rack_exmaple/public/>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
#Require all granted
</Directory>
</VirtualHost>
这导致了完全相同的 Not Found 错误.所以,我想我错过了一些非常简单的东西..
That resulted the exact same Not Found error. So, I guess I'm missing something quite simple..
另外,我尝试重启apache服务器,提示:httpd:无法可靠地确定服务器的完全限定域名,使用.machine.ip.addr作为ServerName
因此,我将 ServerName
字段更改为该地址 - 但这也不起作用.
Also, I tried to restart the apache server and prompted: httpd: Could not reliably determine the server's fully qualified domain name, using the.machine.ip.addr for ServerName
As a result I changed the ServerName
field to be this address- but that didn't work either.
更新:
按照 Rich 的建议,我更新了配置文件,所以现在我得到了这个输出:
Following Rich's advise, I updated the configuration file so now I get this output:
config.ru:2: syntax error, unexpected tIDENTIFIER, expecting =>
... [200, { "Content-Type => "text/html" }, ["hello <b>world</b...
... ^
config.ru:2: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
... { "Content-Type => "text/html" }, ["hello <b>world</b>"]]
... ^
config.ru:2: syntax error, unexpected tIDENTIFIER, expecting keyword_end
...-Type => "text/html" }, ["hello <b>world</b>"]]
... ^
config.ru:2: unterminated regexp meets end of file
config.ru:2: syntax error, unexpected end-of-input, expecting keyword_end
)}.to_app
^ (SyntaxError)
/home/deploy/.rvm/gems/ruby-2.0.0-p481/gems/passenger-4.0.50/helper-scripts/rack-preloader.rb:112:in `eval'
/home/deploy/.rvm/gems/ruby-2.0.0-p481/gems/passenger-4.0.50/helper-scripts/rack-preloader.rb:112:in `preload_app'
/home/deploy/.rvm/gems/ruby-2.0.0-p481/gems/passenger-4.0.50/helper-scripts/rack-preloader.rb:158:in `<module:App>'
/home/deploy/.rvm/gems/ruby-2.0.0-p481/gems/passenger-4.0.50/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/home/deploy/.rvm/gems/ruby-2.0.0-p481/gems/passenger-4.0.50/helper-scripts/rack-preloader.rb:28:in `<main>'
推荐答案
我们使用以下内容:
#etc/apache2/apache2.conf
<VirtualHost *:80>
ServerName eng-perf
DocumentRoot /var/www/rack_example/plublic
<Directory /var/www/rack_example/public>
Allow from all
Options -MultiViews
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
我怀疑问题在于您没有正确调用您的域.它会混淆它在请求中寻找的内容
I suspect the problem lies with your not calling your domain correctly. It's going to get confused about what it's looking for on the request
这篇关于使用 Apache2 和Passenger 部署Rails 应用程序时出现404 Not found 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论