php虚拟主机配置 权限

httpd.conf 

打开Include conf/extra/httpd-vhosts.conf

在其httpd-vhosts.conf中配置虚拟目录

<VirtualHost *:80>
    ServerAdmin www.xxhong.com
    DocumentRoot D:/dev/php/Apache2.2/htdocs/xxhong
</VirtualHost>
目录配置

如果不配置某个目录,则走默认的目录配置

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

若配置了,则走此

<Directory "D:/dev/php/Apache2.2/htdocs">
    #
    # 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 None

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

</Directory>

放到虚拟主机配置文件中

httpd-vhosts.conf

<VirtualHost *:80>
    ServerAdmin ecshop.xxhong.com
    DocumentRoot D:/dev/php/www/ecshop
    <Directory "D:/dev/php/www">
       Allow from all
    </Directory>
</VirtualHost>

分部式配置

.htaccess  当前目录 及子目录  

<VirtualHost *:80>
    ServerAdmin ecshop.xxhong.com
    DocumentRoot D:/dev/php/www/ecshop
    <Directory "D:/dev/php/www">
       Allow from all

   AllowOverride All
    </Directory>
</VirtualHost>

原文地址:https://www.cnblogs.com/xxhong/p/3036897.html