<VirtualHost *:80>
ServerAdmin <a target=_blank href="mailto:admin@test.com">admin@test.com</a>
DocumentRoot "D:\test"
ServerName test.com
<Directory />
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>
<Directory "D:\test">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
3.3 访问权限
httpd.conf文件中对网站各个子文件夹的访问权限可以分开设置,如:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>如上语句指明了默认的访问规则是最严格的“deny from all”。
而后在未修改的httpd.conf文件中(而非上面的)有如下段:
<Directory "c:/wamp/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.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 all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all
</Directory>
按照注释修改,获得完全权限:
# to give access to phpmyadmin from outside
# replace the lines
#
# Order Deny,Allow
#Deny from all
#Allow from 127.0.0.1
#
# by
#
# Order Allow,Deny
# Allow from all
#之后通过浏览器打开phpMyAdmin,配置各项服务。
其中MySQL部分可以执行SQL操作并且声称PHP代码,这些超出本文范畴,不在介绍。