1,安装完apache后,项目默认根路径是E:\Program Files\AppServ\www。

默认根路径在httpd.conf中默认配置过了,我们可以通过修改配置文件改变项目默认根路径。

DocumentRoot "E:/PROGRA~1/AppServ/www"
<Directory "E:/PROGRA~1/AppServ/www">
    #
    # 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

    #
    # 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.
    #
    Require all granted
</Directory>

2,开启虚拟主机配置时候,会在httpd-vhosts.conf中进行类似配置,但是httpd-vhosts.conf中配置的目录一定是httpd.conf配置的目录或其子目录。这样httpd-vhosts.conf和httpd.conf同时对根目录进行了配置,我们可以将httpd.conf当做父类,httpd-vhosts.conf为子类,当父类,子类中都有设置时候,以子类为准;如果子类没有设置,以父类设置为准。

  

相关文章:

  • 2022-12-23
  • 2022-01-09
  • 2021-04-01
  • 2021-11-05
  • 2021-12-15
  • 2021-11-07
  • 2021-10-14
  • 2021-11-08
猜你喜欢
  • 2021-05-17
  • 2021-05-26
  • 2021-11-18
  • 2021-08-03
  • 2022-01-20
  • 2021-07-04
  • 2022-12-23
相关资源
相似解决方案