• 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

  • 相关阅读:
    表示数值的字符串(C++描述)
    单链表是否有环及环入口点
    医院信息运维系统-信息科专用运维系统
    c# List 按类的指定字段排序
    运维系统说明
    更新库下载
    mysql数据库备份
    网络编程基础
    面向对象和过程,一样的价格,不一样的口味
    模块的导入顺序细节
  • 原文地址:https://www.cnblogs.com/jifeng/p/2178581.html
Copyright © 2020-2023  润新知