XAMPP Apache配置

来源:互联网 发布:手机淘宝店铺关注链接 编辑:程序博客网 时间:2024/05/22 08:02

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

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

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

<Directory "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
</Directory>

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

<VirtualHost *:80>
  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
</VirtualHost>
如果项目路径不是根目录,则需加上以下红色部分配置
<VirtualHost *:80>
  ServerAdmin www.tp.com
  DocumentRoot "E:/workspace1/TPStudy"
  <Directory />  
      AllowOverride All  
      Order deny,allow  
      Allow from all  
      Require all granted  
  </Directory>

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

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

127.0.0.1             www.tp.com




0 0
原创粉丝点击