Apache中VirtualHost配置说明

来源:互联网 发布:家暴原因数据统计 编辑:程序博客网 时间:2024/06/02 10:28

<VirtualHost *:80>

    #站点目录

    DocumentRoot "E:/project/code/public/www"

    #访问域名   

    ServerName www.cankaoxiaoxi.com

    #给虚拟主机增加多个域名,上面网址的别名

    ServerAlias cankaoxiaoxi.com

    #添加可以执行php的文件类型,为shtml文件开启SSI,使浏览器能解析,不至于直接输出代码

     # AddType application/x-httpd-php .htm  就是指.htm可以解析php

    AddType text/html .shtml

    #为.shtml开启包含(include),在.shtml文件中(如<!--include ……-->)可以引入文件

    AddOutputFilter INCLUDES .shtml

    #映射URL到文件系统的特定区域

    Alias /widget/ E:/project/cankao/code/public/www/widget/

    Alias /section/ E:/project/cankao/code/public/www/section/

    #权限设置,标签中的地址是相对于DocumentRoot的

    <Directory "/">

        参数设置Indexes开启索引,可以在浏览器中显示当前目录文件列表。一般框架中因后台模板不是html的后台虚拟主机不加Includes

        Options -Indexes FollowSymLinks Includes

        #查找打开文件和顺序

        DirectoryIndex index.shtml index.html

        #权限

        Allow from all
    </Directory>

</VirtualHost>


0 0
原创粉丝点击