VirtualHost 与乘客的问题 (mod_rails)

发布于 2024-10-09 06:16:51 字数 571 浏览 8 评论 0原文

我对虚拟主机已经束手无策了。我正在尝试安装 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

分开我的手 2024-10-16 06:16:51

我花了一段时间才让 Redmine 在 Passenger 下运行。这就是我的

安装乘客:

passenger-install-apache2-module

编辑 Apache 配置文件:

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11
PassengerRuby /usr/bin/ruby

在默认服务器中创建一个新目录:

<Directory>
/webserver_root/html/redmine
RailsBaseURI /redmine
AllowOverride all
Options -MultiViews
</Directory>

最后,创建一个指向 ruby​​ 应用程序所在物理目录的链接(即不在 /html 或您为大多数 Apache 页面提供服务的任何目录下)这必须是 redmine 的公共子目录的链接)

ln -s /webserver_root/ruby_apps/redmine/public /webserver_root/html/redmine

因此 Apache 现在尝试正常显示所有公共页面,但所有其他页面都通过乘客路由。您可以将其作为子文件夹访问 - 例如。 http://mywebserver/redmine

It took me a while to get Redmine running under Passenger. This is what I have

Install passenger:

passenger-install-apache2-module

Edit Apache confg file:

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11
PassengerRuby /usr/bin/ruby

Create a new directory in the default server:

<Directory>
/webserver_root/html/redmine
RailsBaseURI /redmine
AllowOverride all
Options -MultiViews
</Directory>

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)

ln -s /webserver_root/ruby_apps/redmine/public /webserver_root/html/redmine

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

终难遇 2024-10-16 06:16:51

您的 VirtualHost *:80 指令必须与配置中之前相应的 NameVirtualHost *:80 相匹配。

您可以使用 -S 开关询问 apache 它对您的虚拟主机有何作用。当然,服务器二进制文件的名称在某种程度上取决于它的安装方式以及什么操作系统/发行版

Your VirtualHost *:80 directive must be matched by a corresponding NameVirtualHost *: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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文