zoukankan      html  css  js  c++  java
  • PHP 配置多站点多目录

    Apache配置httpd.conf

    #增加监听端  可以通过netstat -n -a查看端口是否开启
    # Listen: Allows you to bind Apache to specific IP addresses and/or
    # ports, instead of the default. See also the <VirtualHost>
    # directive.
    #
    # Change this to Listen on specific IP addresses as shown below to
    # prevent Apache from glomming onto all bound IP addresses.
    #
    #Listen 12.34.56.78:80
    Listen 80
    Listen 8081
    #开启虚拟站点
    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf
     
    配置conf/extra/httpd-vhosts.conf

    <VirtualHost *:8081>
    ServerAdmin webmaster@dummy-host.localhost
    DocumentRoot "E:Kenwork_spacePHPe4"
    ServerName localhost
    ServerAlias localhost
    ErrorLog "logs/dummy-host.localhost-error.log"
    CustomLog "logs/dummy-host.localhost-access.log" common
      <Directory "E:Kenwork_spacePHPe4">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
      </Directory>
    </VirtualHost>

    就这样重启服务就可以了。

    可能会碰到xampp Apache Access forbidden! Error 403 错误。

    方法:配置httpd.conf

    <Directory />
    #AllowOverride none
    #Require all denied
    Order deny,allow
    Allow from all
    </Directory>

    重启服务,搞定!

    方法2:配置conf/extra/httpd-vhosts.conf

    <VirtualHost *:8081>
        ServerAdmin webmaster@dummy-host.localhost
        DocumentRoot "E:Kenwork_spacePHPe4"
        ServerName localhost
        ServerAlias localhost
        ErrorLog "logs/dummy-host.localhost-error.log"
        CustomLog "logs/dummy-host.localhost-access.log" common   
        <Directory "E:Kenwork_spacePHPe4">  
              Options Indexes FollowSymLinks Includes ExecCGI 
                    AllowOverride All 
                    Require all granted
      </Directory>
    </VirtualHost>
  • 相关阅读:
    快速读取txt文档
    ASP.NET中缓存非SQLServer数据库数据
    查看linq to sql 生成的sql 语句
    跟树有关的数据结构学习系列之概览
    Linux安装软件包时的“依赖关系树”算法(C#)
    Go调度器介绍和容易忽视的问题
    搞懂Go垃圾回收
    Go“一个包含nil指针的接口不是nil接口”踩坑
    Go slice:切片的“陷阱”和本质
    C#调用ODBC连接SQL Server数据库的存储过程
  • 原文地址:https://www.cnblogs.com/kenwong/p/4685228.html
Copyright © 2011-2022 走看看