Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to put expiration setting similar to mentioned here.

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

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

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


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.