Possibly my email subject is not entirely correct, but I don't quite know what to call this. I have the following application under ~/Sites/myapp/ My Apache conf file is <VirtualHost *:80> ServerName myapp.local DocumentRoot "/Users/punkish/Sites/myapp" ErrorLog /Users/punkish/Logs/myapp-error_log CustomLog /Users/punkish/Logs/myapp-access_log common <Directory "/Users/punkish/Sites/myapp"> Options Indexes ExecCGI FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <Location /> SetHandler perl-script PerlHandler Plack::Handler::Apache2 PerlSetVar psgi_app /Users/punkish/Sites/myapp/app.psgi </Location> </VirtualHost> And, everything works well when I go to http://myapp.local/ However, what I really want is to have a general welcome application under myapp with login and other commons functions. And then, have child apps that inherit some of the capabilities from myapp, but extend it further with unique functions. I have the following structure ~/Sites/myapp/ ~/Sites/myapp/app1/ ~/Sites/myapp/app2/ and so on. Each of the above directories has a full-fledged dancer app. Now, I am not sure how my Apache conf would be. I have tried the following <VirtualHost *:80> ServerName myapp.local DocumentRoot "/Users/punkish/Sites/myapp" ErrorLog /Users/punkish/Logs/myapp-error_log CustomLog /Users/punkish/Logs/myapp-access_log common <Directory "/Users/punkish/Sites/myapp"> Options Indexes ExecCGI FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> # Add separate Location blocks for different apps <Location /app1> SetHandler perl-script PerlHandler Plack::Handler::Apache2 PerlSetVar psgi_app /Users/punkish/Sites/myapp/app1/app.psgi </Location> <Location /app2> SetHandler perl-script PerlHandler Plack::Handler::Apache2 PerlSetVar psgi_app /Users/punkish/Sites/myapp/app2/app.psgi </Location> </VirtualHost> The above gives me dancer's 404, so it seems that dancer is being invoked, but some path is fubar. What am I doing wrong? -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu ----------------------------------------------------------------------- Assertions are politics; backing up assertions with evidence is science =======================================================================
responding to my own question below (but, don't have a solution yet) -- On Sat, Aug 14, 2010 at 4:40 PM, P Kishor <punk.kish@gmail.com> wrote:
Possibly my email subject is not entirely correct, but I don't quite know what to call this. I have the following application under
~/Sites/myapp/
My Apache conf file is
<VirtualHost *:80> ServerName myapp.local DocumentRoot "/Users/punkish/Sites/myapp" ErrorLog /Users/punkish/Logs/myapp-error_log CustomLog /Users/punkish/Logs/myapp-access_log common
<Directory "/Users/punkish/Sites/myapp"> Options Indexes ExecCGI FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory>
<Location /> SetHandler perl-script PerlHandler Plack::Handler::Apache2 PerlSetVar psgi_app /Users/punkish/Sites/myapp/app.psgi </Location> </VirtualHost>
And, everything works well when I go to http://myapp.local/
However, what I really want is to have a general welcome application under myapp with login and other commons functions. And then, have child apps that inherit some of the capabilities from myapp, but extend it further with unique functions. I have the following structure
~/Sites/myapp/ ~/Sites/myapp/app1/ ~/Sites/myapp/app2/
and so on. Each of the above directories has a full-fledged dancer app. Now, I am not sure how my Apache conf would be. I have tried the following
<VirtualHost *:80> ServerName myapp.local DocumentRoot "/Users/punkish/Sites/myapp" ErrorLog /Users/punkish/Logs/myapp-error_log CustomLog /Users/punkish/Logs/myapp-access_log common
<Directory "/Users/punkish/Sites/myapp"> Options Indexes ExecCGI FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory>
# Add separate Location blocks for different apps <Location /app1> SetHandler perl-script PerlHandler Plack::Handler::Apache2 PerlSetVar psgi_app /Users/punkish/Sites/myapp/app1/app.psgi </Location>
<Location /app2> SetHandler perl-script PerlHandler Plack::Handler::Apache2 PerlSetVar psgi_app /Users/punkish/Sites/myapp/app2/app.psgi </Location> </VirtualHost>
The above gives me dancer's 404, so it seems that dancer is being invoked, but some path is fubar. What am I doing wrong?
From the Dancer deployment docs
---- If you want to deploy multiple applications under the same VirtualHost, using one application per directory for example, you can do the following. This example uses the FastCGI dispatcher that comes with Dancer, but you should be able to adapt this to use any other way of deployment described in this guide. The only purpose of this example is to show how to deploy multiple applications under the same base directory/virtualhost. ---- The above is almost what I want. Except, I don't want to use FastCGI (quite yet). Right now I have experienced some level of success with Place::Handler::Apache2, so I want to achieve the above with Plack. Any suggestions will be welcome. -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu ----------------------------------------------------------------------- Assertions are politics; backing up assertions with evidence is science =======================================================================
participants (1)
-
P Kishor