[Dancer-users] Global app-wide "prefix" settings

sawyer x xsawyerx at gmail.com
Wed Sep 28 22:18:22 CEST 2011


Such as Git, it sounds complex but it is in fact relatively simple.

You have a virtual host catching all requests to a domain name. It will put
it in the context of the virtual host configuration block (<VirtualHost
*:80>). You can specify the domain inside it:
<VirtualHost *:80>
    ServerName mydomain.com
    ServerAlias www.mydomain.com
</VirtualHost>

Inside that context, you can have Aliases. These aliases assure that
whenever someone requests one thing, Apache will actually submit them
another. This helps when you put stuff in different locations but want the
users to have the same requests. For example, you want the users to go to
mydomain/cgi-bin/script.pl when in fact you want "cgi-bin" to be in a very
specific place outside the regular directory. You can have that, and that's
what people often use.

1. Put a virtual host for "mydomain"
2. Put an alias from "/myapp/images" to "/public/images"
3. Users reach: mydomain/myapp/images
4. Apache will actually go to /public/images to get the images instead of
/myapp/images.

It's that simple.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20110928/6710c15b/attachment-0001.htm>


More information about the Dancer-users mailing list