VirtualHost 与乘客的问题 (mod_rails)
我对虚拟主机已经束手无策了。我正在尝试安装 redmine,它可以与 webrick 测试服务器配合使用,但是当我尝试使用乘客(mod_rails)来托管并转到我在 apache 配置文件的虚拟主机部分中指定的地址时,没有任何反应。这是 /etc/httpd/conf/httpd.conf 的相关部分,我在其中尝试设置虚拟主机:
<VirtualHost *:80>
SetEnv RAILS_ENV production
ServerName redmine.MYSITE.com:80
DocumentRoot /opt/redmine-1.0.5/public/
<Directory /opt/redmine-1.0.5/public/>
Options -MultiViews
Allow from all
AllowOverride none
</Directory>
然而,当我访问 redmine.MYSITE.com:80 时,没有任何反应,我只是得到了正常的主页。我不知道问题是什么,任何帮助我们的指导将不胜感激。如果您需要任何其他信息,请告诉我,我会提供。
I'm at my wit's end here with virtual hosting. I'm trying to install redmine and it works with the webrick test server, but when I tried to use passenger (mod_rails) to host and go to the address I specified when in the virtualhost part of my apache config file nothing happens. Here is the relavent section of /etc/httpd/conf/httpd.conf where I try to set up the virtual host:
<VirtualHost *:80>
SetEnv RAILS_ENV production
ServerName redmine.MYSITE.com:80
DocumentRoot /opt/redmine-1.0.5/public/
<Directory /opt/redmine-1.0.5/public/>
Options -MultiViews
Allow from all
AllowOverride none
</Directory>
However, when I got to redmine.MYSITE.com:80 nothing happens, I just get our normal home page. I have no idea what the problem is, any help our guidance would be greatly appreciated. If you need any other information, please tell me and I'll provide it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我花了一段时间才让 Redmine 在 Passenger 下运行。这就是我的
安装乘客:
编辑 Apache 配置文件:
在默认服务器中创建一个新目录:
最后,创建一个指向 ruby 应用程序所在物理目录的链接(即不在 /html 或您为大多数 Apache 页面提供服务的任何目录下)这必须是 redmine 的公共子目录的链接)
因此 Apache 现在尝试正常显示所有公共页面,但所有其他页面都通过乘客路由。您可以将其作为子文件夹访问 - 例如。 http://mywebserver/redmine
It took me a while to get Redmine running under Passenger. This is what I have
Install passenger:
Edit Apache confg file:
Create a new directory in the default server:
Lastly, make a link to the physical directory where your ruby apps live (ie NOT under /html or whatever directory you serve most Apache pages from. This MUST be a link to redmine's public subdirectory)
So Apache now tries to show all the public pages as normal, but all other pages get routed through passenger. You access it as a subfolder - eg. http://mywebserver/redmine
您的
VirtualHost *:80
指令必须与配置中之前相应的NameVirtualHost *:80
相匹配。您可以使用
-S
开关询问 apache 它对您的虚拟主机有何作用。当然,服务器二进制文件的名称在某种程度上取决于它的安装方式以及什么操作系统/发行版。Your
VirtualHost *:80
directive must be matched by a correspondingNameVirtualHost *:80
earlier in your config.You can ask apache what it makes of your vhosts with the
-S
switch. Of course, the name of your server binary depends somewhat on how it was installed and on what OS/Distro.