如何让域 ip 指向 web2py 应用程序而不是默认的 "welcome" 应用程序

How to let the domain ip point to a web2py app instead of the default "welcome" app

我想通过 http://my.domain.ip/ instead of http://my.domain.ip/myapp 进入我的应用程序。我应该更改 apache config(conf.d/deault.conf) 还是做其他事情? web2py/applications如果这个域ip测试成功,我想绑定一些域名到其他应用

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>

我尝试将 <Directory /opt/web-apps/web2py/applications> 设置为 <Directory /opt/web-apps/web2py/applications/app>,但没有成功。

web2py 的 parameter-based rewrite system 允许您将域映射到应用程序。在 routes.py:

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

也可以使用pattern-based rewrite system