2014-01-24 43 views
0

我將下面的代碼添加到httpd.conf中,它可以工作。httpd.conf VS httpd-vhosts.conf

我刪除了下面的代碼並添加到httpd-vhosts.conf中,它也可以。

爲什麼xampp提供httpd-vhosts.conf如果常規文件名爲httpd.conf可以自行運行?

例如:

<VirtualHost 127.0.0.2:80> 
    DocumentRoot "F:/server/htdocs" 
    ServerName google.com 
    ServerAlias www.google.com 
    ErrorLog "logs/google.com-error.log" 
    CustomLog "logs/google.dec-access.log" combined 

    <Directory "F:/server/htdocs"> 
     Options Indexes FollowSymLinks ExecCGI Includes 
     Order allow,deny 
     Allow from all 
     AllowOverride All 
     Require all granted 
    </Directory> 
</VirtualHost> 

回答

0

一些Apache版本提供了一些文件,當您應用維護,將被覆蓋,而其它的保持不變的用戶。所有的配置文件都是從Apaches的角度創建的。

0

在httpd.conf中您有「Include」參數。它包含另一個conf文件的路徑 - 在你的情況下它是httpd-vhosts.conf的路徑