1

Hey, I am using Capistrano to deploy my PHP applications.
Now, I notice a strange thing here (or maybe this is something I do not understand).
Capistrano deploys application to releases folder and then, symlinks current to point to latest release.
Now, when I access these files, I have to access them like this: http://example.com/current/
Is there a way, I can tell capistrano (or make it work) so that I can rather use: http://example.com/ to access these deployed files?

Regards
Nikhil Gupta.

nickgrim
  • 5,387
  • 1
  • 22
  • 28
Stoic
  • 10,536
  • 6
  • 41
  • 60

1 Answers1

3

The current symlink is to enable capistrano's built-in functionality for rolling back to previous releases - it just changes the symlink to point to a different subdirectory of releases.

Do you have access to the server's host-configuration? If so, you could change the DocumentRoot to point to /path/to/your/app/current instead.

nickgrim
  • 5,387
  • 1
  • 22
  • 28
  • that works for me, but I still got another query. what if, the `:deploy_to` variable is set to be dependent on `:application` variable? o'course we would not be able to use `DocuemntRoot` in that case. – Stoic Mar 09 '11 at 10:18
  • 1
    Depending upon how dynamic you need that to be, you might either use something like Apache's mass-virtualhosting functionality, or just set up multiple `VirtualHost`s manually. Either way, you might want to ask this as another question. ;-) – nickgrim Mar 09 '11 at 10:32
  • naah.. the explanation itself solves my query. thank you, for this valuable comment, as well as the answer, itself :) – Stoic Mar 09 '11 at 10:33