如何让domin ip指向web2py应用而不是默认" welcome"应用

时间:2015-04-29 07:04:37

标签: apache mod-wsgi web2py

我想通过 http://my.domain.ip/ 而不是 http://my.domain.ip/myapp 输入我的应用。我应该更改apache配置(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>,但它确实无效。

1 个答案:

答案 0 :(得分:0)

web2py&#39; s parameter-based rewrite system允许您将域映射到应用。在routes.py中:

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

也可以使用pattern-based rewrite system