Phusion Passenger Sub URI 符号链接问题
我正在 Ubuntu 上使用 Apache 和 Phusion Passenger 部署一个子 URI Rails 应用程序,但
www.mydomain.com/suburi
在配置它时遇到了问题。现在我收到此错误:
Passenger Error #2
An error occurred while trying to access '/srv/www/mydomain/public/suburi': Cannot resolve possible symlink '/srv/www/mydomain/public/suburi': No such file or directory (2)
mydomain.com 的 Rails 应用程序和 mydomain.com/suburi 的 Rails 应用程序都驻留在 /srv/www/
我当前的虚拟主机如下所示:
<VirtualHost 173.230.137.212:80>
ServerName www.mydomain.com
ServerAlias mydomain.com
DocumentRoot /srv/www/mydomain/public
ErrorLog /srv/www/error.log
RewriteEngine On
RewriteOptions Inherit
RailsEnv production
<directory /srv/www/mydomain/public>
Options Indexes FollowSymLinks -MultiViews
AllowOverride all
Order allow,deny
allow from all
</directory>
RailsBaseURI /suburi
<Directory /srv/www/suburi>
Options -MultiViews
</Directory>
我知道路径是正确的,但这是我唯一知道是正确的。我的服务器管理技能并不惊人。
我创建了从 mydomain.com 的公共文件夹到子 uri 的公共文件夹的符号链接。不确定我是否做对了,我发现文档不是那么好。我有什么遗漏和/或做错了什么吗?我是否创建了错误的系统链接?
我真的很感激一些帮助。
或者就此而言,如果有人知道更好/更简单的方法来使用子域(例如 subdomain.mywebsite.com)也可以。
谢谢
I am deploying a sub URI rails app on Ubuntu with Apache and Phusion Passenger to
www.mydomain.com/suburi
and am having issues with getting it configured. Right now I am getting this error:
Passenger Error #2
An error occurred while trying to access '/srv/www/mydomain/public/suburi': Cannot resolve possible symlink '/srv/www/mydomain/public/suburi': No such file or directory (2)
Both the rails app for mydomain.com and the rails app for mydomain.com/suburi reside in /srv/www/
My current virtual Host looks like this:
<VirtualHost 173.230.137.212:80>
ServerName www.mydomain.com
ServerAlias mydomain.com
DocumentRoot /srv/www/mydomain/public
ErrorLog /srv/www/error.log
RewriteEngine On
RewriteOptions Inherit
RailsEnv production
<directory /srv/www/mydomain/public>
Options Indexes FollowSymLinks -MultiViews
AllowOverride all
Order allow,deny
allow from all
</directory>
RailsBaseURI /suburi
<Directory /srv/www/suburi>
Options -MultiViews
</Directory>
I know the paths are correct, but that's the only thing I know is correct. My server administration skills are not amazing.
I made a sym link from the mydomain.com's public folder to the sub uri's public folder. Not sure if I did this right, I found the documentation to not be so great. Is there anything I'm missing and/or doing wrong? Did I make the wrong system link?
I would really appreciate some help.
Or for that matter, if anyone knows a better/easier way to do it with a sub domain, like subdomain.mywebsite.com that would work too.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 suburi-s,则
/
意味着指向 Rails 应用程序的公共目录,如果你有一个专门的公共文档根目录为你的域,那么这两个问题都可以解决,然后你做的
文档确实不是那么好。所以你的解决方案是:
vhost conf:
你说: mydomain.com 的 Rails 应用程序和 mydomain.com/suburi 的 Rails 应用程序都驻留在 /srv/www/
这让我有点困惑,我不知道我认为在一个域上运行一个应用程序,在一个 suburi 上运行另一个应用程序是个好主意,因为路由肯定会很混乱。
而是使用 2 个 suburi-s,在这种情况下,执行
/srv/www/suburi2 是您的第二个应用程序根目录的操作,并添加:
您可以将任意数量的 suburi 添加到同一虚拟主机。
希望这有帮助
If you use suburi-s, then
<documentroot>/<suburi>
is meant to point to the public dir of your rails appBoth are solved if you got a dedicated public docroot for your domain, and then you do
The documentation is indeed not so great. So your solution would be:
and the vhost conf:
you say that: Both the rails app for mydomain.com and the rails app for mydomain.com/suburi reside in /srv/www/
This confused me a bit, I don't think it is a good idea to want to run an app on a domain and another on a suburi, since routing is bound to be confused.
Rather use 2 suburi-s, in which case do
where /srv/www/suburi2 is your second applications root dir, and add:
you can add any number of suburis to the same vhost.
hope this helped