zoukankan      html  css  js  c++  java
  • IIS && Apache 多个网站使用同一个端口

    IIS下 配置

      * 设置 网站标识 -> IP地址 -> 高级
    
        将端口填写为 80 , 将主机头值写为 域名

    Apache下 配置 httpd.conf文件,将以下代码添加到最后一行

    NameVirtualHost 98.126.193.240:80
    
    <VirtualHost 98.126.193.240:80> 
    DocumentRoot "d:/wamp/www/www.igamel.com"
    ServerName www.igamel.com
    </VirtualHost>
    
    <VirtualHost 98.126.193.240:80> 
    DocumentRoot "d:/wamp/www/www.ohued.com"
    ServerName www.ohued.com
    </VirtualHost>



    http://hi.baidu.com/22000254/blog/item/a4c61e997c8f130e6f068c1c.html Aapche 如果需要绑定多个域名到一个IP上,是支持的。需要注意以下2点: 1 必须要开启 NameVirtualHost开关选项, 如:NameVirtualHost 220.231.220.231:80 2 NameVirtualHost 需要指定具体的端口 例如":80",跟<VirtualHost 220.231.32.*:80>对应,否则会报错: mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results。 翻译过来就是: NameVirtualHost 地址,指定端口和不指定端口混合使用是不支持的,将会产生未逾期的后果。 未逾期的后果就是: 第2个不起作用,仅当一个站点设置起作用。 完整的例子: # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for requests without a known # server name. # NameVirtualHost 219.133.61.226:80 <VirtualHost 219.133.61.226:80> ServerAdmin hot@vip.qq.com DocumentRoot /usr/local/apache2/htdocs1 ServerName www.linux51.com ErrorLog logs/linux51.com-error_log CustomLog logs/linux51.com-access_log common </VirtualHost> <VirtualHost 219.133.61.226:80> ServerAdmin hot@vip.qq.com DocumentRoot /usr/local/apache2/htdocs2 ServerName www.linux52.com ErrorLog logs/linux52.com-error_log CustomLog logs/linux52.com-access_log common </VirtualHost>

    Apache 隐藏网站目录结构

    # hidden the treepath ---by sam;
    <Directory "D:/wamp/www/">
        Options -Indexes FollowSymLinks  //将 Indexes改为 -Indexes即可 隐藏站点目录结构
    </Directory>

    Apache 更改默认首页文件

    找到 DirectoryIndex  这段.把它改成DirectoryIndex  index.php index.Html index.html

    <Directory "D:/wamp/www/">

  • 相关阅读:
    scikit-learn机器学习(四)使用决策树做分类
    从最大似然到EM算法浅解
    scikit-learn机器学习(三)多项式回归(二阶,三阶,九阶)
    一个打印调试信息的样例
    AppFuse 3的乱码问题
    垂直和水平居中方法小结
    Hero In Maze
    Highmaps的天津地图数据JSON格式
    互联网公司面试中常常被问的问题
    MySQL(6)--复制,docker容器中
  • 原文地址:https://www.cnblogs.com/juhualang/p/3871912.html
Copyright © 2011-2022 走看看