Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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