On 31/08/11 02:41, dancinglightning wrote:
> Hi
>> I have a rails app that runs on Apache+Passenger.
> at / ?
>
Yes, at the root /
>> I would like to have another rails app running (Actually uat version
>> of the production app) in the sub-uri /test and running in the uat
>> environment. It should still be covered my the main site's SSL.
> Why ? for the ssl ? in test ?
Client is adamant that the test site must be covered by SSL as well due
to security policies etc etc.
> Still, I have tried and it didn't work out. I use subdomains
> sucessfully.
>
I am trying to find a solution that doesn't require us using up another
IP and certificate (Or getting an expensive wildcard certificate)
specifically for the test site so sub-domains are out.
> Torsten
>
I have tried various methods and never managed to quite get it working
in the manner I described, i am not sure if it is even possible to be
honest which is why I posted here. Thanks for the feedback
Cheers
Jeff
I don't think I ever managed to use AliasMatch and RedirectMatch in my
attempts; that might have been the part that was eluding me.
I shall give your setup a try and report back on how things go.
Thanks for the examples and explanation!
Cheers
Jeff
I merged your suggestions into my present vhost.conf file and it hasn't
exploded on me but there is one problem. The Gist and error message is
below:
The two environments are production (/) and uat (/uat)
https://gist.github.com/1182826
Basically, accessing the test URL DOES spin up the uat application
instances but I get a white empty screen in the browser. The logfile in
the gist above comes from the uat application log so it looks to me that
the uat application is not picking up on the RAILS_RELATIVE_URL_ROOT
environment variable.
Would this be an accurate view do you think? I am currently looking
through the rails documentation to see if I can set that inside the
program as a test.
Cheers
Jeff
Using the vhost setup provided by wbr.
A) Relying on the environment variable doesn't seem to work.
B) If I use config.action_controller.relative_url_root as in the
guides.rubyonrails.org then the app crashes on startup.
[ pid=25873 thr=158687540 file=utils.rb:176 time=2011-08-31 14:16:03.581
]: *** Exception ArgumentError in
PhusionPassenger::Rack::ApplicationSpawner (wrong number of arguments (1
for 0)) (process 25873, thread #<Thread:0x12eac268>):
C) If I manually wrap all my routes in a scope '/test' block then the
application works.
So for the moment I will do C) and set it so that it will wrap only in
uat environment.
If anyone has any other ideas I am interested in getting this working
the best way since my option of C) is a bit of a kludge at the moment.
cheers
Jeff
Excellent ideas.
I will try the 2nd option, I agree that that looks like the better one
and see if there is anywhere I can break routing inside the app.
Cheers
Jeff
There was one issue where I was using controller.controller_path as it
was returning different results but that was it (Fixed by matching
against the controller.fullpath instead).
I am not doing anything too funky with url_helpers so if there are
edge-cases I guess I am not coming across them.
As far as I can tell all is groovy.
Thank you very much for your help on this one.