Php 使用apache配置vhost
我有以下vhost:Php 使用apache配置vhost,php,apache,Php,Apache,我有以下vhost: <VirtualHost *:9090> DocumentRoot /ebs1/apache/www/html/sites/example <Directory "/ebs1/apache/www/html/sites/example"> Options -Indexes AllowOverride All </Directory> ServerName example.co
<VirtualHost *:9090>
DocumentRoot /ebs1/apache/www/html/sites/example
<Directory "/ebs1/apache/www/html/sites/example">
Options -Indexes
AllowOverride All
</Directory>
ServerName example.com
ServerAlias *.example.com
ErrorLog /ebs1/apache/log/error_log_example.com
CustomLog /ebs1/apache/log/access_log_example.com personalizado
</VirtualHost>
不必重复目录/ebs1/apache/www/html/sites/example两次,是否可以只使用一次?您可以在块外创建一个单独的配置,覆盖所有虚拟主机,前提是它们各自的目录在下面:
<Directory "/ebs1/apache/www/html/sites">
Options -Indexes
AllowOverride All
</Directory>
不,您必须声明它两次,除非您无意在不存在索引时删除查看文件结构的功能,并且不希望任何其他.htaccess文件覆盖所有设置。这太好了!所以我所有的虚拟主机xxx,yyy,zzz。。。指向/ebs1/apache/www/html/sites/xxx,yyy,zzz的将继承选项并允许覆盖?