使用apache配置vhost

时间:2014-04-17 03:11:59

标签: 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.com
    ServerAlias *.example.com
    ErrorLog /ebs1/apache/log/error_log_example.com
    CustomLog /ebs1/apache/log/access_log_example.com personalizado
</VirtualHost>

而不是重复目录&#34; / ebs1 / apache / www / html / sites / example&#34;两次是否可以只使用一次?

1 个答案:

答案 0 :(得分:0)

您可以创建单独的<Directory&gt;配置(在<VirtualHost>块之外)覆盖所有虚拟主机,假设它们各自的目录位于其下面:

<Directory "/ebs1/apache/www/html/sites">
    Options -Indexes
    AllowOverride All
</Directory>