XAMPP Apache配置

一、E:\xampp\apache\conf下 httpd.conf 的配置如下

1、将   Include conf/extra/httpd-vhosts.conf    前边的注释去掉

2、设置根目录   DocumentRoot "E:/workspace"

E:/workspace">
    #
    # 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.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks Includes ExecCGI

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

    #
    # Controls who can get stuff from this server.
    #
    Require all granted

二、E:\xampp\apache\conf\extra下 httpd-vhosts.conf 的配置如下


  ServerAdmin www.statistics.com
  DocumentRoot "E:/workspace/Sma_Statistics/MarketingManage"
  ServerName statistics.com
  ServerAlias www.statistics.com
  ErrorLog "logs/web.log"
  CustomLog "logs/web.log" common

如果项目路径不是根目录,则需加上以下红色部分配置

  ServerAdmin www.tp.com
  DocumentRoot "E:/workspace1/TPStudy"
   
      AllowOverride All  
      Order deny,allow  
      Allow from all  
      Require all granted  
 

  ServerName tp.com
  ServerAlias www.tp.com
  ErrorLog "logs/web.log"
  CustomLog "logs/web.log" common

三、C:\Windows\System32\drivers\etc下 hosts 的配置如下

127.0.0.1             www.tp.com




你可能感兴趣的:(个人笔记)