apache 虚拟主机配置
apache 虚拟主机配置
1, 常见配置
##配置一个虚拟主机 <VirtualHost *:80> ServerAdmin fengjun ##指定主目录 DocumentRoot "E:\\php" ErrorLog "logs/fengjun-error.log" CustomLog "logs/fengjun-access.log" combined </VirtualHost>
2,单独操作目录权限
<VirtualHost *:80> ServerAdmin fengjun DocumentRoot "E:\\php" ErrorLog "logs/fengjun-error.log" CustomLog "logs/fengjun-access.log" combined ##配置目录属性 <Directory "E:\\php"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
3,主机头方式(一个主机同一个端口绑定多个域名)
##开启以域名访问方式 -- 不开启,会访问到第一个匹配的虚拟主机 NameVirtualHost *:80 <Directory "E:\\php"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all </Directory> <VirtualHost *:80> ServerAdmin fengjun DocumentRoot "E:\\php\\home" ##指定域名 ServerName home.fengjun.com ErrorLog "logs/fengjun-error.log" CustomLog "logs/fengjun-access.log" combined </VirtualHost> <VirtualHost *:80> ServerAdmin fengjun DocumentRoot "E:\\php\\study" ##指定域名 ServerName study.fengjun.com ErrorLog "logs/fengjun-error.log" CustomLog "logs/fengjun-access.log" combined </VirtualHost>
相关推荐
Noneyes 2020-11-10
huavhuahua 2020-11-20
weiiron 2020-11-16
ailxxiaoli 2020-11-16
cakecc00 2020-11-15
千锋 2020-11-15
JakobHu 2020-11-14
chensen 2020-11-14
Nostalgiachild 2020-11-13
guangcheng 2020-11-13
zhangxiafll 2020-11-13
jipengx 2020-11-12
xirongxudlut 2020-11-10
solarLan 2020-11-09
pythonxuexi 2020-11-08
文山羊 2020-11-07
susmote 2020-11-07
wuShiJingZuo 2020-11-05
Pythonjeff远 2020-11-06