zoukankan      html  css  js  c++  java
  • apache 2.0 版本 虚拟主机 与 虚拟目录配置

    1.配置虚拟主机

    <VirtualHost *:80>

    DocumentRoot E:/www
    DirectoryIndex index.php index.html
    ServerName localhost

    </VirtualHost>

    2.配置虚拟目录

    <Directory "d:/www/zendstudio">
        Options Indexes FollowSymLinks Multiviews
        AllowOverride All
        Order Allow,Deny
        Allow from all
    </Directory>

    此时,注销掉APACHE默认的DocumentRoot设置:

    #DocumentRoot "E:/www/apache/Apache2/htdocs"

    #<Directory "E:/www/apache/Apache2/htdocs">
    #Options Indexes FollowSymLinks
    #AllowOverride None
    #Order allow,deny
    #Allow from all
    #</Directory>

    重启APACHE即可。

    问题1:权限分配

    Order Allow,Deny

    Deny from 111.111.222.222

    Allow from 111.111

    权限先后,先ALLOW 后 DENY。   此时先执行ALLOW:Allow from 111.111。 后拒绝:Deny from 111.111.222.222。     Order Allow,Deny如果换成Order Deny,Allow --全部111.111都允许了,就不存在拒绝。

     问题2:ServerAlias使用

    <VirtualHost *:80>
    DocumentRoot "/var/www/"
    ServerName WWW.XXX.COM
    ServerAlias  *.xxx.com
    </VirtualHost>

    可以设置基于IP,与域名。   允许某个IP, 匹配规则达到泛解析域名。

  • 相关阅读:
    Asp.net MVC中 Controller 与 View之间的数据传递
    Asp.net中WebForm 与 MVC的架构区别
    初步理解MVC
    JavaScript 设置、读取Cookie
    JavaScript 设计模式之工厂模式
    JavaScript对象 属性
    JavaScript中对于闭包的理解
    WebApi 实例
    webservice 简单实例
    【转】Linq 语法
  • 原文地址:https://www.cnblogs.com/qunshu/p/3118434.html
Copyright © 2011-2022 走看看