阅 读 文 章

snakelets 文档,我翻译了一部分。

[来源:网上转载 (http://www.chinaunix.net) | 作者:网友(瘦青蛙) | 时间:2007-05-27 | 浏览:人次 ]


Snakelets 提供 virtual hosting(基于hostnames)。要启动这个功能您需要对Virtual Host configuration进行配置。这将告诉server哪些web 应用程序应该被载入,哪些主机名必须被连接。如果你有不同的主机名指向同一个IP,那你可以通过这种方式提供不同的web sites 服务(这只工作在支持 HTTP 1.1 的浏览器,其实大部分浏览器都支持)。配置文件是 webapps/__init__.py 。包括四个 配置item :
[list]
ENABLED - set this to True to enable virtual hosts. Setting it to False disables this feature and reverts back to out-of-the-box startup (see above).
ENABLED-设置这项为True将开启虚拟主机。设置为False将关闭虚拟主机并回到out-of-the-box状态(见下文)。

virtualhosts - a mapping of host names to a sequence of web application names that will be connected to the specified hostname. If a web application is not mentioned for any virtual host, it won't be loaded. A web app may be connected to multiple vhosts.
virtualhosts – 主机名,映射到web应用程序名序列中,将被连接到指定的主机名。如果一个web应用程序没有提及任何虚拟主机,他将不会被载入。Web app可能被连接到复合的vhost。

webroots - a mapping of host names to the name of the web app that will be mapped in the URL root ( '/' ) of the server on that virtual host. The web root hosts must be known virtualhosts specified in the virtualhosts.
webroots – 被映射到 URL跟目录的主机名(‘/’)

aliases - a mapping of vhost-alias name to real-vhost name (this avoids duplicate loading of webapps).
aliases – 虚拟主机别名,映射到真实主机名(避免重复载入webapps)。

defaultvhost - the name of the default virtual host that will be used when the browser doesn't send a 'Host' header.
默认主机名,当浏览器没有发送’Host’header是起作用。
[/list]

Every vhost can have a different list of webapps that are deployed on it, but a webapp can also be deployed on multiple vhosts at the same time. However, all deployed instances will be separate, unrelated copies of the webapp: if you deploy a webapp on multiple vhosts, it will be created for each vhost, and the init function will be invoked once for every copy.
论坛热门帖子: [lch203] 写得蛮好的linux学习笔记(10-21)
[黑马制造] 学习java的30个目标(10-19)
[笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19)
[udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18)
[沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18)
TAG标签: 翻译 文档 使用 可以 页面 URL 如果 文件 webapp 一个

最新评论 共有1位网友发表了评论

发表评论

评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名:(注册)
密码:
验证码:
匿名发表

网站地图友情连接交流论坛网站投稿广告服务联系我们留言本站长统计
Some rights reserved: www.chmhome.com, 鄂ICP备07010232号 E-mail:chinakafei@live.com,QQ:552766
中国咖啡技术网(Chmhome):国外编程技术书籍,中文编程手册,经典编程文章,交流技术,技术软件下载,计算机论文,毕业论文.