• Apache 配置多端口网站


    跳过安装步骤。

    1. apache安装目录/conf/httpd.conf,如果你是采用wamp集成环境,那么在 wamp/bin/apache下。
    
    2.  在httpd.conf中,找到  
        #LoadModule vhost_alias_module
        #Include conf/extra/httpd-vhosts.conf   
        去掉前面的#号,这一步是为了加载扩展配置
    
    3. 找到apache安装目录/conf/extra/httpd-vhosts.conf。
        打开文件找到 NameVirtualHost *:80,
        比如我们要添加81的端口,在下面增加一行
        Listen 81
    
    4. 然后找到<VirtualHost *:80> ... </VirtualHost> ,复制一段修改为
        <VirtualHost *:81>
        DocumentRoot "D:/php" 
        ServerName localhost
        ServerAlias localhost 
        </VirtualHost>
    
    5. 配置目录权限
        打开/conf/httpd.conf,找到Directory节点。
        可以修改默认目录权限,也可以单独指定目录权限,分别是:
        修改默认目录权限,即修改Directory节点
            <Directory />
                Options FollowSymLinks
             AllowOverride None
             Order deny,allow
           #Deny from all
             Allow from all
           #允许所有访问
             Satisfy all
        </Directory>
    
        或者增加如下一段
    <Directory "D:/php">
        #
        # 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 Indexes 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 all
    
        #
        # Controls who can get stuff from this server.
        #
    
    #   onlineoffline tag - don't remove
        Order Allow,Deny
        Allow from all
    
    </Directory>
    6. 重启apache服务,查看localhost:81/index.php 已经可以正常运行了
  • 相关阅读:
    Vue 中动态添加class(使用v-bind:class)
    Vue 过滤器的使用
    Huxley 是一个用于Web应用 UI 测试的工具
    showmessage函数里
    [Php] PHPExcel读取Excel文件(或来自客户端上传的)并返回二维数组
    async-validator -- git地址
    Antd Upload组件上传文件至php后端, php拿到对应的文件名(二: vue实现)
    Antd Upload组件上传文件至php后端, php拿到对应的文件名
    对数据库中一个timestamp类型字段时间上作加减
    小学生作文怎么辅导?
  • 原文地址:https://www.cnblogs.com/codealone/p/4518585.html
Copyright © 2020-2023  润新知