I want to put expiration setting similar to mentioned here. http://serverfault.com/questions/15411/apache-caching-with-modheaders-modexpires#answer-15524

However I am not sure where should I put that code. I am running apach2 on ubuntu and I have 4 vhost in my apache. A vhost config is something similar to this one

<VirtualHost xx.xx.xx.xx:80>
ServerName xxxxxx
ServerAlias xxxxxxxxxx
DocumentRoot /home/xxxx/current/public
<Directory "/home/xxx/current/public">
        Options FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
</Directory>
</VirtualHost>

My gut feeling is that I should put stuff after the end of directory. That would be after this tag . Is that the right place to put the expiration code.

And I am also assuming that I would be repeating the same code for all 4 vhosts. They all need same configuration.

link|improve this question

20% accept rate
feedback

1 Answer

You can put it anywhere inside <VirtualHost>. So after <Directory>…</Directory> is fine, as is before it, or between ServerName and ServerAlias, etc.

You can probably put it outside the vhost as well, in which case it'll apply to all vhosts (but I'm not completely sure on this).

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.