Code Monkey home page Code Monkey logo

Comments (15)

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From ilborro on April 30, 2008 15:59:19

I forgot to add OS version:

borromeo@debian:/var/www/virtuals$ uname -a
Linux debian 2.6.18-6-686 #1 SMP Sun Feb 10 22:11:31 UTC 2008 i686 GNU/Linux

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From honglilai on May 01, 2008 00:57:28

Summary: Passenger incompatible with VirtualDocumentRoot
Labels: -Type-Defect Type-Enhancement

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From hansallis on May 29, 2008 12:51:10

First off a short disclaimer: I'm a total noob when it comes to RoR, so setting up a RoR-app for me means typing "rails guestbook" and that's it :) No scaffolding or even
database configuration.

After talking to Tinco and Ninh (at KoC) I decided to have a look at this very issue. After installing apache 2.2 and passenger, I've set up a few RoR-applications under
different accounts. Then I used mod_vhost_alias to map ie http://test1.local/ to a symlink, which in turn points to the public folder of one of those applications.

When browsing to http://test1.local/ I was greeted by the default index.html, but when visiting http://test1.local/test I got a default 404, instead of a rails message.
Also, no ruby processes were running.

I had a feeling that this might be caused by passenger not correctly detecting the presence of a rails app. This could, in turn, be caused by the fact that
mod_vhost_alias doesn't set (or change) the document root. To test this theory, I've patched my apache source with the patch in this thread: https://issues.apache.org/bugzilla/show_bug.cgi?id=26052 After this was done, instead of the apache 404, I got a rails message telling me that the page I was looking for does not exist. Checking the process list revealed two
ruby processes for the account I used to create the rails app. I'd like to believe that I can call this 'success'.

I've done some small tests to see what would happen if I'd point the symlink to another rails app. Or even a rails app under a different account. This all seems to work
perfectly.

All these tests were conducted on a FreeBSD 7-stable machine. I powered it off now, so I'm not sure which version of passenger I've used, but I just issued "gem install
passenger", so it should be today's current version.

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From honglilai on June 11, 2008 01:40:27

Labels: ConflictingModule

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From mvanholstyn on September 22, 2008 19:03:54

Is this a change that is going to be implemented in the near future? This would be really useful for dynamically
setting up staging environments.

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From fusiongyro on November 07, 2008 12:25:42

Like to submit another vote for this. It would save me a headache in my configuration
to have this feature working.

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From [email protected] on September 08, 2009 15:00:58

This is high on my list of requirements for sure.

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From joshbenner on October 03, 2009 08:11:23

Been a really long time for this issue not to receive much apparent attention.
mod_vhost_alias is important.

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From notexist on November 04, 2009 22:45:52

Is there any workaround for this case or just nobody need this feature?

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From joshbenner on November 05, 2009 04:43:51

I was not able to find a workaround, but I'm new to Ruby/Rails. In the PHP world, we
have issues with mod_vhost_alias and how it does not change the document root
environment variable before PHP is executed, thus leaving PHP to see an incorrect
document root.

In my blog, I outline how I get around this in PHP. There may be a similar approach
for Ruby/Rails -- I don't know: http://jbenner.net/blog/quick-tip-get-proper-document-root-when-using-mod-vhost-alias

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From [email protected] on November 05, 2009 16:41:46

No optimal solution here, but I've dealt with the issue in my local environment which is mainly PHP apps. In
~/Sites I have named folders that use VirtualDocumentRoot to match the hostname and the folder name. In order
to keep my Rails apps in ~/Sites as well, I manually add the entries to my user.conf file and have all Rails apps
serve up on port 3000. Here is my .conf file: http://gist.github.com/raw/227545/31fa4ba7e697200538422e3a4cba6fbe2b152490/ts.conf

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From shaunmcdonald131 on November 21, 2009 18:01:37

I've got the workaround for this.

In my apache config I have
VirtualDocumentRoot /srv/%0/public/htdocs/

thus
/srv/%0/public -is symlink to-> /path/to/rails/root
and in the rails root, I then have a symlink
htdocs -> public

In theory you could set the last folder in the VirtualDocumentRoot to be /public/ and thus not need that
second symlink.

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From notexist on November 23, 2009 00:27:29

I still got directory list with this workaround.

In my apache config I have
VirtualDocumentRoot /path/to/staging/%1/public

which %1 is a symlink of my desire RoR directory

My VirtualDocuemntRoot is point to public, so I don't need another symlink, isn't it?

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From samuel.kadolph on October 08, 2010 11:02:50

Workaround using the patch mentioned above:

  1. Grab the apache source ( http://httpd.apache.org/download.cgi#apache22 ) and extract
  2. Make sure you have the necessary packages
  3. Grab the patch from the bug report ( https://issues.apache.org/bugzilla/show_bug.cgi?id=26052#c19 )
  4. Copy the module to your home directory: cp httpd-2.2.16/modules/mappers/mod_vhost_alias.c ~
  5. Patch the module: patch mod_vhost_alias.c mod_vhost_alias.c.diff
  6. Compile the module and install: apxs2 -c -i mod_vhost_alias.c
  7. Set 'SetVirtualDocumentRoot' to 'on' in your virtual host

So far I've had no problems running passenger with only the VirtualDocumentRoot directive with this.

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From honglilai on March 13, 2013 04:09:33

Since Apache 2.4. mod_vhost_alias is compatible with Phusion Passenger. However it does not support undeployment so once an app is started its processes will stick around forever until you restart Apache. One solution would be to use Mass Deployment in Phusion Passenger Enterprise Standalone, and have Apache reverse proxy to Standalone.

Status: Fixed

from passenger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.