官术网_书友最值得收藏!

  • Lighttpd
  • Andre Bogus
  • 175字
  • 2021-08-25 18:06:21

Extended Virtual Hosting

Too simple? Well, we can gain one level of complexity by using mod_evhost. The "e" stands for extended and while it does a little more than mod_simple_vhost, the configuration is even more minimal. In fact, there is only one option:

evhost.path-pattern = "/var/www/vhost/%3.%0/htdocs"

This example would do exactly the same as the code above, only using mod_evhost instead of mod_simple_vhost. The percent-signs with numbers are placeholders for the following values (in our example for the subdomain some.domain.myvirtualhost.net):

This implies that "%0" could also be stated as "%2.%1". We do not gain much flexibility over mod_simple_vhost; the most common usage is:

evhost.path-pattern = "/var/www/vhost/%0/%3/htdocs"

So, we can have a directory per-domain containing a directory for each subdomain, or if we serve only one domain, we can leave out the domain name:

evhost.path-pattern = "/var/www/vhost/%3/htdocs"

Now, we have omitted the domain name in our path. We can also use a similar pattern to create per-user homepages under http://username.myvirtualhost.net where every user has a home directory under /home/username with a subdirectory html:

evhost.path-pattern = "/home/%3/html"
主站蜘蛛池模板: 张家界市| 富宁县| 兰溪市| 徐汇区| 三河市| 尉犁县| 富民县| 东平县| 高阳县| 得荣县| 岳西县| 若羌县| 长泰县| 龙胜| 阳朔县| 河北区| 揭西县| 紫阳县| 宁南县| 新干县| 马山县| 浪卡子县| 南昌市| 文昌市| 壤塘县| 加查县| 鄂托克旗| 湖口县| 郓城县| 梁河县| 全椒县| 鸡西市| 新兴县| 龙陵县| 达孜县| 年辖:市辖区| 平定县| 家居| 万荣县| 盐山县| 嘉义市|