1

I want to enter my app by http://my.domain.ip/ instead of http://my.domain.ip/myapp.should I change the apache config(conf.d/deault.conf) or do something else? I want to bind some domain names to other apps in web2py/applications if this domain ip test success.

NameVirtualHost *:80
NameVirtualHost *:443


<VirtualHost *:80>
  WSGIDaemonProcess web2py user=apache group=apache processes=1 threads=1
  WSGIProcessGroup web2py
  WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py
  WSGIPassAuthorization On
  <Directory /opt/web-apps/web2py/applications>
    AllowOverride None
    Order Allow,Deny
    Deny from all
    <Files wsgihandler.py>
      Allow from all
    </Files>
  </Directory>

I tried to set <Directory /opt/web-apps/web2py/applications> to <Directory /opt/web-apps/web2py/applications/app>, but it didn't work.

Cœur
  • 37,241
  • 25
  • 195
  • 267
marc min
  • 13
  • 2

1 Answers1

0

web2py's parameter-based rewrite system allows you to map domains to apps. In routes.py:

routers = dict(
  BASE  = dict(
      domains = {
          'domain1.com' : 'app1',
          'domain2.com' : 'app2',
      }
  ),
)

The pattern-based rewrite system could be used as well.

Anthony
  • 25,466
  • 3
  • 28
  • 57