乘坐 404 路客运和铁路
我正在尝试在共享主机上运行 Rails 应用程序。 我在目录 /home/rails_projects/jens_blog 中创建应用程序,文档根目录为 /home/www/jens_blog。
在 /home/www/jens_blog 目录中是一个符号链接 public -> /home/rails_projects/jens_blog/public/ 我创建了一个脚手架帖子。但是当我在浏览器中运行 mydomain/ 或 mydomain/posts 时,我总是收到 404 错误。 文件不存在:/home/www/jens_blog/public/posts
<VirtualHost ip.port>
ServerName www.mydomain.de
ServerAdmin [email protected]
DocumentRoot /home/www/jens_blog/public
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7
PassengerRuby /usr/bin/ruby
PassengerDefaultUser myuser
PassengerAnalyticsLogUser myuser
CustomLog /home/log/access_log mesos2
<Directory "/home/www/jens_blog/public">
Allow from all
Options -MultiViews
Options FollowSymLinks
</Directory>
</VirtualHost>
如果我将 index.php 文件放入 /home/rails_projects/jens_blog/public/ 目录,则会显示文件内容。 有人可以帮助我吗?我很绝望。 我只有一个共享虚拟主机。
更新:我将“PassengerResolveSymlinksInDocumentRoot on”添加到 apache 配置中。但现在我在 PhusionPassenger::Rack::ApplicationSpawner 中遇到异常 LoadError (没有要加载的文件 - 捆绑程序) :-((
干杯 延斯
I'm trying to run a rails app on a shared hoster.
I create the app in the directory /home/rails_projects/jens_blog and the document root is /home/www/jens_blog.
In the /home/www/jens_blog dir is a symlink public -> /home/rails_projects/jens_blog/public/
I created a scaffold posts. But when i run the mydomain/ or mydomain/posts in the browser I get always an 404 error.
File does not exist: /home/www/jens_blog/public/posts
<VirtualHost ip.port>
ServerName www.mydomain.de
ServerAdmin [email protected]
DocumentRoot /home/www/jens_blog/public
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7
PassengerRuby /usr/bin/ruby
PassengerDefaultUser myuser
PassengerAnalyticsLogUser myuser
CustomLog /home/log/access_log mesos2
<Directory "/home/www/jens_blog/public">
Allow from all
Options -MultiViews
Options FollowSymLinks
</Directory>
</VirtualHost>
if I put a index.php file into the /home/rails_projects/jens_blog/public/ dir the file content will be show.
Can anybody help me?? I am desperated.
I have only a shared web hosting.
Update: I added "PassengerResolveSymlinksInDocumentRoot on" to the apache config. But now I get Exception LoadError in PhusionPassenger::Rack::ApplicationSpawner (no such file to load -- bundler)
:-((
Cheers
Jens
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的问题与您的问题非常相似 使用 capistrano 在 ec2 上部署了 Rails 站点,但它没有显示在浏览器上,这里是站点 -> http://passionate4.net/
我想说将您的网站放在这个目录/var/www/myapp/public 中。
使用这些设置。
ServerName www.passionate4.net
DocumentRoot /var/www/capi_app/current/public
RailsEnv production
允许所有
选项 -MultiViews
我已经写了几篇关于如何在 Ubuntu 上成功部署站点的博客。我相信你的问题和我的很相似。 http://recipe4developer.wordpress.com/
My question was quite similar to yours Deployed rails site on ec2 using capistrano, but it doesn't show up on the browser, here is the site -> http://passionate4.net/
I would say place your site in this directory /var/www/myapp/public.
Use these settings.
ServerName www.passionate4.net
DocumentRoot /var/www/capi_app/current/public
RailsEnv production
Allow from all
Options -MultiViews
I have written couple of blogs on how to successfully deploy the site on Ubuntu. I believe you problem is quite similar to mine. http://recipe4developer.wordpress.com/