configurationapache服务于2站点,但使用1 /相同的图像目录

任何人都可以帮我configurationApache来做:

[[[>> >>configurationapache2服务于2个站点,但提供来自同一图像目录的图像]]]]

我的问题是最好放置图像目录的位置,以便图像由Apache为两个网站,即。 从一个相同的目录,以及如何告诉Apache在configuration文件中做到这一点。

谢谢。

使用Alias请参阅: http : //httpd.apache.org/docs/current/mod/mod_alias.html#alias

 Listen 0.0.0.0:80 NameVirtualHost *:80 <VirtualHost *:80> ServerName www.example1.com Alias /images /var/www/common/images DocumentRoot /var/www/example1.com </VirtualHost> <VirtualHost *:80> ServerName www.example2.com Alias /images /var/www/common/images DocumentRoot /var/www/example2.com </VirtualHost>