服务器目录
目录说明
bin: apache常用的一些命令
cgi-bin:存放一些脚本语言命令
conf:apache配置文件
error:错误记录
htodcs存放站点文件
logs:记录日志
modules:存放apache模块(动态库)
虚拟目录
指定某个目录为虚拟目录(e:/virtual)
编辑httpd.conf文档
① 指定虚拟目录
<IfModule dir_module>
#欢迎页面,默认访问页面
DirectoryIndex index.php index.php3 index.html index.htm
#站点别名
#如D:/ test下有个a.html,则访问方式为www.yourweb.com/test/a.html
Alias /test “D:/test”
</IfModule>
② 设置访问权限
<Directory “D:/test”>
Order allow,deny
Deny from all //拒绝所有访问者
Allow from localhost //放行localhost
</Directory>
虚拟主机配置
启用虚拟主机设置
Include conf/extra/httpd-vhosts.conf
编辑httpd-vhosts.conf设置虚拟主机
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.hleclerc-PC.ingenidev
DocumentRoot "E:/PHP/"
//一台服务器上可能有多个虚拟主机
//使用ServerName以便加以区分
ServerName www.dy-pc.com
<Directory "E:/PHP/">
Options FollowSymLinks
//设置不允许被覆盖
AllowOverride None
Order deny,allow
allow from all
</Directory>