虚拟主机配置
虚拟主机配置
*********************************************************************************************
先加载虚拟主机配置文件。apache/conf/httpd.conf
# shop项目的虚拟主机
<VirtualHost *:80>
# 域名
ServerName www.shop.com
# 网站根目录
DocumentRoot "d:/class/php140706/shop"
# 设置目录访问权限
<Directory "d:/class/php140706/shop">
# 设置顺序
Order Deny,Allow
Deny from all
Allow from all
# 如果不存在访问文件,则列出所有文件列表
Options Indexes
# 默认访问的文件
DirectoryIndex index.php
</Directory>
</VirtualHost>
#localhost虚拟主机
<VirtualHost *:80>
# 域名
ServerName localhost
# 网站根目录
DocumentRoot "d:/server/apache/htdocs"
# 设置目录访问权限
<Directory "d:/server/apache/htdocs">
# 设置顺序
Order Deny,Allow
Deny from all
Allow from all
# 如果不存在访问文件,则列出所有文件列表
Options Indexes
</Directory>
</VirtualHost>
*********************************************************************************************