How to set a web application to be the default(or root) application

50 views
Skip to first unread message

sunjoy

unread,
Mar 27, 2008, 1:59:14 AM3/27/08
to web2py Web Framework
Hello, everyone, I am a newbie using web2py framework.

Web2py is so great and powerfull. I like it very much and keep on
learning it.

I got a problem, is there any way to set a default(or root)
application?


For example, in java web development , If I use tomcat as the
application server , I can

configure "server.xml" to set a root application. Like this:

<Context path="" debug="0" docBase="/data0/sites/foobar.com/myapp"></
Context>


While, in web2py, the url can only be http://www.somesite.com/myapp/....


I want to set myapp as default application , so I can access it
through the url "http://www.somesite.com/" but not "http://
www.somesite.com/myapp/".

How can I do it? modify routes.py?




Massimo Di Pierro

unread,
Mar 27, 2008, 2:36:58 AM3/27/08
to web...@googlegroups.com
Thank you sunjoy,

There are many ways to do so:

1) call you app "init"
2) If there is no app "init" the "examples" is the default
3) You can create routes.py as discussed here
http://mdp.cti.depaul.edu/AlterEgo/default/show/67
4) If you run it behind apache with mod_proxy or mod_rewrite you can
configure apache to do so as in
http://mdp.cti.depaul.edu/AlterEgo/default/show/38

Hope this helps.

Massimo

sunjoy

unread,
Mar 27, 2008, 7:02:26 AM3/27/08
to web2py Web Framework
Massimo , Thank you very much for you advice.

And I have another question about mod_proxy.

Can I configure Apache like this ? I used to write configuration like
this to make tomcat run behind Apache .

<Location "/">
Order deny,allow
Allow from all
ProxyPass http://127.0.0.1:8000/examples/
ProxyPassReverse http://127.0.0.1:8000/examples/
</Location>


I have tried that , but it didn't work . I don't know why.



On Mar 27, 2:36 pm, Massimo Di Pierro <mdipie...@cs.depaul.edu> wrote:
> Thank you sunjoy,
>
> There are many ways to do so:
>
> 1) call you app "init"
> 2) If there is no app "init" the "examples" is the default
> 3) You can create routes.py as discussed here
>    http://mdp.cti.depaul.edu/AlterEgo/default/show/67
> 4) If you run it behind apache with mod_proxy or mod_rewrite you can  
> configure apache to do so as in
>    http://mdp.cti.depaul.edu/AlterEgo/default/show/38
>
> Hope this helps.
>
> Massimo
>
> On Mar 27, 2008, at 12:59 AM, sunjoy wrote:
>
>
>
>
>
> > Hello, everyone, I am a newbie using web2py framework.
>
> > Web2py is so great and powerfull. I like it very much and keep on
> > learning it.
>
> > I got a problem, is there any way to set a default(or root)
> > application?
>
> > For example, in java web development , If I use tomcat as the
> > application server , I can
>
> > configure "server.xml" to set a root application. Like this:
>
> > <Context path="" debug="0" docBase="/data0/sites/foobar.com/myapp"></
> > Context>
>
> > While, in web2py, the url can only behttp://www.somesite.com/
> > myapp/....
>
> > I want to set myapp as default application , so I can access it
> > through the url "http://www.somesite.com/" but not "http://
> >www.somesite.com/myapp/".
>
> > How can I do it? modify routes.py?- Hide quoted text -
>
> - Show quoted text -

voltron

unread,
Mar 27, 2008, 8:54:13 AM3/27/08
to web2py Web Framework
I think the directives are not complete, "Order deny,allow" is missing
Sunjoy

On Mar 27, 12:02 pm, sunjoy <ccnu...@gmail.com> wrote:
> Massimo , Thank you very much for you advice.
>
> And I have another question about mod_proxy.
>
> Can I configure Apache like this ? I used to write configuration like
> this to make tomcat run behind Apache .
>
> <Location "/">
> Order deny,allow
> Allow from all
> ProxyPasshttp://127.0.0.1:8000/examples/
> ProxyPassReversehttp://127.0.0.1:8000/examples/

Massimo Di Pierro

unread,
Mar 27, 2008, 10:50:00 AM3/27/08
to web...@googlegroups.com
Yes but should be

   <Location "/examples">
     Order deny,allow
     Allow from all
     ProxyPassReverse http://127.0.0.1:8000/
   </Location>

note the reverse proxy has no path.

Massimo
Reply all
Reply to author
Forward
0 new messages