简体   繁体   中英

VirtualHost problem with passenger (mod_rails)

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.

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM