zoukankan      html  css  js  c++  java
  • apache 基于ip的虚拟主机配置(虚拟主机设定不同的字符编码)

    <Directory "D:/EmpireServer/web">
        #
        # Possible values for the Options directive are "None", "All",
        # or any combination of:
        #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
        #
        # Note that "MultiViews" must be named *explicitly* --- "Options All"
        # doesn't give it to you.
        #
        # The Options directive is both complicated and important.  Please see
        # http://httpd.apache.org/docs/2.2/mod/core.html#options
        # for more information.
        #
        Options FollowSymLinks

        #
        # AllowOverride controls what directives may be placed in .htaccess files.
        # It can be "All", "None", or any combination of the keywords:
        #   Options FileInfo AuthConfig Limit
        #
        AllowOverride None

        #
        # Controls who can get stuff from this server.
        #
        Order allow,deny
        Allow from all

    </Directory>




    <Directory "D:/EmpireServer/weibo">
        #
        # Possible values for the Options directive are "None", "All",
        # or any combination of:
        #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
        #
        # Note that "MultiViews" must be named *explicitly* --- "Options All"
        # doesn't give it to you.
        #
        # The Options directive is both complicated and important.  Please see
        # http://httpd.apache.org/docs/2.2/mod/core.html#options
        # for more information.
        #
        Options FollowSymLinks

        #
        # AllowOverride controls what directives may be placed in .htaccess files.
        # It can be "All", "None", or any combination of the keywords:
        #   Options FileInfo AuthConfig Limit
        #
        AllowOverride None

        #
        # Controls who can get stuff from this server.
        #
        Order allow,deny
        Allow from all

    </Directory>
    <VirtualHost 192.168.2.40:82>
        ServerAdmin      cms@G2.home
        DocumentRoot     "D:/EmpireServer/web" 
        ServerName       cms
    </VirtualHost>

    <VirtualHost 192.168.2.54:82>
        ServerAdmin      weibo.home
        DocumentRoot     "D:\EmpireServer\weibo" 
        ServerName       weibo
    </VirtualHost>

    为不同的虚拟主机设定不同的字符编码

    不同需求 
    因为服务器上有很多虚拟主机,而有些虚拟主机需要UTF-8编码支持,一些需要GB2312编码支持。

    运行环境 
    ubuntu7.04
    Apache-2.2.3
    碰到问题 
    在apache2的全局设置里,设置了默认字符集为UTF-8,而一些需要GB2312支持的网站,在访问的时候,就出些乱码。

    AddDefaultCharset UTF-8
    解决办法 
    修改全局默认字符集为GB2312 
    AddDefaultCharset GB2312

  • 相关阅读:
    详解Office Add-in 清单文件
    在dotnet core web api中支持CORS(跨域访问)
    Office 365 机器人(Bot)开发入门
    人工智能背景下的Office 365现状和发展趋势
    观未见,行不止 —— Power BI 两周年技术和方案交流圆桌会议纪实
    基于Office 365的随需应变业务应用平台
    实战Excel Add-in的三种玩法
    Office Add-in 设计规范与最佳实践
    在Visual Studio Code中开发Office Add-in
    在Visual Studio 中开发Office Add-in
  • 原文地址:https://www.cnblogs.com/jifeng/p/2178581.html
Copyright © 2011-2022 走看看