多域名虚拟主机配置

httpd.conf位置/usr/local/http2/conf/httpd.conf

1
2
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

(httpd-vhosts.conf)多域名虚拟主机配置在httpd.conf中默认关闭。取消#,多域名虚拟主机配置包含进来之后,该文件中的代码也就生效了,(httpd-vhosts.conf)也就相当于httpd.conf配置文件的一部分

1
2
3
4
5
6
ServerName
DocumentRoot
Directory权限设定
配置示例

DocumentRoot "/var/www/html/shop"
ServerName 192.168.56.110
<Directory "/var/www/html/shop">
    Options Indexes
    Order deny,allow
    Allow from all
 </Directory>


```

Contents
|