Lighttpd配置simple-vhost(简便的,自识别的虚拟主机)

zenwong 2010-02-16 10:11:09
原地址:http://doc.zenw.org/linux/ch02s03.html#id2843896


simple-vhost

- 功能介绍 -

simple-vhost就是自动将你在浏览器地址栏里输入的URL匹配到一个document-root下与URL相同名字的目录中

这样可以实现不需要配置,就可以简单的创建虚拟主机


- 打开simple-vhost功能 -

将server.modules中的mod_simple_vhost去除注释


- 配置simple-vhost功能 -

The complete document root is constructed either by

如果完整的配置了simple-vhost目录

server-root + hostname + document-root

or if this path does not exist by

如果没有完整的配置simple-vhost目录

server-root + default-host + document-root

A small example should make this idea clear:

一个小例子

/var/www/
/var/www/logs/
/var/www/servers/
/var/www/servers/example.org/
/var/www/servers/example.org/lib/
/var/www/servers/example.org/pages/
/var/www/servers/mail.example.org/
/var/www/servers/mail.example.org/lib/
/var/www/servers/mail.example.org/pages/

将配置文件中以下项目解除注释

simple-vhost.server-root = "/var/www/servers/"
simple-vhost.default-host = "example.org"
simple-vhost.document-root = "pages"


- 相关链接 -

http://redmine.lighttpd.net/wiki/1/Docs:ModSimpleVhost 官方标准设置说明


更多内容可访问:
http://www.zenw.org
http://doc.zenw.org
http://doc.zenw.org/linux
http://doc.zenw.org/mysql
http://doc.zenw.org/developer
...全文
186 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zenwong 2010-02-22
  • 打赏
  • 举报
回复
这个是我最喜欢的功能,希望你们也是
zenwong 2010-02-17
  • 打赏
  • 举报
回复
因为感觉CSDN的BBS分类不太准确,所以不知道我这种文章具体属于哪个版块,就多发了,见谅。
cs5276 2010-02-17
  • 打赏
  • 举报
回复


感谢分享
街头小贩 2010-02-17
  • 打赏
  • 举报
回复
新手学习

5,655

社区成员

发帖
与我相关
我的任务
社区描述
Web开发应用服务器相关讨论专区
社区管理员
  • 应用服务器社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧