On Jan 12, 10:27 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > I should move to mod_wsgi. I did that in all my other installations > but this one because have a complex apache config file. Your > suggestion does not work because I am not proxying only examples but > different apps in different ways and I cannot move it outside of > Location.
Then use multiple ProxyPass directives or use a ProxyPassMatch with appropriate patterns and reinsertion of sub patterns back into proxy URL. For example: ProxyPassMatch ^/(examples|admin|other)/static ! ProxyPassMatch ^/(examples|admin|other) http://127.0.0.1:8000/$1 You should be able to do with proxy directives alone what you were doing with the combination of Location and proxy directives. > I am going to move to mod_wsgi. now! System will be down. If you feel it is time. Didn't want to needing to disturb your setup too much. Graham > Massimo > > On Jan 11, 5:21 pm, Graham Dumpleton <graham.dumple...@gmail.com> > wrote: > > > > > On Jan 12, 6:48 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > I have the following in my apache config > > > > <VirtualHost *:80> > > > ServerName mdp.cti.depaul.edu > > > ServerAlias mdp.cti.depaul.edu > > > ServerAliaswww.web2py.com > > > ServerAdmin mdipie...@cs.depaul.edu > > > Alias / /home/user/web2py/applications/ > > > <LocationMatch "/(.*)/static/(.*)$"> > > > Order deny,allow > > > Allow from all > > > </LocationMatch> > > > <Location "/examples"> > > > Order deny,allow > > > Allow from all > > > ProxyPasshttp://127.0.0.1:8000/examples > > > ProxyPassReversehttp://127.0.0.1:8000/ > > > </Location> > > > </virtualhost> > > > > I want the former to take precedence over the latter so that static > > > files are served by apache not not by web2py. I cannot find a way to > > > do it. Any advice? > > > You should read again my comments in: > > > http://blog.dscpl.com.au/search/label/web2py > > > about the evils of using Location/LocationMatch for access control > > plus other stuff in my critique of your original mod_wsgi instructions > > as they are also somewhat relevant in regard to aliasing static > > directories. Also refer to the cleaned up mod_wsgi configuration in > > book 2nd edition. > > > So, try using: > > > <VirtualHost *:80> > > ServerName mdp.cti.depaul.edu > > ServerAlias mdp.cti.depaul.edu > > ServerAliaswww.web2py.com > > ServerAdmin mdipie...@cs.depaul.edu > > > AliasMatch ^/([^/]+)/static/(.*) /home/user/web2py/applications/$1/ > > static/$2 > > > <Directory /home/user/web2py/applications/*/static/> > > Order Allow,Deny > > Allow from all > > </Directory> > > > ProxyPass /exampleshttp://127.0.0.1:8000/examples > > ProxyPassMatch /examples/static ! > > > ProxyPassReverse /exampleshttp://127.0.0.1:8000/examples > > > </Virtualhost> > > > In other words: > > > 1. Move proxy outside of Location directive and explicitly supply > > mount point. No access control necessary as mod_proxy ignores it. > > > 2. Add a proxy exclusion for the suburl for where static files are. > > > 3. Add sub url as final argument to ProxyPassReverse. > > > 4. Use properly qualified static file mounts. > > > 5. Use Directory directive around giving access to the static > > directories. No abuse of Location/LocationMatch directives. > > > Graham
-- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.