Comments (15)
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.
From honglilai on May 01, 2008 00:57:28
Summary: Passenger incompatible with VirtualDocumentRoot
Labels: -Type-Defect Type-Enhancement
from passenger.
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.
From honglilai on June 11, 2008 01:40:27
Labels: ConflictingModule
from passenger.
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.
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.
From [email protected] on September 08, 2009 15:00:58
This is high on my list of requirements for sure.
from passenger.
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.
From notexist on November 04, 2009 22:45:52
Is there any workaround for this case or just nobody need this feature?
from passenger.
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.
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.
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.
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.
From samuel.kadolph on October 08, 2010 11:02:50
Workaround using the patch mentioned above:
- Grab the apache source ( http://httpd.apache.org/download.cgi#apache22 ) and extract
- Make sure you have the necessary packages
- Grab the patch from the bug report ( https://issues.apache.org/bugzilla/show_bug.cgi?id=26052#c19 )
- Copy the module to your home directory: cp httpd-2.2.16/modules/mappers/mod_vhost_alias.c ~
- Patch the module: patch mod_vhost_alias.c mod_vhost_alias.c.diff
- Compile the module and install: apxs2 -c -i mod_vhost_alias.c
- 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.
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)
- HTTP3/QUIC breaks passenger Python apps ( Nginx + HTTP3 + Passenger ) HOT 2
- Cannot build passenger nginx dynamic module HOT 1
- Out of memory leads to passenger shutdown and ensuing 502 error on nginx HOT 3
- Out of memory leads to passenger shutdown and ensuing 502 error on nginx HOT 1
- Cannot upgrade to 1.24.0-1: unmet dependencies HOT 2
- Cannot find nginx module on Amazon Linux 2023 HOT 1
- Cannot install passenger-6.0.20-1.el9.x86_64.rpm on CentOS 9 Stream with Ruby 3.3 HOT 2
- Requests intermittently result in 500, directory in /tmp not found HOT 2
- Better cooperation with Kubernetes zero-downtime restarts
- Error with Rack prevents editing rails production credentials
- params are empty upon proper form submission HOT 1
- Packaging of unmaintained dependency: http-parser HOT 2
- The passenger spawns more processes than are allocated to it
- SecurityUpdateCheck fails when using builtin engine HOT 1
- Lacking rubyext-ruby-3.2.2-x86_64-linux.tar.gz from Release 6.0.20. HOT 1
- no Phusion Passenger(R) log file configured, discarding log output HOT 5
- Unable to locate package libnginx-mod-http-passenger | bullseye HOT 1
- Unable the fetch the repo for mod_passenger HOT 12
- passenger v6.0.21, ruby 3.3.1 with apache crashing. HOT 11
- passenger 6.0.21 will not install on AlmaLinux 9 / RHEL 9 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from passenger.