您的位置:首页 > 编程语言 > PHP开发

php虚拟主机配置 权限

2013-04-23 00:30 465 查看
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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: